mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 11:58:55 +00:00
adb_shell: Fixed getting return codes
They way we were attempting to get return codes before always gave us a return code of the previous echo, therefore always `0`. This commit adds the newline into the last echo.
This commit is contained in:
parent
2cf08cf448
commit
e96450d226
@ -276,7 +276,7 @@ def adb_shell(device, command, timeout=None, check_exit_code=False, as_root=Fals
|
||||
full_command = 'adb {} shell "{}"'.format(device_string, escape_double_quotes(command))
|
||||
logger.debug(full_command)
|
||||
if check_exit_code:
|
||||
actual_command = "adb {} shell '({}); echo; echo $?'".format(device_string, escape_single_quotes(command))
|
||||
actual_command = "adb {} shell '({}); echo \"\n$?\"'".format(device_string, escape_single_quotes(command))
|
||||
try:
|
||||
raw_output, error = check_output(actual_command, timeout, shell=True)
|
||||
except CalledProcessErrorWithStderr as e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user