From b7c4259d9750cffe0cd0796b1434b39bff185b4d Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 13 Aug 2014 16:12:17 +0530 Subject: [PATCH] CLOUDSTACK-7330: Fixing ListNetworks issue in test_portable_ip.py Signed-off-by: Santhosh Edukulla --- .../component/test_persistent_networks.py | 13 ++++--------- tools/marvin/marvin/lib/common.py | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py index b2425798af5..24eb71df5c4 100644 --- a/test/integration/component/test_persistent_networks.py +++ b/test/integration/component/test_persistent_networks.py @@ -1721,13 +1721,6 @@ class TestVPCNetworkOperations(cloudstackTestCase): self.assertEqual(validateList(networks)[0], FAIL, "networks list should be empty, it is %s" % networks) return - def VerifyDomainCleanup(self, domainid): - """Verify that domain is cleaned up""" - - domains=Domain.list(self.apiclient,id=domainid) - self.assertEqual(validateList(domains)[0], FAIL, "domains list should be empty, it is %s" % domains) - return - def VerifyVpcCleanup(self, vpcid): """Verify that VPC is cleaned up""" vpcs = VPC.list(self.apiclient,id=vpcid) @@ -1931,7 +1924,9 @@ class TestVPCNetworkOperations(cloudstackTestCase): " to cleanup any remaining resouces") # Sleep 3*account.gc to ensure that all resources are deleted wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3) - self.VerifyDomainCleanup(child_domain.id) + + with self.assertRaises(Exception): + Domain.list(self.apiclient,id=child_domain.id) with self.assertRaises(Exception): Account.list( @@ -1947,7 +1942,7 @@ class TestVPCNetworkOperations(cloudstackTestCase): self.VerifyVpcCleanup(vpc_1.id) self.VerifyVpcCleanup(vpc_2.id) - self.VerifyNetworkClenaup(persistent_network_1.id) + self.VerifyNetworkCleanup(persistent_network_1.id) self.VerifyNetworkCleanup(persistent_network_2.id) return diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index 62d409c4e51..46291a9d040 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -1151,7 +1151,7 @@ def shouldTestBeSkipped(networkType, zoneType): skipIt = True return skipIt -def verifyNetworkState(apiclient, networkid, state): +def verifyNetworkState(apiclient, networkid, state, listall=True): """List networks and check if the network state matches the given state""" retriesCount = 10 isNetworkInDesiredState = False @@ -1159,7 +1159,7 @@ def verifyNetworkState(apiclient, networkid, state): exceptionMessage = "" try: while retriesCount >= 0: - networks = Network.list(apiclient, id=networkid) + networks = Network.list(apiclient, id=networkid, listall=listall) assert validateList( networks)[0] == PASS, "Networks list validation failed" if str(networks[0].state).lower() == state: