]> 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)
committerSteve Sakoman <steve@sakoman.com>
Mon, 24 Apr 2023 14:22:14 +0000 (04:22 -1000)
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>
(cherry picked from commit 17c995c53775b8cee279ca4ced916092067e1195)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
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