summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/ssh.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/ssh.py')
-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)