3535
3636from nose .plugins .attrib import attr
3737
38- class TestData (object ):
39- """Test data object that is required to create resources
40- """
41- def __init__ (self ):
42- self .testdata = {
43- #data to create an account
44- "account" : {
45- "email" : "test@test.com" ,
46- "firstname" : "Test" ,
47- "lastname" : "User" ,
48- "username" : "test" ,
49- "password" : "password" ,
50- },
51- #data reqd for virtual machine creation
52- "virtual_machine" : {
53- "name" : "testvm" ,
54- "displayname" : "Test VM" ,
55- },
56- #small service offering
57- "service_offering" : {
58- "hasmall" : {
59- "name" : "HA Small Instance" ,
60- "displaytext" : "HA Small Instance" ,
61- "cpunumber" : 1 ,
62- "cpuspeed" : 100 ,
63- "memory" : 256 ,
64- "hosttags" : "ha" ,
65- "offerha" : True ,
66- },
67- },
68- "ostype" : 'CentOS 5.3 (64-bit)' ,
69- }
70-
71-
7238class TestDeployVMHA (cloudstackTestCase ):
7339 """Test VM HA
7440 """
7541
7642 def setUp (self ):
77- self .testdata = TestData (). testdata
43+ self .testdata = self . testClient . getParsedTestDataConfig ()
7844 self .apiclient = self .testClient .getApiClient ()
7945
8046 # Get Zone, Domain and Default Built-in template
81- self .domain = get_domain (self .apiclient , self .testdata )
82- self .zone = get_zone (self .apiclient , self .testdata )
47+ self .domain = get_domain (self .apiclient )
48+ self .zone = get_zone (self .apiclient , self .testClient .getZoneForTests ())
49+
8350 self .testdata ["mode" ] = self .zone .networktype
8451 self .template = get_template (self .apiclient , self .zone .id , self .testdata ["ostype" ])
8552
@@ -95,7 +62,7 @@ def setUp(self):
9562 self .assertTrue (isinstance (self .hosts , list ) and len (self .hosts ) >= 2 , msg = "Atleast 2 hosts required in cluster for VM HA test" )
9663 #update host tags
9764 for host in self .hosts :
98- Host .update (self .apiclient , id = host .id , hosttags = self .testdata ["service_offering " ]["hasmall" ]["hosttags" ])
65+ Host .update (self .apiclient , id = host .id , hosttags = self .testdata ["service_offerings " ]["hasmall" ]["hosttags" ])
9966
10067 #create a user account
10168 self .account = Account .create (
@@ -106,7 +73,7 @@ def setUp(self):
10673 #create a service offering
10774 self .service_offering = ServiceOffering .create (
10875 self .apiclient ,
109- self .testdata ["service_offering " ]["hasmall" ]
76+ self .testdata ["service_offerings " ]["hasmall" ]
11077 )
11178 #deploy ha vm
11279 self .virtual_machine = VirtualMachine .create (
0 commit comments