CLOUDSTACK-6856 : Fixed few data corruption and retries issues for failing cases

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
sedukull 2014-06-06 17:33:57 +05:30 committed by SrikanteswaraRao Talluri
parent 39f775c381
commit b43517c496
6 changed files with 29 additions and 46 deletions

View File

@ -86,7 +86,8 @@ class TestDeployVM(cloudstackTestCase):
serviceofferingid=self.service_offering.id,
templateid=self.template.id
)
if not self.virtual_machine:
self.fail("Deploying a Virtual Machine Failed")
list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)
self.debug(
"Verify listVirtualMachines response for virtual machine: %s"\

View File

@ -31,7 +31,7 @@ class TestDedicateGuestVlanRange(cloudstackTestCase):
@classmethod
def setUpClass(cls):
testClient = super(TestDedicateGuestVlanRange, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.apiclient = testClient.getApiClient()
cls.services = testClient.getParsedTestDataConfig()
# Get Zone, Domain
@ -78,7 +78,7 @@ class TestDedicateGuestVlanRange(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags=["simulator", "advanced", "guestvlanrange", "dedicate", "release", "selfservice"])
@attr(tags=["simulator", "advanced", "guestvlanrange", "dedicate", "release", "selfservice"],BugId="CLOUDSTACK-6738")
def test_dedicateGuestVlanRange(self):
"""Test guest vlan range dedication
"""
@ -97,11 +97,7 @@ class TestDedicateGuestVlanRange(cloudstackTestCase):
"""
self.debug("Adding guest vlan range")
print "existing vlna = %s" %self.physical_network.vlan
print "free vlan = %s" %self.free_vlan
new_vlan = self.physical_network.vlan + "," + self.free_vlan["partial_range"][0]
print "new vlan = %s" % new_vlan
#new_vlan = self.free_vlan["partial_range"][0]
addGuestVlanRangeResponse = self.physical_network.update(self.apiclient,
id=self.physical_network.id, vlan=new_vlan)

View File

@ -52,7 +52,7 @@ class TestHosts(cloudstackTestCase):
raise Exception("Warning: Exception during cleanup : %s" % e)
return
@attr(tags=["selfservice"])
#@attr(tags=["selfservice"])
def test_01_clusters(self):
"""Test Add clusters & hosts - simulator

View File

@ -531,29 +531,19 @@ class TestVMLifeCycle(cloudstackTestCase):
self.vm_to_migrate.migrate(self.apiclient, migrate_host.id)
list_vm_response = VirtualMachine.list(
self.apiclient,
id=self.vm_to_migrate.id
)
self.assertNotEqual(
list_vm_response,
None,
"Check virtual machine is listed"
)
vm_response = list_vm_response[0]
self.assertEqual(
vm_response.id,
self.vm_to_migrate.id,
"Check virtual machine ID of migrated VM"
)
self.assertEqual(
vm_response.hostid,
migrate_host.id,
"Check destination hostID of migrated VM"
)
retries_cnt = 3
while retries_cnt >=0:
list_vm_response = VirtualMachine.list(self.apiclient,
id=self.vm_to_migrate.id)
self.assertNotEqual(
list_vm_response,
None,
"Check virtual machine is listed"
)
vm_response = list_vm_response[0]
self.assertEqual(vm_response.id,self.vm_to_migrate.id,"Check virtual machine ID of migrated VM")
self.assertEqual(vm_response.hostid,migrate_host.id,"Check destination hostID of migrated VM")
retries_cnt = retries_cnt - 1
return
@attr(configuration = "expunge.interval")
@ -592,19 +582,15 @@ class TestVMLifeCycle(cloudstackTestCase):
self.apiclient,
id=self.small_virtual_machine.id
)
if list_vm_response:
time.sleep(expunge_cycle)
wait_time = wait_time - expunge_cycle
else:
if not list_vm_response:
break
self.debug("Waiting for VM to expunge")
time.sleep(expunge_cycle)
wait_time = wait_time - expunge_cycle
self.debug("listVirtualMachines response: %s" % list_vm_response)
self.assertEqual(
list_vm_response,
None,
"Check Expunged virtual machine is in listVirtualMachines response"
)
self.assertEqual(list_vm_response,None,"Check Expunged virtual machine is in listVirtualMachines response")
return
@attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"])

View File

@ -25,6 +25,7 @@ from marvin.configGenerator import ConfigManager
from marvin.cloudstackException import GetDetailExceptionInfo
from marvin.lib.utils import (random_gen, validateList)
from marvin.cloudstackAPI.cloudstackAPIClient import CloudStackAPIClient
import copy
class CSTestClient(object):
@ -82,8 +83,7 @@ class CSTestClient(object):
Tests are to Run
@Output : Returns the Parsed Test Data Dictionary
'''
out = self.__parsedTestDataConfig
return out
return copy.deepcopy(self.__parsedTestDataConfig)
def getZoneForTests(self):
'''

View File

@ -52,10 +52,10 @@ setup(name="Marvin",
"marvin.sandbox.basic"],
license="LICENSE.txt",
install_requires=[
"mysql-connector-python",
"requests",
"paramiko",
"nose",
"mysql-connector-python >= 1.1.6",
"requests >= 2.2.1",
"paramiko >= 1.13.0",
"nose >= 1.3.3",
"ddt >= 0.4.0"
],
py_modules=['marvin.marvinPlugin'],