From 0e975a773adb13d5ad8ee1c805fa49821cd17a63 Mon Sep 17 00:00:00 2001 From: santhoshe Date: Thu, 8 May 2014 00:52:29 +1000 Subject: [PATCH] Fixed Few cases running on invalid zone,domain Fixed creating client on user passed port Fixed other misc issues Signed-off-by: jayapal --- test/integration/smoke/test_deploy_vm.py | 12 ++++++------ tools/marvin/marvin/cloudstackTestClient.py | 14 +++++++------- tools/marvin/marvin/marvinPlugin.py | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index c07e663b8ff..473b0202800 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -169,8 +169,8 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase): self.apiclient = self.testClient.getApiClient() # Get Zone, Domain and Default Built-in template - self.domain = get_domain(self.apiclient, self.testdata) - self.zone = get_zone(self.apiclient, self.testdata) + self.domain = get_domain(self.apiclient) + self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) self.testdata["mode"] = self.zone.networktype self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"]) @@ -183,7 +183,7 @@ class TestDeployVMVolumeCreationFailure(cloudstackTestCase): #create a service offering self.service_offering = ServiceOffering.create( self.apiclient, - self.testdata["service_offering"]["small"] + self.testdata["service_offerings"]["small"] ) #create first VM self.virtual_machine = VirtualMachine.create( @@ -280,8 +280,8 @@ class TestDeployVMStartFailure(cloudstackTestCase): self.apiclient = self.testClient.getApiClient() # Get Zone, Domain and Default Built-in template - self.domain = get_domain(self.apiclient, self.testdata) - self.zone = get_zone(self.apiclient, self.testdata) + self.domain = get_domain(self.apiclient) + self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) self.testdata["mode"] = self.zone.networktype self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"]) @@ -294,7 +294,7 @@ class TestDeployVMStartFailure(cloudstackTestCase): #create a service offering self.service_offering = ServiceOffering.create( self.apiclient, - self.testdata["service_offering"]["small"] + self.testdata["service_offerings"]["small"] ) #create first VM self.virtual_machine = VirtualMachine.create( diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 53d48ab10d7..c7ad5c0b6f0 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -152,23 +152,23 @@ class CSTestClient(object): if api_key is None: ret = self.__getKeys(user_id) if ret != FAILED: - self.__mgmtDetails.port = 8080 - self.__mgmtDetails.apiKey = ret[0] - self.__mgmtDetails.securityKey = ret[1] + mgmt_details = self.__mgmtDetails + mgmt_details.apiKey = ret[0] + mgmt_details.securityKey = ret[1] else: self.__logger.error("__createApiClient: API Client " "Creation Failed while " "Registering User") return FAILED else: - self.__mgmtDetails.port = 8080 - self.__mgmtDetails.apiKey = api_key - self.__mgmtDetails.securityKey = security_key + mgmt_details.port = 8080 + mgmt_details.apiKey = api_key + mgmt_details.securityKey = security_key ''' Now Create the Connection objects and Api Client using new details ''' - self.__csConnection = CSConnection(self.__mgmtDetails, + self.__csConnection = CSConnection(mgmt_details, self.__asyncTimeOut, self.__logger) self.__apiClient = CloudStackAPIClient(self.__csConnection) diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index c817cd69535..71f81ad56dd 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -179,7 +179,7 @@ class MarvinPlugin(Plugin): Dump Start Msg of TestCase to Log """ if self.__tcRunLogger: - self.__tcRunLogger.debug("\n\n::::::::::::STARTED : TC: " + + self.__tcRunLogger.debug("::::::::::::STARTED : TC: " + str(self.__testName) + " :::::::::::") self.__startTime = time.time()