[sdbmanager][Non-ACR][Updated sdb manager] 69/185869/1
authorSanghoon Lee <shooney.lee@samsung.com>
Fri, 3 Aug 2018 06:25:27 +0000 (15:25 +0900)
committerSanghoon Lee <shooney.lee@samsung.com>
Fri, 3 Aug 2018 06:25:27 +0000 (15:25 +0900)
Change-Id: I0a7ba3b4f2c497dbd797d97a2794b3be6afda584

release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/tools/sdbmanager.py

index ad1ccb1..1f474e4 100755 (executable)
@@ -58,47 +58,21 @@ class SdbManager:
 
     @staticmethod
     def sdbCommand(command, timeout=90):
-        max_retry = 20
-        retry_attempt = 0 
-        exit_code = None
-        re_stdout = None
-        re_stderr = None
-
-        while retry_attempt < max_retry:
-            exit_code, re_stdout, re_stderr = \
-                    SdbManager.sdbCommand_internal(command, timeout)
-            print "exit_code: %s, retry_attempt: %d, max_retry: %d" % \
-                  (str(exit_code), retry_attempt, max_retry)
-            #print "stdout: %s, stderr: %s" % \
-            #      (str(re_stdout.readline()), str(re_stderr.readline()))
-            if exit_code == 0:
-                break
-            else:
-                retry_attempt += 1
-                if (retry_attempt % 5) == 4:
-                    SdbManager.sdbCommand_internal(SDB_KILL_SERVER, timeout)
-                continue
-
-        if exit_code is None:
-            SdbManager.killall(proc.pid)
-
-        return exit_code, re_stdout, re_stderr
-
-    @staticmethod
-    def sdbCommand_internal(command, timeout=90):
         print command
         proc = subprocess.Popen(command,
                                 shell=True,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
-        time_out = 0 
+        time_out = 0
         exit_code = None
         while time_out < timeout:
             exit_code = proc.poll()
             if exit_code is not None:
                 break
-            time_out += 0.5 
+            time_out += 0.5
             time.sleep(0.5)
+        if exit_code is None:
+            SdbManager.killall(proc.pid)
 
         return exit_code, proc.stdout, proc.stderr