Skip to content

Commit fc5c8be

Browse files
committed
test: fix test_restore_vm failure on vmware
1 parent 4259e0b commit fc5c8be

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/integration/smoke/test_restore_vm.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,13 @@ def test_03_restore_vm_with_disk_offering_custom_size(self):
148148
self.assertEqual(root_vol.state, 'Ready', "Volume should be in Ready state")
149149
self.assertEqual(root_vol.size, 16 * 1024 * 1024 * 1024, "Size of volume and custom disk size should match")
150150

151-
old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)[0]
152-
self.assertEqual(old_root_vol.state, "Destroy", "Old volume should be in Destroy state")
153-
Volume.delete(old_root_vol, self.apiclient)
151+
if self.hypervisor.lower() == "vmware":
152+
old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)
153+
self.assertEqual(old_root_vol, None, "Old volume should be deleted")
154+
else:
155+
old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)[0]
156+
self.assertEqual(old_root_vol.state, "Destroy", "Old volume should be in Destroy state")
157+
Volume.delete(old_root_vol, self.apiclient)
154158

155159
@attr(tags=["advanced", "basic"], required_hardware="false")
156160
def test_04_restore_vm_allocated_root(self):

0 commit comments

Comments
 (0)