Updated Branches: refs/heads/4.2 8525dfd93 -> b1462e826
CLOUDSTACK-5364: Resolving network cleanup issue in egress fw rules test cases Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b1462e82 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b1462e82 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b1462e82 Branch: refs/heads/4.2 Commit: b1462e826aef2980ec12fef2fb89914c6a8606c5 Parents: 8525dfd Author: Ashutosh K <[email protected]> Authored: Wed Dec 4 18:41:10 2013 +0530 Committer: Girish Shilamkar <[email protected]> Committed: Wed Dec 4 18:42:15 2013 +0530 ---------------------------------------------------------------------- test/integration/component/test_egress_fw_rules.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b1462e82/test/integration/component/test_egress_fw_rules.py ---------------------------------------------------------------------- diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py index 6dcc2c4d..5f076ab 100644 --- a/test/integration/component/test_egress_fw_rules.py +++ b/test/integration/component/test_egress_fw_rules.py @@ -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:
