From 5a889b04b4975e880fe5fd815b7c39f6e8dd9855 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 8 Apr 2013 09:45:29 +0000 Subject: fixed cleanup --- .../test_integration_bootstrap_and_connect.py.in | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/integration-tests/test_integration_bootstrap_and_connect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect.py.in index cd3bdbef8..b95ed3c57 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in @@ -57,9 +57,27 @@ else: tmp = "/tmp" def cleanup (): - shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) - shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) - + retries = 10 + path = os.path.join (tmp, "c_bootstrap_server") + test.p ("Removing " + path) + while ((os.path.exists(path)) and (retries > 0)): + shutil.rmtree ((path), False) + time.sleep (1) + retries -= 1 + if (os.path.exists(path)): + test.p ("Failed to remove " + path) + + + retries = 10 + path = os.path.join (tmp, "c_no_nat_client") + test.p ("Removing " + path) + while ((os.path.exists(path)) and (retries > 0)): + shutil.rmtree ((path), False) + time.sleep (1) + retries -= 1 + if (os.path.exists(path)): + test.p ("Failed to remove " + path) + def success_cont (check): global success success = True; -- cgit v1.2.3