Skip to content

Commit b1462e8

Browse files
Ashutosh KGirish Shilamkar
authored andcommitted
CLOUDSTACK-5364: Resolving network cleanup issue in egress fw rules test cases
1 parent 8525dfd commit b1462e8

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎test/integration/component/test_egress_fw_rules.py‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,21 @@ def tearDown(self):
376376
self.debug("Cleaning up the resources")
377377
self.virtual_machine.delete(self.apiclient)
378378
wait_for_cleanup(self.apiclient, ["expunge.interval", "expunge.delay"])
379-
self.debug("Sleep for VM cleanup to complete.")
380-
#time.sleep(self.services['sleep'])
379+
380+
retriesCount = 5
381+
while True:
382+
vms = list_virtual_machines(self.apiclient, id=self.virtual_machine.id)
383+
if vms is None:
384+
break
385+
elif retriesCount == 0:
386+
self.fail("Failed to delete/expunge VM")
387+
388+
time.sleep(10)
389+
retriesCount -= 1
390+
381391
self.network.delete(self.apiclient)
382392
self.debug("Sleep for Network cleanup to complete.")
383393
wait_for_cleanup(self.apiclient, ["network.gc.wait", "network.gc.interval"])
384-
#time.sleep(self.services['sleep'])
385394
cleanup_resources(self.apiclient, reversed(self.cleanup))
386395
self.debug("Cleanup complete!")
387396
except Exception as e:

0 commit comments

Comments
 (0)