summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-11-01 16:29:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-02 09:20:53 +0000
commite244228730178d15a066a1428956de328cc09671 (patch)
tree5d302bc20145ecd3b1683fb16750605df6c8be81
parent49ad6f031458e1f48f24547dc88e41abc4ec41a6 (diff)
downloadopenembedded-core-contrib-e244228730178d15a066a1428956de328cc09671.tar.gz
oeqa/target/ssh: add ignore_status argument to run()
The underlying _run() method has an ignore_status argument and can either return the exit code or raise an exception if it is non-zero. Add the same argument to the run() method so that test cases can change this value. It currently defaults to True as that is the existing behaviour, but a follow-up patch will change this to False as test cases should fail on errors unless told otherwise. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/core/target/ssh.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index f956a7744f..7a10ba9763 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -78,7 +78,7 @@ class OESSHTarget(OETarget):
return (status, output)
- def run(self, command, timeout=None):
+ def run(self, command, timeout=None, ignore_status=True):
"""
Runs command in target.
@@ -97,7 +97,7 @@ class OESSHTarget(OETarget):
else:
processTimeout = self.timeout
- status, output = self._run(sshCmd, processTimeout, True)
+ status, output = self._run(sshCmd, processTimeout, ignore_status)
self.logger.debug('Command: %s\nStatus: %d Output: %s\n' % (command, status, output))
if (status == 255) and (('No route to host') in output):
if self.monitor_dumper: