From 3083993c7165eb3d5755af8290612076b55f7375 Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Wed, 5 Apr 2023 12:08:48 +0300 Subject: 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: 17c995c53775b8cee279ca4ced916092067e1195) Signed-off-by: Mikko Rapeli Signed-off-by: Richard Purdie --- meta/lib/oeqa/runtime/cases/ping.py | 1 + 1 file changed, 1 insertion(+) (limited to 'meta') 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): def test_ping(self): output = '' count = 0 + self.assertNotEqual(len(self.target.ip), 0, msg="No target IP address set") try: while count < 5: cmd = 'ping -c 1 %s' % self.target.ip -- cgit v1.2.3-54-g00ecf