summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-04-05 12:08:48 +0300
committerSteve Sakoman <steve@sakoman.com>2023-04-28 04:01:15 -1000
commitaa45ff43fc2fb8632932fcb83564702d187117e7 (patch)
tree45754033d33f8228bdc0cb6c2a22f5c0e937abc7
parent99213e4254739c7d49533c02e6c71236e77e902d (diff)
downloadpoky-aa45ff43fc2fb8632932fcb83564702d187117e7.tar.gz
oeqa ping.py: fail test if target IP address has not been set
It is possible to call exported tests with --target-ip set to ":22" where IP address is not set at all. Detect this case and fail the test instead of calling ping without an IP address. (From OE-Core rev: b14b8f38da9195852e9a2fd6b2e446ed8a1fa0b8) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 17c995c53775b8cee279ca4ced916092067e1195) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/runtime/cases/ping.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ping.py b/meta/lib/oeqa/runtime/cases/ping.py
index fcb72d4543..f72460e7f3 100644
--- a/meta/lib/oeqa/runtime/cases/ping.py
+++ b/meta/lib/oeqa/runtime/cases/ping.py
@@ -17,6 +17,7 @@ class PingTest(OERuntimeTestCase):
17 def test_ping(self): 17 def test_ping(self):
18 output = '' 18 output = ''
19 count = 0 19 count = 0
20 self.assertNotEqual(len(self.target.ip), 0, msg="No target IP address set")
20 try: 21 try:
21 while count < 5: 22 while count < 5:
22 cmd = 'ping -c 1 %s' % self.target.ip 23 cmd = 'ping -c 1 %s' % self.target.ip