Commit e392dab2b1 for frr
commit e392dab2b1cdeb0841dff1f969f825a335563a1b
Author: Nageswara Soma <nsoma@cisco.com>
Date: Sun Nov 29 14:28:04 2026 -0800
tests: fix startup route convergence
Wait for expected IPv4 and IPv6 routes before checking
both route tables. This avoids a snapshot while
connected routes are still reaching zebra.
Keep the exact route table checks. If either route set
remains incomplete after 60 seconds, report missing
entries by family.
Signed-off-by: Nageswara Soma <nsoma@cisco.com>
diff --git a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
index f2f8fa313d..2cdd390203 100644
--- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
+++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
@@ -329,8 +329,24 @@ def test_converge_protocols():
print("\n\n** Waiting for protocols convergence")
print("******************************************\n")
- # Not really implemented yet - just sleep 60 secs for now
- sleep(5)
+ expected_route_tables = []
+ for family, reference, get_routes in (
+ ("IPv4", "ipv4_routes.ref", topotest.ip4_route_zebra),
+ ("IPv6", "ipv6_routes.ref", topotest.ip6_route_zebra),
+ ):
+ with open("{}/r1/{}".format(thisDir, reference)) as expected_file:
+ expected_routes = {line.strip() for line in expected_file if line.strip()}
+ expected_route_tables.append((family, expected_routes, get_routes))
+
+ def _routes_installed():
+ missing_routes = []
+ router = get_topogen().gears["r1"]
+ for family, expected_routes, get_routes in expected_route_tables:
+ routes = {line.strip() for line in get_routes(router).splitlines()}
+ missing_routes.extend(
+ "{}: {}".format(family, route) for route in expected_routes - routes
+ )
+ return "\n".join(sorted(missing_routes)) or None
# Make sure that all daemons are running
failures = 0
@@ -338,6 +354,11 @@ def test_converge_protocols():
fatal_error = net["r{}".format(i)].checkRouterRunning()
assert fatal_error == "", fatal_error
+ ok, missing_routes = topotest.run_and_expect(
+ _routes_installed, None, count=60, wait=1
+ )
+ assert ok, "IP routes did not converge:\n{}".format(missing_routes)
+
print("Show that v4 routes are right\n")
v4_routesFile = "{}/r{}/ipv4_routes.ref".format(thisDir, i)
expected = (