mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixed vm ha cases failing in master
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
parent
cdfa265060
commit
31d870933d
@ -35,51 +35,18 @@ from marvin.lib.common import get_zone, get_domain, get_template
|
|||||||
|
|
||||||
from nose.plugins.attrib import attr
|
from nose.plugins.attrib import attr
|
||||||
|
|
||||||
class TestData(object):
|
|
||||||
"""Test data object that is required to create resources
|
|
||||||
"""
|
|
||||||
def __init__(self):
|
|
||||||
self.testdata = {
|
|
||||||
#data to create an account
|
|
||||||
"account": {
|
|
||||||
"email": "test@test.com",
|
|
||||||
"firstname": "Test",
|
|
||||||
"lastname": "User",
|
|
||||||
"username": "test",
|
|
||||||
"password": "password",
|
|
||||||
},
|
|
||||||
#data reqd for virtual machine creation
|
|
||||||
"virtual_machine" : {
|
|
||||||
"name" : "testvm",
|
|
||||||
"displayname" : "Test VM",
|
|
||||||
},
|
|
||||||
#small service offering
|
|
||||||
"service_offering": {
|
|
||||||
"hasmall": {
|
|
||||||
"name": "HA Small Instance",
|
|
||||||
"displaytext": "HA Small Instance",
|
|
||||||
"cpunumber": 1,
|
|
||||||
"cpuspeed": 100,
|
|
||||||
"memory": 256,
|
|
||||||
"hosttags": "ha",
|
|
||||||
"offerha": True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"ostype": 'CentOS 5.3 (64-bit)',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class TestDeployVMHA(cloudstackTestCase):
|
class TestDeployVMHA(cloudstackTestCase):
|
||||||
"""Test VM HA
|
"""Test VM HA
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.testdata = TestData().testdata
|
self.testdata = self.testClient.getParsedTestDataConfig()
|
||||||
self.apiclient = self.testClient.getApiClient()
|
self.apiclient = self.testClient.getApiClient()
|
||||||
|
|
||||||
# Get Zone, Domain and Default Built-in template
|
# Get Zone, Domain and Default Built-in template
|
||||||
self.domain = get_domain(self.apiclient, self.testdata)
|
self.domain = get_domain(self.apiclient)
|
||||||
self.zone = get_zone(self.apiclient, self.testdata)
|
self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
|
||||||
|
|
||||||
self.testdata["mode"] = self.zone.networktype
|
self.testdata["mode"] = self.zone.networktype
|
||||||
self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
|
self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
|
||||||
|
|
||||||
@ -95,7 +62,7 @@ class TestDeployVMHA(cloudstackTestCase):
|
|||||||
self.assertTrue(isinstance(self.hosts, list) and len(self.hosts) >= 2, msg = "Atleast 2 hosts required in cluster for VM HA test")
|
self.assertTrue(isinstance(self.hosts, list) and len(self.hosts) >= 2, msg = "Atleast 2 hosts required in cluster for VM HA test")
|
||||||
#update host tags
|
#update host tags
|
||||||
for host in self.hosts:
|
for host in self.hosts:
|
||||||
Host.update(self.apiclient, id=host.id, hosttags=self.testdata["service_offering"]["hasmall"]["hosttags"])
|
Host.update(self.apiclient, id=host.id, hosttags=self.testdata["service_offerings"]["hasmall"]["hosttags"])
|
||||||
|
|
||||||
#create a user account
|
#create a user account
|
||||||
self.account = Account.create(
|
self.account = Account.create(
|
||||||
@ -106,7 +73,7 @@ class TestDeployVMHA(cloudstackTestCase):
|
|||||||
#create a service offering
|
#create a service offering
|
||||||
self.service_offering = ServiceOffering.create(
|
self.service_offering = ServiceOffering.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.testdata["service_offering"]["hasmall"]
|
self.testdata["service_offerings"]["hasmall"]
|
||||||
)
|
)
|
||||||
#deploy ha vm
|
#deploy ha vm
|
||||||
self.virtual_machine = VirtualMachine.create(
|
self.virtual_machine = VirtualMachine.create(
|
||||||
|
|||||||
@ -326,14 +326,14 @@ test_data = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared_network_offering_all_services": {
|
"shared_network_offering_all_services": {
|
||||||
"name":"shaared network offering with services enabled",
|
"name": "shared network offering with services enabled",
|
||||||
"displaytext": "Shard network offering",
|
"displaytext": "Shared network offering",
|
||||||
"guestiptype": "Shared",
|
"guestiptype": "Shared",
|
||||||
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
|
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
|
||||||
"specifyVlan" : "False",
|
"specifyVlan": "False",
|
||||||
"specifyIpRanges" : "False",
|
"specifyIpRanges": "False",
|
||||||
"traffictype": "GUEST",
|
"traffictype": "GUEST",
|
||||||
"serviceProviderList" : {
|
"serviceProviderList": {
|
||||||
"Dhcp": "VirtualRouter",
|
"Dhcp": "VirtualRouter",
|
||||||
"Dns": "VirtualRouter",
|
"Dns": "VirtualRouter",
|
||||||
"UserData": "VirtualRouter",
|
"UserData": "VirtualRouter",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user