summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/ping.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/ping.py')
-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 @@
1import subprocess 1import subprocess
2import unittest 2import unittest
3import sys 3import sys
4import time
4from oeqa.oetest import oeRuntimeTest 5from oeqa.oetest import oeRuntimeTest
5 6
6class PingTest(oeRuntimeTest): 7class PingTest(oeRuntimeTest):
7 8
8 def test_ping(self): 9 def test_ping(self):
9 status = subprocess.call("ping -w 30 -c 1 %s" % oeRuntimeTest.tc.qemu.ip, shell=True, stdout=subprocess.PIPE) 10 output = ''
10 self.assertEqual(status, 0) 11 status = None
11 12 endtime = time.time() + 30
13 while status != 0 and time.time() < endtime:
14 proc = subprocess.Popen("ping -c 1 %s" % oeRuntimeTest.tc.qemu.ip, shell=True, stdout=subprocess.PIPE)
15 output += proc.communicate()[0]
16 status = proc.poll()
17 self.assertEqual(status, 0, msg = "No echo reply, ping output is:\n%s" % output)