Prevent waits at cleanup Do not wait until gc finishes cleanup of resources. This delays tests and is dependant on the deployment. Some have large cleanup.intervals. Assume cleanup succeeds and proceed
Signed-off-by: Prasanna Santhanam <[email protected]> (cherry picked from commit c8f744dbc36b192620c8b494cc41cfb18e1d81be) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/aaa9fc04 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aaa9fc04 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aaa9fc04 Branch: refs/heads/master-6-17-stable Commit: aaa9fc0482da6b1de86837ae6f6576439590f953 Parents: 335920d Author: Prasanna Santhanam <[email protected]> Authored: Wed Jun 19 17:05:24 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Sat Jun 29 00:52:08 2013 +0530 ---------------------------------------------------------------------- .../integration/component/test_vpc_offerings.py | 52 +++++--------------- 1 file changed, 11 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aaa9fc04/test/integration/component/test_vpc_offerings.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py index a111d7d..cf37d90 100644 --- a/test/integration/component/test_vpc_offerings.py +++ b/test/integration/component/test_vpc_offerings.py @@ -130,7 +130,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -181,36 +180,7 @@ class TestVPCOffering(cloudstackTestCase): admin=True, domainid=self.domain.id ) - self.cleanup = [] - return - - def tearDown(self): - try: - #Clean up, terminate the created network offering - self.account.delete(self.apiclient) - interval = list_configurations( - self.apiclient, - name='network.gc.interval' - ) - wait = list_configurations( - self.apiclient, - name='network.gc.wait' - ) - # Sleep to ensure that all resources are deleted - time.sleep(int(interval[0].value) + int(wait[0].value)) - cleanup_resources(self.apiclient, self.cleanup) - interval = list_configurations( - self.apiclient, - name='network.gc.interval' - ) - wait = list_configurations( - self.apiclient, - name='network.gc.wait' - ) - # Sleep to ensure that all resources are deleted - time.sleep(int(interval[0].value) + int(wait[0].value)) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) + self._cleanup.insert(0, self.account) return def validate_vpc_offering(self, vpc_offering): @@ -273,7 +243,7 @@ class TestVPCOffering(cloudstackTestCase): ) self.debug("Check if the VPC offering is created successfully?") - self.cleanup.append(vpc_off) + self._cleanup.append(vpc_off) self.validate_vpc_offering(vpc_off) return @@ -581,7 +551,7 @@ class TestVPCOffering(cloudstackTestCase): self.services["vpc_offering"] ) - self.cleanup.append(vpc_off) + self._cleanup.append(vpc_off) self.validate_vpc_offering(vpc_off) self.debug("Enabling the VPC offering created") @@ -700,7 +670,7 @@ class TestVPCOffering(cloudstackTestCase): self.services["vpc_offering"] ) - self.cleanup.append(vpc_off) + self._cleanup.append(vpc_off) self.validate_vpc_offering(vpc_off) self.debug("Enabling the VPC offering created") @@ -821,7 +791,7 @@ class TestVPCOffering(cloudstackTestCase): self.services["vpc_offering"] ) - self.cleanup.append(vpc_off) + self._cleanup.append(vpc_off) self.validate_vpc_offering(vpc_off) self.debug("Enabling the VPC offering created") @@ -934,7 +904,7 @@ class TestVPCOffering(cloudstackTestCase): ) self.validate_vpc_offering(vpc_off) # Appending to cleanup to delete after test - self.cleanup.append(vpc_off) + self._cleanup.append(vpc_off) except Exception as e: self.fail("Failed to create the VPC offering - %s" % e) return @@ -958,7 +928,7 @@ class TestVPCOffering(cloudstackTestCase): self.services["vpc_offering"] ) - self.cleanup.append(vpc_off) + self._cleanup.append(vpc_off) self.validate_vpc_offering(vpc_off) self.debug("Enabling the VPC offering created") @@ -1054,7 +1024,7 @@ class TestVPCOffering(cloudstackTestCase): self.apiclient, self.services["vpc_offering"] ) - self.cleanup.append(vpc_off_1) + self._cleanup.append(vpc_off_1) self.validate_vpc_offering(vpc_off_1) self.debug("Disabling the VPC offering created") vpc_off_1.update(self.apiclient, state='Disabled') @@ -1064,7 +1034,7 @@ class TestVPCOffering(cloudstackTestCase): self.services["vpc_offering"] ) - self.cleanup.append(vpc_off_2) + self._cleanup.append(vpc_off_2) self.validate_vpc_offering(vpc_off_2) self.debug("Enabling the VPC offering created") vpc_off_2.update(self.apiclient, state='Enabled') @@ -1074,7 +1044,7 @@ class TestVPCOffering(cloudstackTestCase): self.services["vpc_offering"] ) - self.cleanup.append(vpc_off_3) + self._cleanup.append(vpc_off_3) self.validate_vpc_offering(vpc_off_3) self.debug("Enabling the VPC offering created") vpc_off_3.update(self.apiclient, state='Enabled') @@ -1083,7 +1053,7 @@ class TestVPCOffering(cloudstackTestCase): self.apiclient, self.services["vpc_offering"] ) - self.validate_vpc_offering(vpc_off_4) + self._cleanup.append(vpc_off_4) self.debug("Enabling the VPC offering created") vpc_off_4.update(self.apiclient, state='Enabled')
