Skip to content

Commit 538e35f

Browse files
test: fix test_restore_vm failure on vmware (#10885)
* test: fix test_restore_vm failure on vmware * Fix URL for cloud-init vms on vmware/xen
1 parent badf3e1 commit 538e35f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
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):

tools/marvin/marvin/config/test_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@
10801080
"format": "vhd",
10811081
"hypervisor": "xenserver",
10821082
"ostype": "Other Linux (64-bit)",
1083-
"url": "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-azure.vhd.tar.gz",
1083+
"url": "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64-azure.vhd.tar.gz",
10841084
"requireshvm": "True",
10851085
"ispublic": "True",
10861086
"isextractable": "True"
@@ -1091,7 +1091,7 @@
10911091
"format": "ova",
10921092
"hypervisor": "vmware",
10931093
"ostype": "Other Linux (64-bit)",
1094-
"url": "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.ova",
1094+
"url": "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64.ova",
10951095
"requireshvm": "True",
10961096
"ispublic": "True",
10971097
"deployasis": "False"

0 commit comments

Comments
 (0)