mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 06:34:44 +00:00
tests: Actually loop if ping fails
The usage of run_and_expect doesn't work if the function being called as the run part asserts. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
147c7a2de3
commit
22c10bbdaa
@ -98,7 +98,8 @@ def check_ping4(name, dest_addr, expect_connected):
|
||||
tgen = get_topogen()
|
||||
output = tgen.gears[name].run("ping {} -c 1 -w 1".format(dest_addr))
|
||||
logger.info(output)
|
||||
assert match in output, "ping fail"
|
||||
if match not in output:
|
||||
return "ping fail"
|
||||
|
||||
match = ", {} packet loss".format("0%" if expect_connected else "100%")
|
||||
logger.info("[+] check {} {} {}".format(name, dest_addr, match))
|
||||
|
Loading…
Reference in New Issue
Block a user