multiple fixes to regression tests in test/component

- invalid variable references
- syntax/indentation errors
- self/cls reference errors
- some logic fixes in redundant router suite

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-05-14 11:42:34 +05:30
parent 8f57a851be
commit a92abaa916
6 changed files with 27 additions and 28 deletions

View File

@ -150,7 +150,7 @@ class TestEIP(cloudstackTestCase):
else:
raise Exception(
"No Source NAT IP found for guest network: %s" %
guest_network.id)
cls.guest_network.id)
cls._cleanup = [
cls.account,
cls.service_offering,
@ -759,7 +759,7 @@ class TestEIP(cloudstackTestCase):
with self.assertRaises(Exception):
cmd = disassociateIpAddress.disassociateIpAddressCmd()
cmd.id = static_nat.id
apiclient.disassociateIpAddress(cmd)
self.api_client.disassociateIpAddress(cmd)
self.debug("Disassociate system IP failed")
return

View File

@ -878,7 +878,7 @@ class TestRVRInternals(cloudstackTestCase):
)
else:
result = get_process_status(
host.ipaddress,
master_host.ipaddress,
self.services['host']["publicport"],
self.services['host']["username"],
self.services['host']["password"],
@ -914,7 +914,7 @@ class TestRVRInternals(cloudstackTestCase):
)
else:
result = get_process_status(
host.ipaddress,
backup_host.ipaddress,
self.services['host']["publicport"],
self.services['host']["username"],
self.services['host']["password"],
@ -1107,7 +1107,7 @@ class TestRedundancy(cloudstackTestCase):
self.debug("Stopping the MASTER router")
try:
cmd = stopRouter.stopRouter(cmd)
cmd = stopRouter.stopRouterCmd()
cmd.id = master_router.id
self.apiclient.stopRouter(cmd)
except Exception as e:
@ -1234,7 +1234,7 @@ class TestRedundancy(cloudstackTestCase):
self.debug("Stopping the BACKUP router")
try:
cmd = stopRouter.stopRouter(cmd)
cmd = stopRouter.stopRouterCmd()
cmd.id = backup_router.id
self.apiclient.stopRouter(cmd)
except Exception as e:
@ -1355,7 +1355,7 @@ class TestRedundancy(cloudstackTestCase):
self.debug("Rebooting the master router")
try:
cmd = rebootRouter.rebootRouter(cmd)
cmd = rebootRouter.rebootRouterCmd()
cmd.id = master_router.id
self.apiclient.rebootRouter(cmd)
except Exception as e:
@ -1449,7 +1449,7 @@ class TestRedundancy(cloudstackTestCase):
self.debug("Rebooting the backuo router")
try:
cmd = rebootRouter.rebootRouter(cmd)
cmd = rebootRouter.rebootRouterCmd()
cmd.id = backup_router.id
self.apiclient.rebootRouter(cmd)
except Exception as e:
@ -1543,7 +1543,7 @@ class TestRedundancy(cloudstackTestCase):
self.debug("Stopping the backup router")
try:
cmd = stopRouter.stopRouter(cmd)
cmd = stopRouter.stopRouterCmd()
cmd.id = backup_router.id
self.apiclient.stopRouter(cmd)
except Exception as e:
@ -1574,9 +1574,9 @@ class TestRedundancy(cloudstackTestCase):
accountid=self.account.name,
domainid=self.account.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(network.id)]
networkids=[str(self.network.id)]
)
self.debug("Deployed VM in network: %s" % network.id)
self.debug("Deployed VM in network: %s" % self.network.id)
vms = VirtualMachine.list(
self.apiclient,

View File

@ -988,7 +988,7 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
# Get Zone, Domain and templates
self.domain = get_domain(self.apiclient, self.services)
self.zone = get_zone(self.apiclient, self.services)
self.services['mode'] = cls.zone.networktype
self.services['mode'] = self.zone.networktype
template = get_template(
self.apiclient,
@ -1234,7 +1234,7 @@ class TestIngressRule(cloudstackTestCase):
# Get Zone, Domain and templates
self.domain = get_domain(self.apiclient, self.services)
self.zone = get_zone(self.apiclient, self.services)
self.services['mode'] = cls.zone.networktype
self.services['mode'] = self.zone.networktype
template = get_template(
self.apiclient,

View File

@ -2567,8 +2567,7 @@ class TestVPCHostMaintenance(cloudstackTestCase):
)
if hosts_states[0].resourcestate != 'Enabled':
raise Exception(
"Failed to cancel maintenance mode on %s, e" % (
host.name, e))
"Failed to cancel maintenance mode on %s" % (host.name))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return

View File

@ -1900,7 +1900,7 @@ class TestVMDeployVPC(cloudstackTestCase):
vpcid=vpc.id
)
self.debug("Associated %s with network %s" % (
public_ip.ipaddress.ipaddress,
public_ip_1.ipaddress.ipaddress,
network_1.id
))
@ -2365,7 +2365,7 @@ class TestVMDeployVPC(cloudstackTestCase):
self.debug("Verifying if we can ping to outside world from VM?")
# Ping to outsite world
res = ssh_5.execute("ping -c 1 www.google.com")
res = ssh_4.execute("ping -c 1 www.google.com")
# res = 64 bytes from maa03s17-in-f20.1e100.net (74.125.236.212):
# icmp_req=1 ttl=57 time=25.9 ms
# --- www.l.google.com ping statistics ---

View File

@ -91,7 +91,6 @@ class Services:
class TestVPNUsers(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestVPNUsers,
@ -100,6 +99,7 @@ class TestVPNUsers(cloudstackTestCase):
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
cls.services["mode"] = cls.zone.networktype
cls.template = get_template(