diff options
author | Mikko Rapeli <mikko.rapeli@linaro.org> | 2023-04-05 12:08:31 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-06 14:31:42 +0100 |
commit | 5ecafc3fec307e1db704b23790c63dffe6b1476a (patch) | |
tree | 80adb8fb41c9ec1c9dc74a84ca6bad50b0806980 /meta/lib/oeqa/runtime | |
parent | df736bbb5112b5c233012a6f5573e269ce76ae9c (diff) | |
download | poky-5ecafc3fec307e1db704b23790c63dffe6b1476a.tar.gz |
oeqa ping.py: avoid busylooping failing ping command
Use a sleep on error path before trying again. For example
when oeqa runtime tests are executed without setting target
IP address correctly, the tests are drowning logs with messages:
2023-04-04 07:19:24,985 - runtime - INFO - test_ping (ping.PingTest.test_ping)
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
ping: usage error: Destination address required
...
2023-04-04 07:19:55,002 - runtime - INFO - ... FAIL
2023-04-04 07:19:55,002 - runtime - INFO - Traceback (most recent call
last):
File \"/lava-62618/3/tests/3_oeqa-runtime-tests/image/lib/oeqa/runtime/cases/ping.py\", line 23, in test_ping
output += proc.communicate()[0].decode('utf-8')
^^^^^^^^^^^^^^^^^^
File \"/usr/lib/python3.11/subprocess.py\", line 1194, in communicate
stdout = self.stdout.read()
^^^^^^^^^^^^^^^^^^
File \"/lava-62618/3/tests/3_oeqa-runtime-tests/image/lib/oeqa/core/decorator/oetimeout.py\", line 18, in _timeoutHandler
raise OEQATimeoutError(\"Timed out after %s \"
oeqa.core.exception.OEQATimeoutError: Timed out after 30 seconds of execution
(From OE-Core rev: 87ec75710b5cd7b3f35d886003844d62d3182b54)
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/ping.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ping.py b/meta/lib/oeqa/runtime/cases/ping.py index 967b44175f..fcb72d4543 100644 --- a/meta/lib/oeqa/runtime/cases/ping.py +++ b/meta/lib/oeqa/runtime/cases/ping.py | |||
@@ -5,6 +5,7 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | from subprocess import Popen, PIPE | 7 | from subprocess import Popen, PIPE |
8 | from time import sleep | ||
8 | 9 | ||
9 | from oeqa.runtime.case import OERuntimeTestCase | 10 | from oeqa.runtime.case import OERuntimeTestCase |
10 | from oeqa.core.decorator.oetimeout import OETimeout | 11 | from oeqa.core.decorator.oetimeout import OETimeout |
@@ -25,6 +26,7 @@ class PingTest(OERuntimeTestCase): | |||
25 | count += 1 | 26 | count += 1 |
26 | else: | 27 | else: |
27 | count = 0 | 28 | count = 0 |
29 | sleep(1) | ||
28 | except OEQATimeoutError: | 30 | except OEQATimeoutError: |
29 | self.fail("Ping timeout error for address %s, count %s, output: %s" % (self.target.ip, count, output)) | 31 | self.fail("Ping timeout error for address %s, count %s, output: %s" % (self.target.ip, count, output)) |
30 | msg = ('Expected 5 consecutive, got %d.\n' | 32 | msg = ('Expected 5 consecutive, got %d.\n' |