blob: 935f638891280c88ebc1dbe0e6b6140197733850 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import subprocess
import unittest
import sys
import time
from oeqa.oetest import oeRuntimeTest
class PingTest(oeRuntimeTest):
def test_ping(self):
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)
|