mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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 <tsp@apache.org>
This commit is contained in:
parent
1af928570c
commit
c8f744dbc3
@ -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')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user