From 2610c0783117625019ccfbe94c715fb4e9f05a69 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 13 Jan 2025 15:41:32 +0100 Subject: [PATCH] isis_srv6_topo1: fix ping does not work as expected The ping test does not detect when the command fails. > 2025-01-13 15:38:27,494 INFO: topo: [+] check rt1 fc00:0:9::1 0% packet loss > 2025-01-13 15:38:27,494 WARNING: topo: Waiting time is too small (count=10, wait=1), using default values (count=20, wait=3) > 2025-01-13 15:38:28,501 WARNING: rt1: Router(rt1): proc failed: rc 1 pid 2028454 > args: /usr/bin/nsenter --mount=/proc/2026950/ns/mnt --net=/proc/2026950/ns/net --uts=/proc/2026950/ns/uts -F --wd=/tmp/topotests/isis_srv6_topo1.test_isis_srv6_topo1/rt1 /bin/bash -c ping6 fc00:0:9::1 -c 1 -w 1 > stdout: PING fc00:0:9::1(fc00:0:9::1) 56 data bytes > > --- fc00:0:9::1 ping statistics --- > 1 packets transmitted, 0 received, 100% packet loss, time 0ms > stderr: *empty* > 2025-01-13 15:38:28,501 INFO: topo: PING fc00:0:9::1(fc00:0:9::1) 56 data bytes > > --- fc00:0:9::1 ping statistics --- > 1 packets transmitted, 0 received, 100% packet loss, time 0ms > > > PASSED > The match string is not precise enough. Complete it. Signed-off-by: Philippe Guibert --- tests/topotests/isis_srv6_topo1/test_isis_srv6_topo1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/topotests/isis_srv6_topo1/test_isis_srv6_topo1.py b/tests/topotests/isis_srv6_topo1/test_isis_srv6_topo1.py index 9c1a23f54f..035c60c9a3 100644 --- a/tests/topotests/isis_srv6_topo1/test_isis_srv6_topo1.py +++ b/tests/topotests/isis_srv6_topo1/test_isis_srv6_topo1.py @@ -245,7 +245,7 @@ def check_ping6(name, dest_addr, expect_connected): if match not in output: return "ping fail" - match = "{} packet loss".format("0%" if expect_connected else "100%") + match = "{} packet loss".format(", 0%" if expect_connected else ", 100%") logger.info("[+] check {} {} {}".format(name, dest_addr, match)) tgen = get_topogen() func = functools.partial(_check, name, dest_addr, match)