summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-04 11:10:38 +0100
committerSteve Sakoman <steve@sakoman.com>2024-08-26 05:18:44 -0700
commitc76964dfe32f94166f465ff4be22d9ab8cd370df (patch)
tree7343a592c0d6f1feea0de86c3e9bfea71235b514
parentdeea7587a0d4d5cd239562e95893e0533f03c1fd (diff)
downloadpoky-c76964dfe32f94166f465ff4be22d9ab8cd370df.tar.gz
oeqa/runtime/ssh: In case of failure, show exit code and handle -15 (SIGTERM)
Ensure we show the failing exit code in case of failures. We're seeing autobuilder failures with -15 (SIGTERM) which is probably from slow boot/init. Retry in these cases for now. (From OE-Core rev: 1bd6b0e29650c34652c1027b6975eb8620a73c55) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 127d3bd8d5509ae17e359c1365859fd362ffc74f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/runtime/cases/ssh.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ssh.py b/meta/lib/oeqa/runtime/cases/ssh.py
index ae92bb34cd..9a8deb3f25 100644
--- a/meta/lib/oeqa/runtime/cases/ssh.py
+++ b/meta/lib/oeqa/runtime/cases/ssh.py
@@ -5,6 +5,7 @@
5# 5#
6 6
7import time 7import time
8import signal
8 9
9from oeqa.runtime.case import OERuntimeTestCase 10from oeqa.runtime.case import OERuntimeTestCase
10from oeqa.core.decorator.depends import OETestDepends 11from oeqa.core.decorator.depends import OETestDepends
@@ -19,16 +20,18 @@ class SSHTest(OERuntimeTestCase):
19 status, output = self.target.run("uname -a", timeout=5) 20 status, output = self.target.run("uname -a", timeout=5)
20 if status == 0: 21 if status == 0:
21 break 22 break
22 elif status == 255: 23 elif status == 255 or status == -signal.SIGTERM:
23 # ssh returns 255 only if a ssh error occurs. This could 24 # ssh returns 255 only if a ssh error occurs. This could
24 # be an issue with "Connection refused" because the port 25 # be an issue with "Connection refused" because the port
25 # isn't open yet, and this could check explicitly for that 26 # isn't open yet, and this could check explicitly for that
26 # here. However, let's keep it simple and just retry for 27 # here. However, let's keep it simple and just retry for
27 # all errors a limited amount of times with a sleep to 28 # all errors a limited amount of times with a sleep to
28 # give it time for the port to open. 29 # give it time for the port to open.
30 # We sometimes see -15 (SIGTERM) on slow emulation machines too, likely
31 # from boot/init not being 100% complete, retry for these too.
29 time.sleep(5) 32 time.sleep(5)
30 continue 33 continue
31 else: 34 else:
32 self.fail("uname failed with \"%s\"" %output) 35 self.fail("uname failed with \"%s\" (exit code %s)" % (output, status))
33 if status == 255: 36 if status == 255:
34 self.fail("ssh error %s" %output) 37 self.fail("ssh error %s" %output)