summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/ping.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/ping.py b/meta/lib/oeqa/runtime/ping.py
index d6a0c28628..935f638891 100644
--- a/meta/lib/oeqa/runtime/ping.py
+++ b/meta/lib/oeqa/runtime/ping.py
@@ -1,11 +1,17 @@
import subprocess
import unittest
import sys
+import time
from oeqa.oetest import oeRuntimeTest
class PingTest(oeRuntimeTest):
def test_ping(self):
- status = subprocess.call("ping -w 30 -c 1 %s" % oeRuntimeTest.tc.qemu.ip, shell=True, stdout=subprocess.PIPE)
- self.assertEqual(status, 0)
-
+ output = ''
+ status = None
+ endtime = time.time() + 30
+ while status != 0 and time.time() < endtime:
+ proc = subprocess.Popen("ping -c 1 %s" % oeRuntimeTest.tc.qemu.ip, shell=True, stdout=subprocess.PIPE)
+ output += proc.communicate()[0]
+ status = proc.poll()
+ self.assertEqual(status, 0, msg = "No echo reply, ping output is:\n%s" % output)