Commit a4b51c664c for frr
commit a4b51c664cf9008a6541015fc00312a19caa9031
Author: Louis Scalbert <louis.scalbert@6wind.com>
Date: Wed Nov 4 14:29:53 2026 +0100
tests: nhrp_redundancy, fix the local entry neighbor request check
test_local_map_neighbor fails on CI:
> ERROR: topo: '_local_neighbor_failed' failed after 40.31 seconds
> ERROR: topo: test failed at "test_nhrp_redundancy/test_local_map_neighbor": nhc1: no neighbor request for 172.16.1.99
The test waits for the FAILED state of the neighbor entry, right after a
ping. But each ping moves the entry from FAILED back to INCOMPLETE, so
the state found depends on the timing:
> 172.16.1.99 ref 1 used 1/11/1probes 1 INCOMPLETE
> 172.16.1.99 ref 1 used 1/13/1probes 1 INCOMPLETE
> 172.16.1.99 ref 1 used 1/15/1probes 1 INCOMPLETE
> 172.16.1.99 used 1/17/0probes 1 FAILED
Wait for the probe counter instead.
Fixes: b3c50326bf ("tests: nhrp_redundancy, check a local entry neighbor request")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
diff --git a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py
index 77d511803b..37bf3fde04 100644
--- a/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py
+++ b/tests/topotests/nhrp_redundancy/test_nhrp_redundancy.py
@@ -354,13 +354,13 @@ def test_local_map_neighbor():
logger.info("nhc1: send traffic to 172.16.1.99 through nhc1-gre0")
nhc1.cmd("ip route add 172.16.1.99/32 dev nhc1-gre0")
- def _local_neighbor_failed():
+ def _local_neighbor_probed():
nhc1.cmd("ping -c 1 -W 1 172.16.1.99")
- output = nhc1.cmd("ip neigh show 172.16.1.99 dev nhc1-gre0")
- return "FAILED" in output
+ output = nhc1.cmd("ip -s neigh show 172.16.1.99 dev nhc1-gre0")
+ return re.search(r"probes [1-9]", output) is not None
- # FAILED means that the kernel has asked nhrpd and got no answer
- _, result = topotest.run_and_expect(_local_neighbor_failed, True, count=20, wait=1)
+ # Check that the kernel has sent unawswered probes
+ _, result = topotest.run_and_expect(_local_neighbor_probed, True, count=20, wait=1)
assert result is True, "nhc1: no neighbor request for 172.16.1.99"
assert nhc1.check_router_running() == "", "nhc1: a daemon died"