From f83508cedf7c14ba21aeabfcef7ddba65f0faa31 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Tue, 22 Apr 2025 01:28:29 -0400 Subject: [PATCH 1/4] smoke test: Fix cluster DRS smoke test failure on XenServer / XCP-ng --- test/integration/smoke/test_cluster_drs.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/integration/smoke/test_cluster_drs.py b/test/integration/smoke/test_cluster_drs.py index f1eb48f92f52..31ddf016d5cf 100644 --- a/test/integration/smoke/test_cluster_drs.py +++ b/test/integration/smoke/test_cluster_drs.py @@ -23,11 +23,12 @@ 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 @@ def setUpClass(cls): 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 = 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") From 48419694efa432bf7f845a3fab0e81eeae77b4e3 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Tue, 22 Apr 2025 23:47:45 +0530 Subject: [PATCH 2/4] Update test_cluster_drs.py --- test/integration/smoke/test_cluster_drs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_cluster_drs.py b/test/integration/smoke/test_cluster_drs.py index 31ddf016d5cf..53abe7fd8e31 100644 --- a/test/integration/smoke/test_cluster_drs.py +++ b/test/integration/smoke/test_cluster_drs.py @@ -45,7 +45,7 @@ def setUpClass(cls): zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) cls.zone = Zone(zone.__dict__) cls.hypervisor = cls.testClient.getHypervisorInfo() - cls.template = cls.template = get_test_template( + cls.template = get_test_template( cls.apiclient, cls.zone.id, cls.hypervisor From eb90db14f115bdb6b91be081bb23ac8c28672949 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Wed, 23 Apr 2025 10:19:04 +0530 Subject: [PATCH 3/4] fix non-strict affinity group tests on Xenserver due to missing PV drivers on template used for VM --- test/integration/smoke/test_nonstrict_affinity_group.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/integration/smoke/test_nonstrict_affinity_group.py b/test/integration/smoke/test_nonstrict_affinity_group.py index 27b7d341bd32..c2d178d81d52 100644 --- a/test/integration/smoke/test_nonstrict_affinity_group.py +++ b/test/integration/smoke/test_nonstrict_affinity_group.py @@ -37,7 +37,8 @@ from marvin.lib.common import (get_domain, get_zone, - get_template) + get_template, + get_test_template) class TestNonStrictAffinityGroups(cloudstackTestCase): @@ -54,7 +55,11 @@ def setUpClass(cls): 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() + if cls.hypervisor.lower() not in ["xenserver"]: + cls.template = get_template(cls.apiclient, cls.zone.id) + else: + cls.template = get_test_template(cls.apiclient, cls.zone.id, cls.hypervisor) cls._cleanup = [] cls.logger = logging.getLogger("TestNonStrictAffinityGroups") From 39d6d88968451b8c67e528545328aa67a2097a8a Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Thu, 24 Apr 2025 14:40:52 +0530 Subject: [PATCH 4/4] address comment --- test/integration/smoke/test_nonstrict_affinity_group.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/integration/smoke/test_nonstrict_affinity_group.py b/test/integration/smoke/test_nonstrict_affinity_group.py index c2d178d81d52..1b9b0c02c709 100644 --- a/test/integration/smoke/test_nonstrict_affinity_group.py +++ b/test/integration/smoke/test_nonstrict_affinity_group.py @@ -21,6 +21,7 @@ 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 @@ -56,10 +57,10 @@ def setUpClass(cls): zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) cls.zone = Zone(zone.__dict__) cls.hypervisor = cls.testClient.getHypervisorInfo() - if cls.hypervisor.lower() not in ["xenserver"]: - cls.template = get_template(cls.apiclient, cls.zone.id) - else: - cls.template = get_test_template(cls.apiclient, cls.zone.id, cls.hypervisor) + 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")