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 <talluri@apache.org>
This commit is contained in:
Gaurav Aradhye 2015-02-09 02:21:08 -08:00 committed by SrikanteswaraRao Talluri
parent 015aed9bef
commit 500baea9b6
2 changed files with 54 additions and 33 deletions

View File

@ -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:
@ -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
@ -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

View File

@ -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',
},
}
}