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 )
2224from 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
2741from nose .plugins .attrib import attr
42+ import time
2843
2944
3045class 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
0 commit comments