]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isis_srv6_topo1: fix ping does not work as expected
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 13 Jan 2025 14:41:32 +0000 (15:41 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 22 Jan 2025 16:16:53 +0000 (17:16 +0100)
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 <philippe.guibert@6wind.com>
tests/topotests/isis_srv6_topo1/test_isis_srv6_topo1.py

index 9c1a23f54f42f8ef8d4d835fcfef5703a6edc2c3..035c60c9a3033fccd4bd3762ec9ab2726058f989 100644 (file)
@@ -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)