Skip to content

Commit 31d8709

Browse files
sedukullSrikanteswaraRao Talluri
authored andcommitted
Fixed vm ha cases failing in master
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
1 parent cdfa265 commit 31d8709

2 files changed

Lines changed: 11 additions & 44 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,14 @@
326326
}
327327
},
328328
"shared_network_offering_all_services": {
329-
"name":"shaared network offering with services enabled",
330-
"displaytext": "Shard network offering",
329+
"name": "shared network offering with services enabled",
330+
"displaytext": "Shared network offering",
331331
"guestiptype": "Shared",
332332
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
333-
"specifyVlan" : "False",
334-
"specifyIpRanges" : "False",
333+
"specifyVlan": "False",
334+
"specifyIpRanges": "False",
335335
"traffictype": "GUEST",
336-
"serviceProviderList" : {
336+
"serviceProviderList": {
337337
"Dhcp": "VirtualRouter",
338338
"Dns": "VirtualRouter",
339339
"UserData": "VirtualRouter",

0 commit comments

Comments
 (0)