Skip to content

Commit 9d9737a

Browse files
authored
smoke tests: Fix cluster DRS & non-strict host affinity smoke test failures on XenServer / XCP-ng (#10761)
1 parent 9d263cd commit 9d9737a

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

test/integration/smoke/test_cluster_drs.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
import time
2424
from collections.abc import Iterable
2525

26+
from marvin.codes import FAILED
2627
from marvin.cloudstackTestCase import cloudstackTestCase
2728
from marvin.cloudstackAPI import (migrateSystemVm, listRouters, listSystemVms)
2829
from marvin.lib.base import (Cluster, Configurations, Host, Network, NetworkOffering, ServiceOffering, VirtualMachine,
2930
Zone)
30-
from marvin.lib.common import (get_domain, get_zone, get_template)
31+
from marvin.lib.common import (get_domain, get_zone, get_test_template)
3132
from marvin.lib.utils import wait_until
3233
from marvin import jsonHelper
3334
from nose.plugins.attrib import attr
@@ -43,7 +44,15 @@ def setUpClass(cls):
4344

4445
zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
4546
cls.zone = Zone(zone.__dict__)
46-
cls.template = get_template(cls.apiclient, cls.zone.id)
47+
cls.hypervisor = cls.testClient.getHypervisorInfo()
48+
cls.template = get_test_template(
49+
cls.apiclient,
50+
cls.zone.id,
51+
cls.hypervisor
52+
)
53+
if cls.template == FAILED:
54+
assert False, "get_test_template() failed to return template\
55+
with hypervisor %s" % cls.hypervisor
4756
cls._cleanup = []
4857

4958
cls.logger = logging.getLogger("TestClusterDRS")

test/integration/smoke/test_nonstrict_affinity_group.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import logging
2323

24+
from marvin.codes import FAILED
2425
from nose.plugins.attrib import attr
2526
from marvin.cloudstackTestCase import cloudstackTestCase
2627
from marvin.cloudstackAPI import startVirtualMachine, stopVirtualMachine, destroyVirtualMachine
@@ -37,7 +38,8 @@
3738

3839
from marvin.lib.common import (get_domain,
3940
get_zone,
40-
get_template)
41+
get_template,
42+
get_test_template)
4143

4244

4345
class TestNonStrictAffinityGroups(cloudstackTestCase):
@@ -54,7 +56,11 @@ def setUpClass(cls):
5456

5557
zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
5658
cls.zone = Zone(zone.__dict__)
57-
cls.template = get_template(cls.apiclient, cls.zone.id)
59+
cls.hypervisor = cls.testClient.getHypervisorInfo()
60+
cls.template = get_test_template(cls.apiclient, cls.zone.id, cls.hypervisor)
61+
if cls.template == FAILED:
62+
assert False, "get_test_template() failed to return template\
63+
with hypervisor %s" % cls.hypervisor
5864
cls._cleanup = []
5965

6066
cls.logger = logging.getLogger("TestNonStrictAffinityGroups")

0 commit comments

Comments
 (0)