Commit 90ee543961 for frr
commit 90ee543961d366ba16a4a6beaced7276b1e2eb96
Author: Harini Nattamai Subramanian <hnattamaisub@nvidia.com>
Date: Fri Oct 23 03:20:42 2026 -0700
tests: Added on testcase in existing topo
Simulated the issue scenario using topotest and validated the fix
Signed-off-by: Harini Nattamai Subramanian <hnattamaisub@nvidia.com>
diff --git a/tests/topotests/bgp_prefix_list_any/r1/bgpd.conf b/tests/topotests/bgp_prefix_list_any/r1/bgpd.conf
index 593442a42a..67ac619bd1 100644
--- a/tests/topotests/bgp_prefix_list_any/r1/bgpd.conf
+++ b/tests/topotests/bgp_prefix_list_any/r1/bgpd.conf
@@ -14,6 +14,8 @@ router bgp 65001
exit-address-family
address-family ipv6 unicast
neighbor 2001:db8:1::2 activate
+ neighbor 2001:db8:1::2 soft-reconfiguration inbound
+ neighbor 2001:db8:1::2 prefix-list test-inbound in
network 2001:db8::1/128
exit-address-family
!
diff --git a/tests/topotests/bgp_prefix_list_any/test_bgp_prefix_list_any.py b/tests/topotests/bgp_prefix_list_any/test_bgp_prefix_list_any.py
index 1871d3efc8..fc40ddfdac 100644
--- a/tests/topotests/bgp_prefix_list_any/test_bgp_prefix_list_any.py
+++ b/tests/topotests/bgp_prefix_list_any/test_bgp_prefix_list_any.py
@@ -98,6 +98,61 @@ def test_bgp_route_map_prefix_list():
assert result is None, "More or less prefixes advertised to r1, MUST be 4"
+def test_prefix_list_created_after_inbound_binding():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ r1 = tgen.gears["r1"]
+ r2 = tgen.gears["r2"]
+ prefix = "2001:db8:10::1/128"
+
+ def _route_present(router, expected):
+ output = json.loads(
+ router.vtysh_cmd("show bgp ipv6 unicast {} json".format(prefix))
+ )
+ present = bool(output.get("paths"))
+ if present != expected:
+ return "Expected route presence {}, got {}: {}".format(
+ expected, present, output
+ )
+ return None
+
+ def _route_advertised():
+ output = json.loads(
+ r2.vtysh_cmd(
+ "show bgp ipv6 unicast neighbor 2001:db8:1::1 advertised-routes json"
+ )
+ )
+ if prefix not in output.get("advertisedRoutes", {}):
+ return "r2 is not advertising {} to r1: {}".format(prefix, output)
+ return None
+
+ test_func = functools.partial(_route_present, r2, True)
+ _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+ assert result is None, "Baseline IPv6 route was not originated by r2"
+
+ _, result = topotest.run_and_expect(_route_advertised, None, count=60, wait=0.5)
+ assert result is None, "Baseline IPv6 route was not advertised to r1"
+
+ test_func = functools.partial(_route_present, r1, False)
+ _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5)
+ assert result is None, "Route should be filtered while test-inbound is undefined"
+
+ r1.vtysh_cmd(
+ """
+ configure terminal
+ ipv6 prefix-list test-inbound seq 10 permit 2001:db8:10::1/128
+ end
+ """
+ )
+
+ test_func = functools.partial(_route_present, r1, True)
+ _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+ assert result is None, "Route was not re-evaluated after creating test-inbound"
+
+
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))