CLOUDSTACK-5364: Resolving network cleanup issue in egress fw rules test cases

This commit is contained in:
Ashutosh K 2013-12-04 18:41:10 +05:30 committed by Girish Shilamkar
parent 8525dfd931
commit b1462e826a
1 changed files with 12 additions and 3 deletions

View File

@ -376,12 +376,21 @@ class TestEgressFWRules(cloudstackTestCase):
self.debug("Cleaning up the resources")
self.virtual_machine.delete(self.apiclient)
wait_for_cleanup(self.apiclient, ["expunge.interval", "expunge.delay"])
self.debug("Sleep for VM cleanup to complete.")
#time.sleep(self.services['sleep'])
retriesCount = 5
while True:
vms = list_virtual_machines(self.apiclient, id=self.virtual_machine.id)
if vms is None:
break
elif retriesCount == 0:
self.fail("Failed to delete/expunge VM")
time.sleep(10)
retriesCount -= 1
self.network.delete(self.apiclient)
self.debug("Sleep for Network cleanup to complete.")
wait_for_cleanup(self.apiclient, ["network.gc.wait", "network.gc.interval"])
#time.sleep(self.services['sleep'])
cleanup_resources(self.apiclient, reversed(self.cleanup))
self.debug("Cleanup complete!")
except Exception as e: