Skip to content

Commit 500baea

Browse files
Gaurav AradhyeSrikanteswaraRao Talluri
authored andcommitted
CLOUDSTACK-8235: Fixed test case in test_bugs.py to read variable data from configurableData section of test_data.py and also fixed wrong parameter name
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
1 parent 015aed9 commit 500baea

2 files changed

Lines changed: 54 additions & 33 deletions

File tree

‎test/integration/component/maint/test_bugs.py‎

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,34 @@
1616
# under the License.
1717

1818
# Import Local Modules
19-
from marvin.cloudstackTestCase import *
20-
from marvin.cloudstackException import *
21-
from marvin.cloudstackAPI import *
19+
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
20+
from marvin.cloudstackAPI import (updateStoragePool,
21+
resizeVolume,
22+
listCapacity,
23+
addCluster)
2224
from marvin.sshClient import SshClient
23-
from marvin.lib.utils import *
24-
from marvin.lib.base import *
25-
from marvin.lib.common import *
26-
from marvin.codes import *
25+
from marvin.lib.common import (get_zone,
26+
get_template,
27+
get_domain,
28+
list_volumes,
29+
get_pod,
30+
is_config_suitable)
31+
from marvin.lib.base import (Domain,
32+
Account,
33+
Template,
34+
VirtualMachine,
35+
Volume,
36+
DiskOffering,
37+
StoragePool,
38+
ServiceOffering,
39+
Configurations)
40+
from marvin.lib.utils import cleanup_resources
2741
from nose.plugins.attrib import attr
42+
import time
2843

2944

3045
class Test42xBugsMgmtSvr(cloudstackTestCase):
46+
3147
@classmethod
3248
def setUpClass(cls):
3349
try:
@@ -135,7 +151,7 @@ def test_es_1223_apply_algo_to_pods(self):
135151
accountid=self.account.name,
136152
domainid=self.account.domainid,
137153
serviceofferingid=self.service_offering.id,
138-
)
154+
)
139155
self.cleanup.append(virtual_machine)
140156
# Verify VM state
141157
self.assertEqual(
@@ -281,7 +297,7 @@ def test_es_1236_cloudstack_sccs(self):
281297
self.apiClient.connection.user,
282298
self.apiClient.connection.passwd
283299
)
284-
res = mgmt_ssh.execute("cloudstack-sccs")
300+
mgmt_ssh.execute("cloudstack-sccs")
285301
# Step2: It should return a commit hash
286302
return
287303

@@ -444,7 +460,7 @@ def test_CLOUDSTACK_6181_vm_root_resize(self):
444460
accountid=self.account.name,
445461
domainid=self.account.domainid,
446462
serviceofferingid=self.service_offering.id,
447-
)
463+
)
448464
self.cleanup.append(virtual_machine)
449465
# Verify VM state
450466
self.assertEqual(
@@ -519,7 +535,9 @@ def test_es_47_list_os_types_win_2012(self):
519535
# register windows 2012 VM template as windows 8 template
520536
self.hypervisor = self.testClient.getHypervisorInfo()
521537
if self.hypervisor.lower() in ['lxc']:
522-
self.skipTest("windows VM is not supported on %s" % self.hypervisor.lower())
538+
self.skipTest(
539+
"windows VM is not supported on %s" %
540+
self.hypervisor.lower())
523541
self.win2012_template = Template.register(
524542
self.apiClient,
525543
self.services["win2012template"],
@@ -602,7 +620,7 @@ def test_multiple_mgmt_srvr_session_timeout(self):
602620
self.apiClient.connection.user,
603621
self.apiClient.connection.passwd
604622
)
605-
res = mgmt_ssh.execute("time telnet localhost 8250")
623+
mgmt_ssh.execute("time telnet localhost 8250")
606624

607625
# Step2: It should return a commit hash
608626
return
@@ -622,15 +640,17 @@ def test_add_cluster_datacenter_spaces(self):
622640
cmd = addCluster.addClusterCmd()
623641
cmd.zoneid = self.zone.id
624642
cmd.hypervisor = self.hypervisor
625-
cmd.clustertype = self.services["vmware_cluster"]["clustertype"]
626-
cmd.podId = self.pod.id
627-
cmd.username = self.services["vmware_cluster"]["username"]
628-
cmd.password = self.services["vmware_cluster"]["password"]
643+
cmd.clustertype = self.services["configurableData"][
644+
"vmware_cluster"]["clustertype"]
645+
cmd.podid = self.pod.id
646+
cmd.username = self.services["configurableData"][
647+
"vmware_cluster"]["username"]
648+
cmd.password = self.services["configurableData"][
649+
"vmware_cluster"]["password"]
629650
cmd.publicswitchtype = 'vmwaredvs'
630651
cmd.guestswitchtype = 'vmwaredvs'
631-
cmd.url = self.services["vmware_cluster"]["url"]
632-
cmd.clustername = self.services["vmware_cluster"]["url"]
633-
652+
cmd.url = self.services["configurableData"]["vmware_cluster"]["url"]
653+
cmd.clustername = self.services[
654+
"configurableData"]["vmware_cluster"]["url"]
634655
self.apiClient.addCluster(cmd)
635-
636656
return

‎tools/marvin/marvin/config/test_data.py‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@
6262
"username": "test-account2",
6363
"password": "password"
6464
},
65-
"vmware_cluster" : {
66-
"hypervisor": 'VMware',
67-
"clustertype": 'ExternalManaged',
68-
"username": 'administrator',
69-
"password": 'password_123',
70-
"url": 'http://10.147.60.15/42xescauto spaces/42xesc Clusters',
71-
"clustername": 'VMWare Cluster with Space in DC name',
72-
},
7365
"small": {
7466
"displayname": "testserver",
7567
"username": "root",
@@ -931,6 +923,13 @@
931923
"customdisksize": 1,
932924
"diskname": "Custom disk",
933925
},
926+
"upload_volume": {
927+
"diskname": "UploadVol",
928+
"format": "VHD",
929+
"url":
930+
"http://10.147.28.7/templates/393d3550-05ef-330f-9b8c-745b0e699759.vhd",
931+
"checksum": "",
932+
},
934933
"recurring_snapshot": {
935934
"maxsnaps": 2,
936935
"timezone": "US/Arizona",
@@ -1513,11 +1512,13 @@
15131512
"ldapPassword": ""
15141513
},
15151514
"systemVmDelay": 120,
1516-
"upload_volume": {
1517-
"diskname": "UploadVol",
1518-
"format": "VHD",
1519-
"url": "",
1520-
"checksum": "",
1515+
"vmware_cluster" : {
1516+
"hypervisor": 'VMware',
1517+
"clustertype": 'ExternalManaged',
1518+
"username": '',
1519+
"password": '',
1520+
"url": '',
1521+
"clustername": 'VMWare Cluster with Space in DC name',
15211522
},
15221523
}
15231524
}

0 commit comments

Comments
 (0)