Commit 7d778e39d7 for frr
commit 7d778e39d70fec3abd0ceec68fe4d0811649616c
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Mon Oct 12 18:54:36 2026 +0200
topotests: check set aigp-metric none in bgp_aigp
Replace "set aigp-metric 100" by "set aigp-metric none" in the outbound
route-map of r6 towards r4, and check that r4 receives 10.0.0.71/32
without the AIGP attribute, while r6 receives it with an AIGP metric
of 71.
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 88218ba35a..8c7618a32d 100644
--- a/tests/topotests/bgp_aigp/test_bgp_aigp.py
+++ b/tests/topotests/bgp_aigp/test_bgp_aigp.py
@@ -38,6 +38,9 @@ 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.
+
+r6 sets aigp-metric none in this route-map, and r4 receives 10.0.0.71/32
+without the AIGP attribute.
"""
import os
@@ -447,6 +450,29 @@ def test_bgp_aigp_outbound_route_map():
assert result is True, result
+def test_bgp_aigp_set_metric_none():
+ 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 none
+ """
+ )
+
+ result = check_aigp_metric(r4, "10.0.0.71/32", None)
+ assert result is True, result
+ result = check_aigp_metric(r6, "10.0.0.71/32", 71)
+ assert result is True, result
+
+
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))