From f076bfa5d613d9a7b466476cf924944692833381 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Tue, 19 Jan 2021 10:26:39 +0100 Subject: [PATCH] Make ping asserts more patient when waiting for expected condition Change-Id: I0bc1bc56bb3169f56356c63b498176291c473cb6 --- tobiko/shell/ping/_assert.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tobiko/shell/ping/_assert.py b/tobiko/shell/ping/_assert.py index 0fd499a80..ff0bbc8d8 100644 --- a/tobiko/shell/ping/_assert.py +++ b/tobiko/shell/ping/_assert.py @@ -25,12 +25,14 @@ LOG = log.getLogger(__name__) def assert_reachable_hosts(hosts, **params): - unreachable_hosts = _ping.list_unreachable_hosts(hosts, **params) + unreachable_hosts = _ping.list_unreachable_hosts( + hosts, until=_ping.RECEIVED, **params) if unreachable_hosts: tobiko.fail("Unable to reach host(s): {!r}", unreachable_hosts) def assert_unreachable_hosts(hosts, **params): - reachable_hosts = _ping.list_reachable_hosts(hosts, **params) + reachable_hosts = _ping.list_reachable_hosts( + hosts, until=_ping.UNRECEIVED, **params) if reachable_hosts: tobiko.fail("Reached host(s): {!r}", reachable_hosts)