Skip to content

Commit 900415b

Browse files
sedukullkoushik-das
authored andcommitted
Fixed CLOUDSTACK-6648
vm_ha cases were failing because of improper zone and test data passed. Fixed them now. Signed-off-by: santhosh <santhosh.edukulla@gmail.com> Signed-off-by: Koushik Das <koushik@apache.org>
1 parent a3e9d0f commit 900415b

2 files changed

Lines changed: 21 additions & 45 deletions

File tree

‎test/integration/smoke/test_vm_ha.py‎

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,51 +35,18 @@
3535

3636
from 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-
7238
class 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(

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,16 @@
109109
"cpunumber": 1,
110110
"cpuspeed": 100,
111111
"memory": 512,
112-
}
112+
},
113+
"hasmall": {
114+
"name": "HA Small Instance",
115+
"displaytext": "HA Small Instance",
116+
"cpunumber": 1,
117+
"cpuspeed": 100,
118+
"memory": 256,
119+
"hosttags": "ha",
120+
"offerha": True,
121+
},
113122
},
114123
"disk_offering": {
115124
"name": "Disk offering",
@@ -278,14 +287,14 @@
278287
}
279288
},
280289
"shared_network_offering_all_services": {
281-
"name":"shaared network offering with services enabled",
290+
"name": "shaared network offering with services enabled",
282291
"displaytext": "Shard network offering",
283292
"guestiptype": "Shared",
284293
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
285-
"specifyVlan" : "False",
286-
"specifyIpRanges" : "False",
294+
"specifyVlan": "False",
295+
"specifyIpRanges": "False",
287296
"traffictype": "GUEST",
288-
"serviceProviderList" : {
297+
"serviceProviderList": {
289298
"Dhcp": "VirtualRouter",
290299
"Dns": "VirtualRouter",
291300
"UserData": "VirtualRouter",
@@ -531,7 +540,7 @@
531540
"Lb": "VirtualRouter",
532541
"UserData": "VirtualRouter",
533542
"StaticNat": "VirtualRouter"
534-
}
543+
}
535544
},
536545
"fwrule": {
537546
"startport": 22,

0 commit comments

Comments
 (0)