Skip to content

Commit 915fdea

Browse files
committed
Fix smoke test for restore vm strict tags failure
1 parent 653b973 commit 915fdea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/integration/smoke/test_vm_strict_host_tags.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,11 @@ def test_02_restore_vm_strict_tags_failure(self):
420420

421421
self.assertEqual(self.host_h1.id, vm.hostid, "VM instance was not deployed on target host ID")
422422
try:
423+
# remove vm from cleanup list since it should not be restored and the vm gets expunged
424+
self.cleanup.remove(vm)
423425
vm.restore(self.apiclient, templateid=self.template_t2.id, expunge=True)
426+
# If restore is successful, it will be added to the cleanup list. Ideally, this code should not be reached.
427+
self.cleanup.append(vm)
424428
self.fail("VM should not be restored")
425429
except Exception as e:
426430
self.assertTrue("No suitable host found for vm " in str(e))

0 commit comments

Comments
 (0)