mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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: 127d3bd8d5509ae17e359c1365859fd362ffc74f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
import signal
|
||||||
|
|
||||||
from oeqa.runtime.case import OERuntimeTestCase
|
from oeqa.runtime.case import OERuntimeTestCase
|
||||||
from oeqa.core.decorator.depends import OETestDepends
|
from oeqa.core.decorator.depends import OETestDepends
|
||||||
@@ -19,16 +20,18 @@ class SSHTest(OERuntimeTestCase):
|
|||||||
status, output = self.target.run("uname -a", timeout=5)
|
status, output = self.target.run("uname -a", timeout=5)
|
||||||
if status == 0:
|
if status == 0:
|
||||||
break
|
break
|
||||||
elif status == 255:
|
elif status == 255 or status == -signal.SIGTERM:
|
||||||
# ssh returns 255 only if a ssh error occurs. This could
|
# ssh returns 255 only if a ssh error occurs. This could
|
||||||
# be an issue with "Connection refused" because the port
|
# be an issue with "Connection refused" because the port
|
||||||
# isn't open yet, and this could check explicitly for that
|
# isn't open yet, and this could check explicitly for that
|
||||||
# here. However, let's keep it simple and just retry for
|
# here. However, let's keep it simple and just retry for
|
||||||
# all errors a limited amount of times with a sleep to
|
# all errors a limited amount of times with a sleep to
|
||||||
# give it time for the port to open.
|
# give it time for the port to open.
|
||||||
|
# We sometimes see -15 (SIGTERM) on slow emulation machines too, likely
|
||||||
|
# from boot/init not being 100% complete, retry for these too.
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
self.fail("uname failed with \"%s\"" %output)
|
self.fail("uname failed with \"%s\" (exit code %s)" % (output, status))
|
||||||
if status == 255:
|
if status == 255:
|
||||||
self.fail("ssh error %s" %output)
|
self.fail("ssh error %s" %output)
|
||||||
|
|||||||
Reference in New Issue
Block a user