Skip to content

Commit 88d1dc2

Browse files
committed
smoke test changes
check if the hypervisor is KVM check if the primary storage's scope is ZONE wide
1 parent 3bc8eeb commit 88d1dc2

File tree

2 files changed

+50
-9
lines changed

2 files changed

+50
-9
lines changed

test/integration/smoke/test_vm_lifecycle_with_snapshot_or_volume.py

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
get_zone,
3636
get_template,
3737
list_hosts,
38-
list_volumes)
38+
list_volumes,
39+
list_storage_pools)
3940
from marvin.codes import FAILED, PASS
4041
from nose.plugins.attrib import attr
4142

@@ -56,6 +57,10 @@ def setUpClass(cls):
5657
cls.services['mode'] = cls.zone.networktype
5758
cls.hypervisor = testClient.getHypervisorInfo()
5859

60+
if cls.hypervisor.lower() != "kvm":
61+
cls.unsupportedHypervisor = True
62+
return
63+
5964
cls.template = get_template(
6065
cls.apiclient,
6166
cls.zone.id,
@@ -76,11 +81,44 @@ def setUpClass(cls):
7681
cls._cleanup.append(cls.account)
7782
cls.debug(cls.account.id)
7883

79-
cls.service_offering = ServiceOffering.create(
80-
cls.apiclient,
81-
cls.services["service_offerings"]["tiny"]
82-
)
83-
cls._cleanup.append(cls.service_offering)
84+
storage_pools_response = list_storage_pools(cls.apiclient,
85+
zoneid=cls.zone.id,
86+
scope="ZONE")
87+
88+
if storage_pools_response:
89+
cls.zone_wide_storage = storage_pools_response[0]
90+
91+
cls.debug(
92+
"zone wide storage id is %s" %
93+
cls.zone_wide_storage.id)
94+
update1 = StoragePool.update(cls.apiclient,
95+
id=cls.zone_wide_storage.id,
96+
tags="test-vm"
97+
)
98+
cls.debug(
99+
"Storage %s pool tag%s" %
100+
(cls.zone_wide_storage.id, update1.tags))
101+
cls.service_offering = ServiceOffering.create(
102+
cls.apiclient,
103+
cls.services["service_offerings"]["small"],
104+
tags="test-vm"
105+
)
106+
cls._cleanup.append(cls.service_offering)
107+
108+
do = {
109+
"name": "do-tags",
110+
"displaytext": "Disk offering with tags",
111+
"disksize":8,
112+
"tags": "test-vm"
113+
}
114+
cls.disk_offering = DiskOffering.create(
115+
cls.apiclient,
116+
do,
117+
)
118+
cls._cleanup.append(cls.disk_offering)
119+
else:
120+
cls.debug("No zone wide storage found")
121+
return
84122

85123
cls.virtual_machine = VirtualMachine.create(
86124
cls.apiclient,
@@ -259,7 +297,7 @@ def create_volume_from_snapshot_deploy_vm(self, snapshotid):
259297
volume = Volume.create_from_snapshot(
260298
self.apiclient,
261299
snapshot_id=snapshotid,
262-
services=self.services["volume_from_snapshot"],
300+
disk_offering=self.disk_offering.id,
263301
zoneid=self.zone.id,
264302
)
265303
virtual_machine = VirtualMachine.create(self.apiclient,

tools/marvin/marvin/lib/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,10 +2738,13 @@ def __init__(self, items):
27382738
self.__dict__.update(items)
27392739

27402740
@classmethod
2741-
def create(cls, apiclient, services, tags=None, custom=False, domainid=None, cacheMode=None, **kwargs):
2741+
def create(cls, apiclient, services, tags=None, custom=False, domainid=None, cacheMode=None, displaytext=None, **kwargs):
27422742
"""Create Disk offering"""
27432743
cmd = createDiskOffering.createDiskOfferingCmd()
2744-
cmd.displaytext = services["displaytext"]
2744+
if displaytext:
2745+
cmd.displaytext = displaytext
2746+
else:
2747+
cmd.displaytext = services["displaytext"]
27452748
cmd.name = services["name"]
27462749
if custom:
27472750
cmd.customized = True

0 commit comments

Comments
 (0)