Skip to content

Commit a92abaa

Browse files
author
Prasanna Santhanam
committed
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>
1 parent 8f57a85 commit a92abaa

6 files changed

Lines changed: 27 additions & 28 deletions

File tree

test/integration/component/test_eip_elb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def setUpClass(cls):
150150
else:
151151
raise Exception(
152152
"No Source NAT IP found for guest network: %s" %
153-
guest_network.id)
153+
cls.guest_network.id)
154154
cls._cleanup = [
155155
cls.account,
156156
cls.service_offering,
@@ -759,7 +759,7 @@ def test_04_disable_static_nat_system(self):
759759
with self.assertRaises(Exception):
760760
cmd = disassociateIpAddress.disassociateIpAddressCmd()
761761
cmd.id = static_nat.id
762-
apiclient.disassociateIpAddress(cmd)
762+
self.api_client.disassociateIpAddress(cmd)
763763

764764
self.debug("Disassociate system IP failed")
765765
return

test/integration/component/test_redundant_router.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def test_redundantVR_internals(self):
878878
)
879879
else:
880880
result = get_process_status(
881-
host.ipaddress,
881+
master_host.ipaddress,
882882
self.services['host']["publicport"],
883883
self.services['host']["username"],
884884
self.services['host']["password"],
@@ -914,7 +914,7 @@ def test_redundantVR_internals(self):
914914
)
915915
else:
916916
result = get_process_status(
917-
host.ipaddress,
917+
backup_host.ipaddress,
918918
self.services['host']["publicport"],
919919
self.services['host']["username"],
920920
self.services['host']["password"],
@@ -1107,7 +1107,7 @@ def test_stopMasterRvR(self):
11071107

11081108
self.debug("Stopping the MASTER router")
11091109
try:
1110-
cmd = stopRouter.stopRouter(cmd)
1110+
cmd = stopRouter.stopRouterCmd()
11111111
cmd.id = master_router.id
11121112
self.apiclient.stopRouter(cmd)
11131113
except Exception as e:
@@ -1234,7 +1234,7 @@ def test_stopBackupRvR(self):
12341234

12351235
self.debug("Stopping the BACKUP router")
12361236
try:
1237-
cmd = stopRouter.stopRouter(cmd)
1237+
cmd = stopRouter.stopRouterCmd()
12381238
cmd.id = backup_router.id
12391239
self.apiclient.stopRouter(cmd)
12401240
except Exception as e:
@@ -1355,7 +1355,7 @@ def test_rebootMasterRvR(self):
13551355

13561356
self.debug("Rebooting the master router")
13571357
try:
1358-
cmd = rebootRouter.rebootRouter(cmd)
1358+
cmd = rebootRouter.rebootRouterCmd()
13591359
cmd.id = master_router.id
13601360
self.apiclient.rebootRouter(cmd)
13611361
except Exception as e:
@@ -1449,7 +1449,7 @@ def test_rebootBackupRvR(self):
14491449

14501450
self.debug("Rebooting the backuo router")
14511451
try:
1452-
cmd = rebootRouter.rebootRouter(cmd)
1452+
cmd = rebootRouter.rebootRouterCmd()
14531453
cmd.id = backup_router.id
14541454
self.apiclient.rebootRouter(cmd)
14551455
except Exception as e:
@@ -1543,7 +1543,7 @@ def test_stopBackupRvR_startInstance(self):
15431543

15441544
self.debug("Stopping the backup router")
15451545
try:
1546-
cmd = stopRouter.stopRouter(cmd)
1546+
cmd = stopRouter.stopRouterCmd()
15471547
cmd.id = backup_router.id
15481548
self.apiclient.stopRouter(cmd)
15491549
except Exception as e:
@@ -1574,9 +1574,9 @@ def test_stopBackupRvR_startInstance(self):
15741574
accountid=self.account.name,
15751575
domainid=self.account.account.domainid,
15761576
serviceofferingid=self.service_offering.id,
1577-
networkids=[str(network.id)]
1577+
networkids=[str(self.network.id)]
15781578
)
1579-
self.debug("Deployed VM in network: %s" % network.id)
1579+
self.debug("Deployed VM in network: %s" % self.network.id)
15801580

15811581
vms = VirtualMachine.list(
15821582
self.apiclient,

test/integration/component/test_security_groups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ def setUp(self):
988988
# Get Zone, Domain and templates
989989
self.domain = get_domain(self.apiclient, self.services)
990990
self.zone = get_zone(self.apiclient, self.services)
991-
self.services['mode'] = cls.zone.networktype
991+
self.services['mode'] = self.zone.networktype
992992

993993
template = get_template(
994994
self.apiclient,
@@ -1234,7 +1234,7 @@ def setUp(self):
12341234
# Get Zone, Domain and templates
12351235
self.domain = get_domain(self.apiclient, self.services)
12361236
self.zone = get_zone(self.apiclient, self.services)
1237-
self.services['mode'] = cls.zone.networktype
1237+
self.services['mode'] = self.zone.networktype
12381238

12391239
template = get_template(
12401240
self.apiclient,

test/integration/component/test_vpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,8 +2567,7 @@ def tearDownClass(cls):
25672567
)
25682568
if hosts_states[0].resourcestate != 'Enabled':
25692569
raise Exception(
2570-
"Failed to cancel maintenance mode on %s, e" % (
2571-
host.name, e))
2570+
"Failed to cancel maintenance mode on %s" % (host.name))
25722571
except Exception as e:
25732572
raise Exception("Warning: Exception during cleanup : %s" % e)
25742573
return

test/integration/component/test_vpc_vms_deployment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ def test_07_delete_network_with_rules(self):
19001900
vpcid=vpc.id
19011901
)
19021902
self.debug("Associated %s with network %s" % (
1903-
public_ip.ipaddress.ipaddress,
1903+
public_ip_1.ipaddress.ipaddress,
19041904
network_1.id
19051905
))
19061906

@@ -2365,7 +2365,7 @@ def test_07_delete_network_with_rules(self):
23652365

23662366
self.debug("Verifying if we can ping to outside world from VM?")
23672367
# Ping to outsite world
2368-
res = ssh_5.execute("ping -c 1 www.google.com")
2368+
res = ssh_4.execute("ping -c 1 www.google.com")
23692369
# res = 64 bytes from maa03s17-in-f20.1e100.net (74.125.236.212):
23702370
# icmp_req=1 ttl=57 time=25.9 ms
23712371
# --- www.l.google.com ping statistics ---

test/integration/component/test_vpn_users.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,28 @@ def __init__(self):
9191

9292

9393
class TestVPNUsers(cloudstackTestCase):
94-
9594
@classmethod
9695
def setUpClass(cls):
9796
cls.api_client = super(TestVPNUsers,
98-
cls).getClsTestClient().getApiClient()
97+
cls).getClsTestClient().getApiClient()
9998
cls.services = Services().services
10099
# Get Zone, Domain and templates
101100
cls.domain = get_domain(cls.api_client, cls.services)
102101
cls.zone = get_zone(cls.api_client, cls.services)
103-
cls.services["mode"] = cls.zone.networktype
104102

105-
cls.template = get_template(
106-
cls.api_client,
107-
cls.zone.id,
108-
cls.services["ostype"]
109-
)
103+
cls.services["mode"] = cls.zone.networktype
104+
105+
cls.template = get_template(
106+
cls.api_client,
107+
cls.zone.id,
108+
cls.services["ostype"]
109+
)
110110

111111
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
112112
cls.service_offering = ServiceOffering.create(
113-
cls.api_client,
114-
cls.services["service_offering"]
115-
)
113+
cls.api_client,
114+
cls.services["service_offering"]
115+
)
116116

117117
cls._cleanup = [cls.service_offering, ]
118118
return

0 commit comments

Comments
 (0)