]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa ping.py: fail test if target IP address has not been set
authorMikko Rapeli <mikko.rapeli@linaro.org>
Wed, 5 Apr 2023 09:08:48 +0000 (12:08 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Apr 2023 13:31:37 +0000 (14:31 +0100)
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 <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/ping.py

index fcb72d454344c016600d474816b5db0c9d32c44b..f72460e7f3f8a45bb46e855bfef926e6bd314c5e 100644 (file)
@@ -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