Merge branch 'master' into providers

This commit is contained in:
mattkirby 2018-07-24 16:34:20 -07:00 committed by GitHub
commit c9c97e1568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 311 additions and 56 deletions

View file

@ -750,6 +750,12 @@ EOT
subject._destroy_vm(vm,pool,provider)
end
it 'should dereference the mutex' do
expect(subject).to receive(:dereference_mutex)
subject._destroy_vm(vm,pool,provider)
end
end
context 'when the VM destruction raises an eror' do
@ -1714,6 +1720,26 @@ EOT
end
end
describe '#dereference_mutex' do
it 'should return nil when no mutex is dereferenced' do
expect(subject.dereference_mutex(vm)).to be_nil
end
it 'should return true when a mutex is dereferenced' do
subject.vm_mutex(vm)
expect(subject.dereference_mutex(vm)).to be true
end
it 'should dereference the mutex' do
mutex = subject.vm_mutex(vm)
subject.dereference_mutex(vm)
result = subject.vm_mutex(vm)
expect(result).to_not eq(mutex)
end
end
describe 'sync_pool_template' do
let(:old_template) { 'templates/old-template' }
let(:new_template) { 'templates/new-template' }