Skip to content

Commit 7c15f14

Browse files
sedukullAbhinandan Prateek
authored andcommitted
CLOUDSTACK-6914: Fixed the mentioned issue
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
1 parent 09a97e1 commit 7c15f14

39 files changed

Lines changed: 214 additions & 214 deletions

test/integration/smoke/test_affinity_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def setUpClass(cls):
7575
]
7676
return
7777

78-
@attr(tags=["simulator", "basic", "advanced", "multihost", "selfservice"])
78+
@attr(tags=["basic", "advanced", "multihost"], required_hardware="false")
7979
def test_DeployVmAntiAffinityGroup(self):
8080
"""
8181
test DeployVM in anti-affinity groups

test/integration/smoke/test_deploy_vgpu_enabled_vm.py

Lines changed: 32 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#Test from the Marvin - Testing in Python wiki
1919

2020
#All tests inherit from cloudstackTestCase
21-
from marvin.cloudstackTestCase import cloudstackTestCase
21+
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
2222

2323
#Import Integration Libraries
2424

@@ -29,121 +29,56 @@
2929
from marvin.lib.utils import cleanup_resources
3030

3131
#common - commonly used methods for all tests are listed here
32-
from marvin.lib.common import get_zone, get_domain, get_template
32+
from marvin.lib.common import get_zone, get_domain, get_template, list_hosts
3333

34-
from marvin.codes import FAILED
34+
from marvin.sshClient import SshClient
3535

36-
from nose.plugins.attrib import attr
37-
38-
39-
class Services:
40-
"""Test VM Life Cycle Services
41-
"""
42-
43-
def __init__(self):
44-
self.services = {
45-
"disk_offering":{
46-
"displaytext": "Small",
47-
"name": "Small",
48-
"disksize": 1
49-
},
50-
"account": {
51-
"email": "test@test.com",
52-
"firstname": "Test",
53-
"lastname": "User",
54-
"username": "test",
55-
# Random characters are appended in create account to
56-
# ensure unique username generated each time
57-
"password": "password",
58-
},
59-
"vgpu260q": # Create a virtual machine instance with vgpu type as 260q
60-
{
61-
"displayname": "testserver",
62-
"username": "root", # VM creds for SSH
63-
"password": "password",
64-
"ssh_port": 22,
65-
"hypervisor": 'XenServer',
66-
"privateport": 22,
67-
"publicport": 22,
68-
"protocol": 'TCP',
69-
},
70-
"vgpu140q": # Create a virtual machine instance with vgpu type as 140q
71-
{
72-
"displayname": "testserver",
73-
"username": "root",
74-
"password": "password",
75-
"ssh_port": 22,
76-
"hypervisor": 'XenServer',
77-
"privateport": 22,
78-
"publicport": 22,
79-
"protocol": 'TCP',
80-
},
81-
"service_offerings":
82-
{
83-
"vgpu260qwin":
84-
{
85-
"name": "Windows Instance with vGPU260Q",
86-
"displaytext": "Windows Instance with vGPU260Q",
87-
"cpunumber": 2,
88-
"cpuspeed": 1600, # in MHz
89-
"memory": 3072, # In MBs
90-
},
91-
"vgpu140qwin":
92-
{
93-
# Small service offering ID to for change VM
94-
# service offering from medium to small
95-
"name": "Windows Instance with vGPU140Q",
96-
"displaytext": "Windows Instance with vGPU140Q",
97-
"cpunumber": 2,
98-
"cpuspeed": 1600,
99-
"memory": 3072,
100-
}
101-
},
102-
"diskdevice": ['/dev/vdc', '/dev/vdb', '/dev/hdb', '/dev/hdc', '/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ],
103-
# Disk device where ISO is attached to instance
104-
"mount_dir": "/mnt/tmp",
105-
"sleep": 60,
106-
"timeout": 10,
107-
#Migrate VM to hostid
108-
"ostype": 'Windows 7 (32-bit)',
109-
# CentOS 5.3 (64-bit)
110-
}
36+
from marvin.codes import FAILED, XEN_SERVER
11137

38+
from nose.plugins.attrib import attr
11239

11340
class TestDeployvGPUenabledVM(cloudstackTestCase):
114-
"""Test deploy a vGPU enabled VM into a user account
11541
"""
42+
Test deploy a vGPU enabled VM into a user account
43+
"""
44+
@classmethod
45+
def setUpClass(cls):
46+
testClient = super(TestDeployvGPUenabledVM, cls).getClsTestClient()
47+
#Need to add check whether zone containing the xen hypervisor or not as well
48+
hypervisor = testClient.getHypervisorInfo()
49+
if hypervisor.lower() != XEN_SERVER.lower():
50+
raise unittest.skipTest("GPU feature is supported only on XenServer")
51+
11652

11753
def setUp(self):
118-
self.services = Services().services
54+
self.testdata = self.testClient.getParsedTestDataConfig()["vgpu"]
11955
self.apiclient = self.testClient.getApiClient()
12056

12157
# Get Zone, Domain and Default Built-in template
12258
self.domain = get_domain(self.apiclient)
12359
self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
124-
self.services["mode"] = self.zone.networktype
60+
self.testdata["mode"] = self.zone.networktype
12561
# Before running this test, register a windows template with ostype as 'Windows 7 (32-bit)'
126-
self.services["ostype"] = 'Windows 7 (32-bit)'
127-
self.template = get_template(self.apiclient, self.zone.id, self.services["ostype"])
62+
self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
12863

12964
if self.template == FAILED:
130-
assert False, "get_template() failed to return template with description %s" % self.services["ostype"]
65+
assert False, "get_template() failed to return template with description %s" % self.testdata["ostype"]
13166
#create a user account
13267
self.account = Account.create(
13368
self.apiclient,
134-
self.services["account"],
69+
self.testdata["account"],
13570
domainid=self.domain.id
13671
)
13772

138-
self.services["vgpu260q"]["zoneid"] = self.zone.id
139-
self.services["vgpu260q"]["template"] = self.template.id
73+
self.testdata["vgpu260q"]["zoneid"] = self.zone.id
74+
self.testdata["vgpu260q"]["template"] = self.template.id
14075

141-
self.services["vgpu140q"]["zoneid"] = self.zone.id
142-
self.services["vgpu140q"]["template"] = self.template.id
76+
self.testdata["vgpu140q"]["zoneid"] = self.zone.id
77+
self.testdata["vgpu140q"]["template"] = self.template.id
14378
#create a service offering
14479
self.service_offering = ServiceOffering.create(
14580
self.apiclient,
146-
self.services["service_offerings"]["vgpu260qwin"],
81+
self.testdata["service_offerings"]["vgpu260qwin"],
14782
serviceofferingdetails={'pciDevice': 'VGPU'}
14883
)
14984
#build cleanup list
@@ -152,7 +87,7 @@ def setUp(self):
15287
self.account
15388
]
15489

155-
@attr(tags = ['advanced', 'simulator', 'basic', 'vgpu', 'provisioning'])
90+
@attr(tags = ['advanced', 'basic', 'vgpu'], required_hardware="true", BugId="CLOUDSTACK-6876")
15691
def test_deploy_vgpu_enabled_vm(self):
15792
"""Test Deploy Virtual Machine
15893
@@ -163,11 +98,11 @@ def test_deploy_vgpu_enabled_vm(self):
16398
"""
16499
self.virtual_machine = VirtualMachine.create(
165100
self.apiclient,
166-
self.services["vgpu260q"],
101+
self.testdata["vgpu260q"],
167102
accountid=self.account.name,
168103
domainid=self.account.domainid,
169104
serviceofferingid=self.service_offering.id,
170-
mode=self.services['mode']
105+
mode=self.testdata['mode']
171106
)
172107

173108
list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)
@@ -204,13 +139,13 @@ def test_deploy_vgpu_enabled_vm(self):
204139
"Running",
205140
msg="VM is not in Running state"
206141
)
207-
list_hosts = list_hosts(
142+
hosts = list_hosts(
208143
self.apiclient,
209144
id=vm.hostid
210145
)
211-
hostip = list_hosts[0].ipaddress
146+
hostip = hosts[0].ipaddress
212147
try:
213-
sshClient = SshClient(host=hostip, port=22, user='root',passwd=self.services["host_password"])
148+
sshClient = SshClient(host=hostip, port=22, user='root',passwd=self.testdata["host_password"])
214149
res = sshClient.execute("xe vgpu-list vm-name-label=%s params=type-uuid %s" % (
215150
vm.instancename
216151
))
@@ -230,4 +165,4 @@ def tearDown(self):
230165
try:
231166
cleanup_resources(self.apiclient, self.cleanup)
232167
except Exception as e:
233-
self.debug("Warning! Exception in tearDown: %s" % e)
168+
self.debug("Warning! Exception in tearDown: %s" % e)

test/integration/smoke/test_deploy_vm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def setUp(self):
6969
self.account
7070
]
7171

72-
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'selfservice'])
72+
@attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false")
7373
def test_deploy_vm(self):
7474
"""Test Deploy Virtual Machine
7575
@@ -112,7 +112,7 @@ def test_deploy_vm(self):
112112
msg="VM is not in Running state"
113113
)
114114

115-
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'selfservice'])
115+
@attr(tags = ['advanced','basic','sg'], BugId="CLOUDSTACK-6873", required_hardware="false")
116116
def test_deploy_vm_multiple(self):
117117
"""Test Multiple Deploy Virtual Machine
118118
@@ -207,7 +207,7 @@ def setUp(self):
207207
self.mock_volume_failure
208208
]
209209

210-
@attr(tags = ['selfservice'])
210+
@attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false")
211211
def test_deploy_vm_volume_creation_failure(self):
212212
"""Test Deploy Virtual Machine - volume creation failure and retry
213213
@@ -318,7 +318,7 @@ def setUp(self):
318318
self.mock_start_failure
319319
]
320320

321-
@attr(tags = ['selfservice'])
321+
@attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false")
322322
def test_deploy_vm_start_failure(self):
323323
"""Test Deploy Virtual Machine - start operation failure and retry
324324

test/integration/smoke/test_deploy_vm_root_resize.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def setUp(self):
103103
self.account
104104
]
105105

106-
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
106+
@attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
107107
def test_00_deploy_vm_root_resize(self):
108108
"""Test deploy virtual machine with root resize
109109
@@ -202,7 +202,7 @@ def test_00_deploy_vm_root_resize(self):
202202

203203
self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.hypervisor)
204204

205-
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
205+
@attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
206206
def test_01_deploy_vm_root_resize(self):
207207
"""Test proper failure to deploy virtual machine with rootdisksize of 0
208208
"""
@@ -230,7 +230,7 @@ def test_01_deploy_vm_root_resize(self):
230230
else:
231231
self.debug("test 01 does not support hypervisor type " + self.hypervisor);
232232

233-
@attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning'])
233+
@attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true")
234234
def test_02_deploy_vm_root_resize(self):
235235
"""Test proper failure to deploy virtual machine with rootdisksize less than template size
236236
"""

test/integration/smoke/test_deploy_vm_with_userdata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def setUpClass(cls):
7070
def setup(self):
7171
self.hypervisor = self.testClient.getHypervisorInfo()
7272

73-
@attr(tags=["simulator", "devcloud", "basic", "advanced", "post", "provisioning"])
73+
@attr(tags=["devcloud", "basic", "advanced", "post"], required_hardware="true")
7474
def test_deployvm_userdata_post(self):
7575
"""Test userdata as POST, size > 2k
7676
"""
@@ -95,7 +95,7 @@ def test_deployvm_userdata_post(self):
9595
self.assert_(vm.id == str(deployVmResponse.id), "Vm deployed is different from the test")
9696
self.assert_(vm.state == "Running", "VM is not in Running state")
9797

98-
@attr(tags=["simulator", "devcloud", "basic", "advanced", "provisioning"])
98+
@attr(tags=["devcloud", "basic", "advanced"], required_hardware="true")
9999
def test_deployvm_userdata(self):
100100
"""Test userdata as GET, size > 2k
101101
"""

test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def setUpClass(cls):
6060
cls.account
6161
]
6262

63-
@attr(tags=["simulator", "advanced", "basic", "sg", "selfservice"])
63+
@attr(tags=["advanced", "basic", "sg"], required_hardware="false")
6464
def test_deployvm_firstfit(self):
6565
"""Test to deploy vm with a first fit offering
6666
"""
@@ -104,7 +104,7 @@ def test_deployvm_firstfit(self):
104104
msg="VM is not in Running state"
105105
)
106106

107-
@attr(tags=["simulator", "advanced", "basic", "sg", "selfservice"])
107+
@attr(tags=["advanced", "basic", "sg"], required_hardware="false")
108108
def test_deployvm_userdispersing(self):
109109
"""Test deploy VMs using user dispersion planner
110110
"""
@@ -163,7 +163,7 @@ def test_deployvm_userdispersing(self):
163163
self.debug("VMs (%s, %s) meant to be dispersed are deployed in the same cluster %s" % (
164164
vm1.id, vm2.id, vm1clusterid))
165165

166-
@attr(tags=["simulator", "advanced", "basic", "sg", "selfservice"])
166+
@attr(tags=["advanced", "basic", "sg"], required_hardware="false")
167167
def test_deployvm_userconcentrated(self):
168168
"""Test deploy VMs using user concentrated planner
169169
"""

test/integration/smoke/test_disk_offerings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def tearDown(self):
4545
raise Exception("Warning: Exception during cleanup : %s" % e)
4646
return
4747

48-
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke", "selfservice"])
48+
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
4949
def test_01_create_disk_offering(self):
5050
"""Test to create disk offering
5151
@@ -213,7 +213,7 @@ def tearDownClass(cls):
213213
raise Exception("Warning: Exception during cleanup : %s" % e)
214214
return
215215

216-
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke", "selfservice"])
216+
@attr(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
217217
def test_02_edit_disk_offering(self):
218218
"""Test to update existing disk offering
219219
@@ -265,7 +265,7 @@ def test_02_edit_disk_offering(self):
265265
)
266266
return
267267

268-
@attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke", "selfservice"])
268+
@attr(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false")
269269
def test_03_delete_disk_offering(self):
270270
"""Test to delete disk offering
271271

test/integration/smoke/test_global_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TestUpdateConfigWithScope(cloudstackTestCase):
3232
def setUp(self):
3333
self.apiClient = self.testClient.getApiClient()
3434

35-
@attr(tags=["simulator", "devcloud", "basic", "advanced", "selfservice"])
35+
@attr(tags=["devcloud", "basic", "advanced"], required_hardware="false")
3636
def test_UpdateConfigParamWithScope(self):
3737
"""
3838
test update configuration setting at zone level scope

test/integration/smoke/test_guest_vlan_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def tearDown(self):
7878
raise Exception("Warning: Exception during cleanup : %s" % e)
7979
return
8080

81-
@attr(tags=["simulator", "advanced", "guestvlanrange", "dedicate", "release", "selfservice"],BugId="CLOUDSTACK-6738")
81+
@attr(tags=["advanced", "guestvlanrange", "dedicate", "release"], BugId="CLOUDSTACK-6738", required_hardware="false")
8282
def test_dedicateGuestVlanRange(self):
8383
"""Test guest vlan range dedication
8484
"""

test/integration/smoke/test_internal_lb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def setUpClass(cls):
5656
cls.account.id))
5757
cls.cleanup = [cls.account]
5858

59-
@attr(tags=["smoke", "advanced", "provisioning"])
59+
@attr(tags=["smoke", "advanced"], required_hardware="true")
6060
def test_internallb(self):
6161
"""Test create, delete, assign, remove of internal loadbalancer
6262
"""

0 commit comments

Comments
 (0)