From 714a03522f8d7c272d6365c1e9d15f3e0ce59a46 Mon Sep 17 00:00:00 2001 From: Sanghoon Lee Date: Fri, 3 Aug 2018 15:25:27 +0900 Subject: [PATCH] [sdbmanager][Non-ACR][Updated sdb manager] Change-Id: I0a7ba3b4f2c497dbd797d97a2794b3be6afda584 --- .../csharp-tct_5.0_dotnet/tools/sdbmanager.py | 34 +++---------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/tools/sdbmanager.py b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/tools/sdbmanager.py index ad1ccb14f..1f474e4ba 100755 --- a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/tools/sdbmanager.py +++ b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/tools/sdbmanager.py @@ -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 -- 2.34.1