- typo
[oweals/gnunet.git] / src / integration-tests / test_integration_connect_on_restart.py.in
index 0b23c8fe80762fd3d0199ae6d381bd9ea3f66fef..3fe5756e6efc9f9602d799c84f103ba4654f0486 100755 (executable)
@@ -51,8 +51,35 @@ 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)
+    
+        retries = 10
+    path = os.path.join (tmp, "c_no_nat_client_2")  
+    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)
     shutil.rmtree (os.path.join (tmp, "c_no_nat_client_2"), True)
 
 
@@ -135,6 +162,7 @@ def run ():
        success = False
        
        test = Test ('test_integration_disconnect', verbose)
+       cleanup ()
        
        server = Peer(test, './confs/c_bootstrap_server.conf');
        server.start();