Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv2] ltp: make copyFrom scp command non-fatal
@ 2020-08-05 17:15 Matthew
  2020-08-05 17:39 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew @ 2020-08-05 17:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: richard.purdie

[YOCTO #13802]

Make the scp failure non-fatal so the ltp tests continue to run and
the rest of the logs will be available to see afterwards.

Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com>
---
 meta/lib/oeqa/core/target/ssh.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index 090b40a814..e891a4bbfa 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -50,7 +50,7 @@ class OESSHTarget(OETarget):
     def stop(self, **kwargs):
         pass

-    def _run(self, command, timeout=None, ignore_status=True):
+    def _run(self, command, timeout=None, ignore_status=True, ignore_error=False):
         """
             Runs command in target using SSHProcess.
         """
@@ -62,8 +62,11 @@ class OESSHTarget(OETarget):
                  "" % (status, time.time() - starttime))

         if status and not ignore_status:
-            raise AssertionError("Command '%s' returned non-zero exit "
-                                 "status %d:\n%s" % (command, status, output))
+            if ignore_error:
+                self.logger.warning("Command '%s' returned non-zero exit status %d:\n%s" % (command, status, output))
+            else:
+                raise AssertionError("Command '%s' returned non-zero exit "
+                                     "status %d:\n%s" % (command, status, output))

         return (status, output)

@@ -113,7 +116,7 @@ class OESSHTarget(OETarget):
         """
         remotePath = '%s@%s:%s' % (self.user, self.ip, remoteSrc)
         scpCmd = self.scp + [remotePath, localDst]
-        return self._run(scpCmd, ignore_status=False)
+        return self._run(scpCmd, ignore_error=True)

     def copyDirTo(self, localSrc, remoteDst):
         """
--
2.27.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-05 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-05 17:15 [PATCHv2] ltp: make copyFrom scp command non-fatal Matthew
2020-08-05 17:39 ` Richard Purdie
2020-08-05 17:57   ` Matthew
2020-08-05 17:58   ` Matthew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox