Fixed Regression issues mentioned under CLOUDSTACK-6708

Signed-off-by: santhosh <santhosh.edukulla@gmail.com>

Conflicts:

	test/integration/smoke/test_deploy_vm.py
	test/integration/smoke/test_network.py
	test/integration/smoke/test_routers.py
	test/integration/smoke/test_vm_life_cycle.py
This commit is contained in:
santhosh 2014-05-21 00:22:17 +10:00 committed by Girish Shilamkar
parent 00778de96e
commit aab6e1222f
5 changed files with 47 additions and 59 deletions

View File

@ -42,7 +42,6 @@ class TestDeployVM(cloudstackTestCase):
self.apiclient = self.testClient.getApiClient()
self.testdata = self.testClient.getParsedTestDataConfig()
# Get Zone, Domain and Default Built-in template
self.domain = get_domain(self.apiclient)
self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
@ -207,6 +206,7 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase):
self.mock_volume_failure
]
@attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false")
def test_deploy_vm_volume_creation_failure(self):
"""Test Deploy Virtual Machine - volume creation failure and retry

View File

@ -23,6 +23,7 @@ from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from marvin.lib.utils import (random_gen)
from nose.plugins.attrib import attr
#Import System modules
@ -66,12 +67,13 @@ class TestHosts(cloudstackTestCase):
#Create clusters with Hypervisor type Simulator/XEN/KVM/VWare
"""
for k, v in self.services["clusters"].items():
v["clustername"] = v["clustername"] + "-" + random_gen()
cluster = Cluster.create(
self.apiclient,
v,
zoneid=self.zone.id,
podid=self.pod.id,
hypervisor=self.hypervisor
hypervisor=v["hypervisor"].lower()
)
self.debug(
"Created Cluster for hypervisor type %s & ID: %s" %(
@ -79,8 +81,8 @@ class TestHosts(cloudstackTestCase):
cluster.id
))
self.assertEqual(
cluster.hypervisortype,
v["hypervisor"],
cluster.hypervisortype.lower(),
v["hypervisor"].lower(),
"Check hypervisor type is " + v["hypervisor"] + " or not"
)
self.assertEqual(
@ -103,7 +105,7 @@ class TestHosts(cloudstackTestCase):
self.services["hosts"][hypervisor_type],
zoneid=self.zone.id,
podid=self.pod.id,
hypervisor=self.hypervisor
hypervisor=v["hypervisor"].lower()
)
if host == FAILED:
self.fail("Host Creation Failed")
@ -112,7 +114,6 @@ class TestHosts(cloudstackTestCase):
host.id,
cluster.id
))
#Cleanup Host & Cluster
self.cleanup.append(host)
self.cleanup.append(cluster)
@ -162,8 +163,8 @@ class TestHosts(cloudstackTestCase):
"Check cluster ID with list clusters response"
)
self.assertEqual(
cluster_response.hypervisortype,
cluster.hypervisortype,
cluster_response.hypervisortype.lower(),
cluster.hypervisortype.lower(),
"Check hypervisor type with is " + v["hypervisor"] + " or not"
)
return

View File

@ -160,16 +160,10 @@ class TestPublicIP(cloudstackTestCase):
self.apiclient,
id=ip_address.ipaddress.id
)
self.assertEqual(
isinstance(list_pub_ip_addr_resp, list),
True,
"Check list response returns a valid list"
)
self.assertEqual(
len(list_pub_ip_addr_resp),
0,
"Check if the list public ip api response is not zero"
)
if list_pub_ip_addr_resp is None:
return
if (list_pub_ip_addr_resp) and (isinstance(list_pub_ip_addr_resp, list)) and (len(list_pub_ip_addr_resp) > 0):
self.fail("list public ip response is not empty")
return
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
@ -790,7 +784,6 @@ class TestReleaseIP(cloudstackTestCase):
retriesCount = 10
isIpAddressDisassociated = False
while retriesCount > 0:
listResponse = list_publicIP(
self.apiclient,

View File

@ -183,6 +183,7 @@ class TestRouterServices(cloudstackTestCase):
return
@attr(tags = ["advanced", "advancedns"], required_hardware="false")
def test_02_router_internal_adv(self):
"""Test router internal advanced zone
@ -203,7 +204,6 @@ class TestRouterServices(cloudstackTestCase):
True,
"Check list response returns a valid list"
)
router = list_router_response[0]
hosts = list_hosts(
@ -252,7 +252,6 @@ class TestRouterServices(cloudstackTestCase):
self.skipTest("Marvin configuration has no host credentials to check router services")
res = str(result)
self.debug("Dnsmasq process status: %s" % res)
self.assertEqual(
res.count("running"),
1,
@ -461,7 +460,6 @@ class TestRouterServices(cloudstackTestCase):
)
except KeyError:
self.skipTest("Marvin configuration has no host credentials to check router services")
# res = 12:37:14 up 1 min, 0 users, load average: 0.61, 0.22, 0.08
# Split result to check the uptime
result = res[0].split()
@ -653,7 +651,6 @@ class TestRouterServices(cloudstackTestCase):
"Check list response returns a valid list"
)
router = list_router_response[0]
self.debug("Stopping the router with ID: %s" % router.id)
#Stop the router
cmd = stopRouter.stopRouterCmd()
@ -723,6 +720,13 @@ class TestRouterServices(cloudstackTestCase):
)
return
def verifyRouterResponse(self,router_response,ip):
if (router_response) and (isinstance(router_response, list)) and \
(router_response[0].state == "Running") and \
(router_response[0].publicip == ip):
return True
return False
@attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false")
def test_09_reboot_router(self):
"""Test reboot router
@ -746,32 +750,22 @@ class TestRouterServices(cloudstackTestCase):
public_ip = router.publicip
self.debug("Rebooting the router with ID: %s" % router.id)
#Reboot the router
cmd = rebootRouter.rebootRouterCmd()
cmd.id = router.id
self.apiclient.rebootRouter(cmd)
#List routers to check state of router
retries_cnt = 6
while retries_cnt >= 0:
router_response = list_routers(
self.apiclient,
id=router.id
)
self.assertEqual(
isinstance(router_response, list),
True,
"Check list response returns a valid list"
)
#List router should have router in running state and same public IP
self.assertEqual(
router_response[0].state,
'Running',
"Check list router response for router state"
)
self.assertEqual(
router_response[0].publicip,
public_ip,
"Check list router response for router public IP"
)
if self.verifyRouterResponse(router_response,public_ip):
self.debug("Router is running successfully after reboot")
return
time.sleep(10)
retries_cnt = retries_cnt - 1
self.fail("Router response after reboot is either is invalid or in stopped state")
return

View File

@ -498,14 +498,14 @@ class TestVMLifeCycle(cloudstackTestCase):
# For XenServer and VMware, migration is possible between hosts belonging to different clusters
# with the help of XenMotion and Vmotion respectively.
if hypervisor == "kvm":
if hypervisor.lower() in ["kvm","simulator"]:
#identify suitable host
clusters = [h.clusterid for h in hosts]
#find hosts withe same clusterid
clusters = [cluster for index, cluster in enumerate(clusters) if clusters.count(cluster) > 1]
if len(clusters) <= 1:
self.skipTest("In KVM, Live Migration needs two hosts within same cluster")
self.skipTest("In " + hypervisor.lower() + " Live Migration needs two hosts within same cluster")
suitable_hosts = [host for host in hosts if host.clusterid == clusters[0]]
else:
@ -548,7 +548,7 @@ class TestVMLifeCycle(cloudstackTestCase):
@attr(configuration = "expunge.interval")
@attr(configuration = "expunge.delay")
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false")
@attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"],BugId="CLOUDSTACK-6708", required_hardware="false")
def test_09_expunge_vm(self):
"""Test destroy(expunge) Virtual Machine
"""
@ -576,7 +576,7 @@ class TestVMLifeCycle(cloudstackTestCase):
name='expunge.interval'
)
expunge_cycle = int(config[0].value)
wait_time = expunge_cycle * 2
wait_time = expunge_cycle * 4
while wait_time >= 0:
list_vm_response = VirtualMachine.list(
self.apiclient,