diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 8a73b910477..7ff6315954c 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -611,10 +611,7 @@ class TestRouterRestart(cloudstackTestCase): return def tearDown(self): - try: - cleanup_resources(self.apiclient, self.cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) + # No need return @attr(tags = ["advanced", "basic", "sg", "advancedns", "eip"]) diff --git a/test/integration/component/test_redundant_router.py b/test/integration/component/test_redundant_router.py index 08abd093fe9..55f07108e89 100644 --- a/test/integration/component/test_redundant_router.py +++ b/test/integration/component/test_redundant_router.py @@ -288,7 +288,7 @@ class TestCreateRvRNetwork(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return @@ -486,7 +486,7 @@ class TestCreateRvRNetworkNonDefaultGuestCidr(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return @@ -693,7 +693,7 @@ class TestRVRInternals(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return @@ -1013,7 +1013,7 @@ class TestRvRRedundancy(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return diff --git a/test/integration/component/test_redundant_router_services.py b/test/integration/component/test_redundant_router_services.py index d5afe2938ef..59f9edcc3fd 100644 --- a/test/integration/component/test_redundant_router_services.py +++ b/test/integration/component/test_redundant_router_services.py @@ -195,7 +195,7 @@ class TestEnableVPNOverRvR(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return diff --git a/test/integration/component/test_redundant_router_upgrades.py b/test/integration/component/test_redundant_router_upgrades.py index da3b9b00b58..e67507acaec 100644 --- a/test/integration/component/test_redundant_router_upgrades.py +++ b/test/integration/component/test_redundant_router_upgrades.py @@ -194,7 +194,7 @@ class TestRvRUpgradeDowngrade(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index b894b1fb9a7..2c2301aeea3 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -162,12 +162,20 @@ class TestAttachVolume(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self._cleanup) + cleanup_resources(self.apiclient, self.cleanup) except Exception as e: self.debug("Warning: Exception during cleanup : %s" % e) #raise Exception("Warning: Exception during cleanup : %s" % e) return + @classmethod + def tearDownClass(cls): + try: + cls.api_client = super(TestAttachVolume, cls).getClsTestClient().getApiClient() + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(tags = ["advanced", "advancedns"]) def test_01_volume_attach(self): """Test Attach volumes (max capacity) @@ -370,20 +378,6 @@ class TestAttachVolume(cloudstackTestCase): ) return - def tearDown(self): - #Clean up, terminate the created volumes - cleanup_resources(self.apiclient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cls.api_client = super(TestAttachVolume, cls).getClsTestClient().getApiClient() - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - class TestAttachDetachVolume(cloudstackTestCase): @classmethod diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py index 28af16a9ff2..d1d7c6c96fa 100644 --- a/test/integration/component/test_vpc_offerings.py +++ b/test/integration/component/test_vpc_offerings.py @@ -185,7 +185,7 @@ class TestVPCOffering(cloudstackTestCase): def tearDown(self): try: - cleanup_resources(self.apiclient, self.cleanup) + cleanup_resources(self.apiclient, self._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return