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
This commit is contained in:
Wei Zhou 2025-05-19 12:24:18 +02:00 committed by GitHub
parent badf3e18da
commit 538e35f8ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -148,9 +148,13 @@ class TestRestoreVM(cloudstackTestCase):
self.assertEqual(root_vol.state, 'Ready', "Volume should be in Ready state")
self.assertEqual(root_vol.size, 16 * 1024 * 1024 * 1024, "Size of volume and custom disk size should match")
old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)[0]
self.assertEqual(old_root_vol.state, "Destroy", "Old volume should be in Destroy state")
Volume.delete(old_root_vol, self.apiclient)
if self.hypervisor.lower() == "vmware":
old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)
self.assertEqual(old_root_vol, None, "Old volume should be deleted")
else:
old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)[0]
self.assertEqual(old_root_vol.state, "Destroy", "Old volume should be in Destroy state")
Volume.delete(old_root_vol, self.apiclient)
@attr(tags=["advanced", "basic"], required_hardware="false")
def test_04_restore_vm_allocated_root(self):

View File

@ -1080,7 +1080,7 @@ test_data = {
"format": "vhd",
"hypervisor": "xenserver",
"ostype": "Other Linux (64-bit)",
"url": "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-azure.vhd.tar.gz",
"url": "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64-azure.vhd.tar.gz",
"requireshvm": "True",
"ispublic": "True",
"isextractable": "True"
@ -1091,7 +1091,7 @@ test_data = {
"format": "ova",
"hypervisor": "vmware",
"ostype": "Other Linux (64-bit)",
"url": "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.ova",
"url": "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64.ova",
"requireshvm": "True",
"ispublic": "True",
"deployasis": "False"