mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(POOLER-73) Add spec tests for remove_nonexistent_vm
Add spec tests for remove_nonexistent_vm
This commit is contained in:
parent
9fdb51eb00
commit
b5ec74bae9
1 changed files with 20 additions and 0 deletions
|
|
@ -120,6 +120,26 @@ describe 'Pool Manager' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#remove_nonexistent_vm' do
|
||||||
|
before do
|
||||||
|
expect(subject).not_to be_nil
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'removes VM from pending in redis' do
|
||||||
|
create_pending_vm(pool,vm)
|
||||||
|
|
||||||
|
expect(redis.sismember("vmpooler__pending__#{pool}", vm)).to be(true)
|
||||||
|
subject.remove_nonexistent_vm(vm, pool)
|
||||||
|
expect(redis.sismember("vmpooler__pending__#{pool}", vm)).to be(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'logs msg' do
|
||||||
|
expect(logger).to receive(:log).with('d', "[!] [#{pool}] '#{vm}' no longer exists. Removing from pending.")
|
||||||
|
|
||||||
|
subject.remove_nonexistent_vm(vm, pool)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '#move_vm_to_ready' do
|
describe '#move_vm_to_ready' do
|
||||||
before do
|
before do
|
||||||
expect(subject).not_to be_nil
|
expect(subject).not_to be_nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue