CLOUDSTACK-8235: Fixed test case in test_bugs.py to read variable data from configurableData section of test_data.py and also fixed wrong parameter name
Signed-off-by: SrikanteswaraRao Talluri <tall...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/500baea9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/500baea9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/500baea9 Branch: refs/heads/hotfix/scp-exception Commit: 500baea9b6c816caae93ab2f8d0ba31f99c3f8fc Parents: 015aed9 Author: Gaurav Aradhye <gaurav.arad...@clogeny.com> Authored: Mon Feb 9 02:21:08 2015 -0800 Committer: SrikanteswaraRao Talluri <tall...@apache.org> Committed: Fri Feb 13 13:06:08 2015 +0530 ---------------------------------------------------------------------- test/integration/component/maint/test_bugs.py | 60 ++++++++++++++-------- tools/marvin/marvin/config/test_data.py | 27 +++++----- 2 files changed, 54 insertions(+), 33 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/500baea9/test/integration/component/maint/test_bugs.py ---------------------------------------------------------------------- diff --git a/test/integration/component/maint/test_bugs.py b/test/integration/component/maint/test_bugs.py index 160cd1d..89b3bc9 100644 --- a/test/integration/component/maint/test_bugs.py +++ b/test/integration/component/maint/test_bugs.py @@ -16,18 +16,34 @@ # under the License. # Import Local Modules -from marvin.cloudstackTestCase import * -from marvin.cloudstackException import * -from marvin.cloudstackAPI import * +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.cloudstackAPI import (updateStoragePool, + resizeVolume, + listCapacity, + addCluster) from marvin.sshClient import SshClient -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from marvin.codes import * +from marvin.lib.common import (get_zone, + get_template, + get_domain, + list_volumes, + get_pod, + is_config_suitable) +from marvin.lib.base import (Domain, + Account, + Template, + VirtualMachine, + Volume, + DiskOffering, + StoragePool, + ServiceOffering, + Configurations) +from marvin.lib.utils import cleanup_resources from nose.plugins.attrib import attr +import time class Test42xBugsMgmtSvr(cloudstackTestCase): + @classmethod def setUpClass(cls): try: @@ -135,7 +151,7 @@ class Test42xBugsMgmtSvr(cloudstackTestCase): accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, - ) + ) self.cleanup.append(virtual_machine) # Verify VM state self.assertEqual( @@ -281,7 +297,7 @@ class Test42xBugsMgmtSvr(cloudstackTestCase): self.apiClient.connection.user, self.apiClient.connection.passwd ) - res = mgmt_ssh.execute("cloudstack-sccs") + mgmt_ssh.execute("cloudstack-sccs") # Step2: It should return a commit hash return @@ -444,7 +460,7 @@ class Test42xBugsMgmtSvr(cloudstackTestCase): accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, - ) + ) self.cleanup.append(virtual_machine) # Verify VM state self.assertEqual( @@ -519,7 +535,9 @@ class Test42xBugsMgmtSvr(cloudstackTestCase): # register windows 2012 VM template as windows 8 template self.hypervisor = self.testClient.getHypervisorInfo() if self.hypervisor.lower() in ['lxc']: - self.skipTest("windows VM is not supported on %s" % self.hypervisor.lower()) + self.skipTest( + "windows VM is not supported on %s" % + self.hypervisor.lower()) self.win2012_template = Template.register( self.apiClient, self.services["win2012template"], @@ -602,7 +620,7 @@ class Test42xBugsMgmtSvr(cloudstackTestCase): self.apiClient.connection.user, self.apiClient.connection.passwd ) - res = mgmt_ssh.execute("time telnet localhost 8250") + mgmt_ssh.execute("time telnet localhost 8250") # Step2: It should return a commit hash return @@ -622,15 +640,17 @@ class Test42xBugsMgmtSvr(cloudstackTestCase): cmd = addCluster.addClusterCmd() cmd.zoneid = self.zone.id cmd.hypervisor = self.hypervisor - cmd.clustertype = self.services["vmware_cluster"]["clustertype"] - cmd.podId = self.pod.id - cmd.username = self.services["vmware_cluster"]["username"] - cmd.password = self.services["vmware_cluster"]["password"] + cmd.clustertype = self.services["configurableData"][ + "vmware_cluster"]["clustertype"] + cmd.podid = self.pod.id + cmd.username = self.services["configurableData"][ + "vmware_cluster"]["username"] + cmd.password = self.services["configurableData"][ + "vmware_cluster"]["password"] cmd.publicswitchtype = 'vmwaredvs' cmd.guestswitchtype = 'vmwaredvs' - cmd.url = self.services["vmware_cluster"]["url"] - cmd.clustername = self.services["vmware_cluster"]["url"] - + cmd.url = self.services["configurableData"]["vmware_cluster"]["url"] + cmd.clustername = self.services[ + "configurableData"]["vmware_cluster"]["url"] self.apiClient.addCluster(cmd) - return http://git-wip-us.apache.org/repos/asf/cloudstack/blob/500baea9/tools/marvin/marvin/config/test_data.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 49c8b7d..1609860 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -62,14 +62,6 @@ test_data = { "username": "test-account2", "password": "password" }, - "vmware_cluster" : { - "hypervisor": 'VMware', - "clustertype": 'ExternalManaged', - "username": 'administrator', - "password": 'password_123', - "url": 'http://10.147.60.15/42xescauto spaces/42xesc Clusters', - "clustername": 'VMWare Cluster with Space in DC name', - }, "small": { "displayname": "testserver", "username": "root", @@ -931,6 +923,13 @@ test_data = { "customdisksize": 1, "diskname": "Custom disk", }, + "upload_volume": { + "diskname": "UploadVol", + "format": "VHD", + "url": + "http://10.147.28.7/templates/393d3550-05ef-330f-9b8c-745b0e699759.vhd", + "checksum": "", + }, "recurring_snapshot": { "maxsnaps": 2, "timezone": "US/Arizona", @@ -1513,11 +1512,13 @@ test_data = { "ldapPassword": "" }, "systemVmDelay": 120, - "upload_volume": { - "diskname": "UploadVol", - "format": "VHD", - "url": "", - "checksum": "", + "vmware_cluster" : { + "hypervisor": 'VMware', + "clustertype": 'ExternalManaged', + "username": '', + "password": '', + "url": '', + "clustername": 'VMWare Cluster with Space in DC name', }, } }