Salome HOME
Improve test procedure for source, patch and prepare commands
[tools/sat.git] / test / _testTools / tools.py
index 61de6cfdc9ca1c08380f08a686b02100dcf1d085..a518644559ded66862f9eb2fa1abeb15f4530fa0 100644 (file)
@@ -19,6 +19,7 @@
 import tempfile
 import sys
 import subprocess
+import time
 
 class outRedirection():
     '''redirection of standart output
@@ -62,4 +63,15 @@ def check_proc_existence_and_kill(regex):
         pid = line2[1]
         kill9(pid)
         return pid
-    return 0 
\ No newline at end of file
+    return 0
+
+def check_proc_existence_and_kill_multi(regex, nb_kills, time_between_to_checks = 1):
+    found = False
+    i = 0
+    while not found and i < nb_kills :
+        found = check_proc_existence_and_kill(regex)
+        if found:
+            return found
+        time.sleep(time_between_to_checks)
+        i+=1
+    return 0
\ No newline at end of file