-
Notifications
You must be signed in to change notification settings - Fork 1.2k
test: fix test_restore_vm failure on vmware #10885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix test_restore_vm failure on vmware #10885
Conversation
I do not understand why the old volume is expunged only for vmware cloudstack/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java Lines 8435 to 8446 in d5ba23c
it is the root cause |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10885 +/- ##
============================================
- Coverage 16.14% 16.13% -0.01%
+ Complexity 13240 13239 -1
============================================
Files 5656 5656
Lines 497578 497578
Branches 60332 60332
============================================
- Hits 80310 80299 -11
- Misses 408317 408330 +13
+ Partials 8951 8949 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@blueorangutan package |
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13433 |
@blueorangutan test ol8 vmware-80u3 |
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-80u3) has been kicked to run smoke tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm, somehow my commit was missed in PR #10586
# git diff
diff --git a/test/integration/smoke/test_restore_vm.py b/test/integration/smoke/test_restore_vm.py
index aac33460da1..6ce06c957e6 100644
--- a/test/integration/smoke/test_restore_vm.py
+++ b/test/integration/smoke/test_restore_vm.py
@@ -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() not in ["vmware"]:
+ 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)
+ else:
+ old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)
+ self.assertEqual(old_root_vol, None, "Old volume should be deleted")
@attr(tags=["advanced", "basic"], required_hardware="false")
def test_04_restore_vm_allocated_root(self):
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index bde48c87616..c90037ea22e 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -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": "True"
...
# git log -1
commit 3b34d1f4718ea52aa3a186b9be1a5c0249f0f28d (HEAD -> vmware-80u2-and-80u3-updates)
Author: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
Date: Thu Apr 10 11:56:26 2025 +0530
Updated restore vm test for VMware (old root volume is expunged in VMware as it is replaced by the new root volume)
thanks @sureshanaparti merging as the smoke tests passed |
[SF] Trillian test result (tid-13346)
|
* test: fix test_restore_vm failure on vmware * Fix URL for cloud-init vms on vmware/xen
Description
This PR fixes the test failure below on vmware
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?