From: Mikko Rapeli Date: Wed, 5 Apr 2023 09:08:48 +0000 (+0300) Subject: oeqa ping.py: fail test if target IP address has not been set X-Git-Tag: 2023-04-mickledore~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17c995c53775b8cee279ca4ced916092067e1195;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git 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. Signed-off-by: Mikko Rapeli Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/runtime/cases/ping.py b/meta/lib/oeqa/runtime/cases/ping.py index fcb72d45434..f72460e7f3f 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