Commit 59420aec50 for frr
commit 59420aec5006776baa0a3942b18ea2391017762f
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Mon Oct 12 16:11:55 2026 +0200
topotests: check aigp set by an outbound route-map in bgp_aigp
Add "set aigp-metric 100" to the outbound route-map of r6 towards r4,
which also sets the nexthop to the peer address, and check that r4
receives 10.0.0.71/32 with an AIGP metric of 100.
Without the previous commit, r4 receives the AIGP metric set by r7.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/tests/topotests/bgp_aigp/test_bgp_aigp.py b/tests/topotests/bgp_aigp/test_bgp_aigp.py
index fa0de875c6..88218ba35a 100644
--- a/tests/topotests/bgp_aigp/test_bgp_aigp.py
+++ b/tests/topotests/bgp_aigp/test_bgp_aigp.py
@@ -35,6 +35,9 @@ attribute with a metric of 0.
r7 removes the aigp-metric action for 10.0.0.72/32, and r6 receives it
without the AIGP attribute.
+
+r6 sets aigp-metric 100 in the outbound route-map that changes the
+nexthop towards r4, and r4 receives 10.0.0.71/32 with this AIGP metric.
"""
import os
@@ -423,6 +426,27 @@ def test_bgp_aigp_no_set_metric():
assert result is True, result
+def test_bgp_aigp_outbound_route_map():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ r4 = tgen.gears["r4"]
+ r6 = tgen.gears["r6"]
+
+ r6.vtysh_cmd(
+ """
+ configure terminal
+ route-map set-nexthop permit 10
+ set aigp-metric 100
+ """
+ )
+
+ result = check_aigp_metric(r4, "10.0.0.71/32", 100)
+ assert result is True, result
+
+
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))