diff mbox series

[scarthgap,16/18] oeqa/runtime/ssh: check for all errors at the end

Message ID 52a67132d4d7e656a39d87c03b1c6162018e8908.1724244509.git.steve@sakoman.com
State Accepted
Delegated to: Steve Sakoman
Headers show
Series [scarthgap,01/18] ruby: Backport fix for CVE-2024-27282 | expand

Commit Message

Steve Sakoman Aug. 21, 2024, 12:50 p.m. UTC
From: Jon Mason <jdmason@kudzu.us>

With the retry for the -SIGTERM, it is possible to still see that error
after the 5th attempt and mark the run a success.  Check for any
non-zero status in the final check and error out to close the gap.
While there, make the error print match the one above and be a little
more verbose.  Also, I'm seeing it take roughly 6 attempts on my local
(very slow) system to pass.  So, increasing the number of attempts to
10.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3c3ebe591eef6e0479d623ec2237cfea16db5c80)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/lib/oeqa/runtime/cases/ssh.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/runtime/cases/ssh.py b/meta/lib/oeqa/runtime/cases/ssh.py
index 9a8deb3f25..08430ae9db 100644
--- a/meta/lib/oeqa/runtime/cases/ssh.py
+++ b/meta/lib/oeqa/runtime/cases/ssh.py
@@ -16,7 +16,7 @@  class SSHTest(OERuntimeTestCase):
     @OETestDepends(['ping.PingTest.test_ping'])
     @OEHasPackage(['dropbear', 'openssh-sshd'])
     def test_ssh(self):
-        for i in range(5):
+        for i in range(10):
           status, output = self.target.run("uname -a", timeout=5)
           if status == 0:
               break
@@ -33,5 +33,5 @@  class SSHTest(OERuntimeTestCase):
               continue
           else:
               self.fail("uname failed with \"%s\" (exit code %s)" % (output, status))
-        if status == 255:
-            self.fail("ssh error %s" %output)
+        if status != 0:
+            self.fail("ssh failed with \"%s\" (exit code %s)" % (output, status))