diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2013-09-25 12:30:49 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-26 16:37:55 +0100 |
commit | 41f88ee1dbda44605301dd7309926e04d146ef52 (patch) | |
tree | a7127fdf9b2d4300c388114ae5c1cfe964c4a4d3 /meta/lib/oeqa/runtime/ping.py | |
parent | 141d4f3179d92cfc12ae4622acf415b67ee4a661 (diff) | |
download | poky-41f88ee1dbda44605301dd7309926e04d146ef52.tar.gz |
lib/oeqa/runtime: ping: wait for 5 echo replies
Instead of considering that ping test passed after 1 reply,
wait for at least 5 consecutive replies in 60 seconds (which should
be enough time for connman to reconfigure the interface in systemd
images and help with the fake ssh/tests fails.)
(From OE-Core rev: 6fd19a9df0ad25b2822f12e2c3a97f1b71068d4e)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime/ping.py')
-rw-r--r-- | meta/lib/oeqa/runtime/ping.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/ping.py b/meta/lib/oeqa/runtime/ping.py index e163b969f0..0d028f9b22 100644 --- a/meta/lib/oeqa/runtime/ping.py +++ b/meta/lib/oeqa/runtime/ping.py | |||
@@ -8,10 +8,13 @@ class PingTest(oeRuntimeTest): | |||
8 | 8 | ||
9 | def test_ping(self): | 9 | def test_ping(self): |
10 | output = '' | 10 | output = '' |
11 | status = None | 11 | count = 0 |
12 | endtime = time.time() + 60 | 12 | endtime = time.time() + 60 |
13 | while status != 0 and time.time() < endtime: | 13 | while count < 5 and time.time() < endtime: |
14 | proc = subprocess.Popen("ping -c 1 %s" % oeRuntimeTest.tc.qemu.ip, shell=True, stdout=subprocess.PIPE) | 14 | proc = subprocess.Popen("ping -c 1 %s" % oeRuntimeTest.tc.qemu.ip, shell=True, stdout=subprocess.PIPE) |
15 | output += proc.communicate()[0] | 15 | output += proc.communicate()[0] |
16 | status = proc.poll() | 16 | if proc.poll() == 0: |
17 | self.assertEqual(status, 0, msg = "No echo reply, ping output is:\n%s" % output) | 17 | count += 1 |
18 | else: | ||
19 | count = 0 | ||
20 | self.assertEqual(count, 5, msg = "Expected 5 consecutive replies, got %d.\nping output is:\n%s" % (count,output)) | ||