summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-28 11:16:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-29 08:25:07 +0100
commit3924e94214b5135369be2551d54fb92097d35e95 (patch)
tree01c8217ac56fa4e4eacbdafa55602f6d58a950ce /meta/lib/oeqa/core
parent8691020f33a644d52b7d867376ef3c85be84abf9 (diff)
downloadopenembedded-core-3924e94214b5135369be2551d54fb92097d35e95.tar.gz
target/ssh: Ensure exit code set for commands
As spotted by Joshua Watt, the returncode isn't set until .poll() or .wait() is called so we need to call this after the .kill() call. This fixes return code reporting so that timeouts for example now return an exit code when they didn't before. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core')
-rw-r--r--meta/lib/oeqa/core/target/ssh.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index 243e45dd99..72ed1adbf8 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -265,6 +265,7 @@ def SSHCall(command, logger, timeout=None, **opts):
time.sleep(5)
try:
process.kill()
+ process.wait()
except OSError:
logger.debug('OSError when killing process')
pass
@@ -287,6 +288,7 @@ def SSHCall(command, logger, timeout=None, **opts):
except TimeoutExpired:
try:
process.kill()
+ process.wait()
except OSError:
logger.debug('OSError')
pass
@@ -316,6 +318,7 @@ def SSHCall(command, logger, timeout=None, **opts):
# whilst running and ensure we don't leave a process behind.
if process.poll() is None:
process.kill()
+ process.wait()
logger.debug('Something went wrong, killing SSH process')
raise