diff options
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/ping.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ping.py b/meta/lib/oeqa/runtime/cases/ping.py index f72460e7f3..bc543f6c41 100644 --- a/meta/lib/oeqa/runtime/cases/ping.py +++ b/meta/lib/oeqa/runtime/cases/ping.py | |||
| @@ -18,6 +18,13 @@ class PingTest(OERuntimeTestCase): | |||
| 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 | self.assertNotEqual(len(self.target.ip), 0, msg="No target IP address set") |
| 21 | |||
| 22 | # If the target IP is localhost (because user-space networking is being used), | ||
| 23 | # then there's no point in pinging it. | ||
| 24 | if self.target.ip.startswith("127.0.0.") or self.target.ip in ("localhost", "::1"): | ||
| 25 | print("runtime/ping: localhost detected, not pinging") | ||
| 26 | return | ||
| 27 | |||
| 21 | try: | 28 | try: |
| 22 | while count < 5: | 29 | while count < 5: |
| 23 | cmd = 'ping -c 1 %s' % self.target.ip | 30 | cmd = 'ping -c 1 %s' % self.target.ip |
