This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new 9d9737ae040 smoke tests: Fix cluster DRS & non-strict host affinity 
smoke test failures on XenServer / XCP-ng (#10761)
9d9737ae040 is described below

commit 9d9737ae040978d73a322479e16dd866a087dc10
Author: Pearl Dsilva <[email protected]>
AuthorDate: Sat Apr 26 21:09:17 2025 +0530

    smoke tests: Fix cluster DRS & non-strict host affinity smoke test failures 
on XenServer / XCP-ng (#10761)
---
 test/integration/smoke/test_cluster_drs.py              | 13 +++++++++++--
 test/integration/smoke/test_nonstrict_affinity_group.py | 10 ++++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/test/integration/smoke/test_cluster_drs.py 
b/test/integration/smoke/test_cluster_drs.py
index f1eb48f92f5..53abe7fd8e3 100644
--- a/test/integration/smoke/test_cluster_drs.py
+++ b/test/integration/smoke/test_cluster_drs.py
@@ -23,11 +23,12 @@ import logging
 import time
 from collections.abc import Iterable
 
+from marvin.codes import FAILED
 from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.cloudstackAPI import (migrateSystemVm, listRouters, listSystemVms)
 from marvin.lib.base import (Cluster, Configurations, Host, Network, 
NetworkOffering, ServiceOffering, VirtualMachine,
                              Zone)
-from marvin.lib.common import (get_domain, get_zone, get_template)
+from marvin.lib.common import (get_domain, get_zone, get_test_template)
 from marvin.lib.utils import wait_until
 from marvin import jsonHelper
 from nose.plugins.attrib import attr
@@ -43,7 +44,15 @@ class TestClusterDRS(cloudstackTestCase):
 
         zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
         cls.zone = Zone(zone.__dict__)
-        cls.template = get_template(cls.apiclient, cls.zone.id)
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        cls.template = get_test_template(
+            cls.apiclient,
+            cls.zone.id,
+            cls.hypervisor
+        )
+        if cls.template == FAILED:
+            assert False, "get_test_template() failed to return template\
+                        with hypervisor %s" % cls.hypervisor
         cls._cleanup = []
 
         cls.logger = logging.getLogger("TestClusterDRS")
diff --git a/test/integration/smoke/test_nonstrict_affinity_group.py 
b/test/integration/smoke/test_nonstrict_affinity_group.py
index 27b7d341bd3..1b9b0c02c70 100644
--- a/test/integration/smoke/test_nonstrict_affinity_group.py
+++ b/test/integration/smoke/test_nonstrict_affinity_group.py
@@ -21,6 +21,7 @@ Tests of Non-Strict (host anti-affinity and host affinity) 
affinity groups
 
 import logging
 
+from marvin.codes import FAILED
 from nose.plugins.attrib import attr
 from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.cloudstackAPI import startVirtualMachine, stopVirtualMachine, 
destroyVirtualMachine
@@ -37,7 +38,8 @@ from marvin.lib.base import (Account,
 
 from marvin.lib.common import (get_domain,
                                get_zone,
-                               get_template)
+                               get_template,
+                               get_test_template)
 
 
 class TestNonStrictAffinityGroups(cloudstackTestCase):
@@ -54,7 +56,11 @@ class TestNonStrictAffinityGroups(cloudstackTestCase):
 
         zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
         cls.zone = Zone(zone.__dict__)
-        cls.template = get_template(cls.apiclient, cls.zone.id)
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        cls.template = get_test_template(cls.apiclient, cls.zone.id, 
cls.hypervisor)
+        if cls.template == FAILED:
+            assert False, "get_test_template() failed to return template\
+                        with hypervisor %s" % cls.hypervisor
         cls._cleanup = []
 
         cls.logger = logging.getLogger("TestNonStrictAffinityGroups")

Reply via email to