Commit 5cb4d6ee5e for frr
commit 5cb4d6ee5e18626f4f45e06a3c0ec9e9f7124c37
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Mon Oct 12 14:17:51 2026 +0200
topotests: check no set aigp-metric in bgp_aigp
No test checks that removing "set aigp-metric" from a route-map stops
the advertisement of the AIGP attribute.
Unlike "set aigp-metric 0", which sets the AIGP attribute with a metric
of 0, "no set aigp-metric" removes the set action, and the redistributed
route no longer carries the AIGP attribute.
Fix this by removing the aigp-metric set action that r7 applies to
10.0.0.72/32, and by checking that r6 receives this prefix without the
AIGP attribute.
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 2248d2de4b..f214c20da3 100644
--- a/tests/topotests/bgp_aigp/test_bgp_aigp.py
+++ b/tests/topotests/bgp_aigp/test_bgp_aigp.py
@@ -29,6 +29,9 @@ and ignores it from peer2.
r7 sets aigp-metric 0 for 10.0.0.72/32, and r6 receives the AIGP
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.
"""
import os
@@ -372,6 +375,27 @@ def test_bgp_aigp_metric_zero():
assert result is True, result
+def test_bgp_aigp_no_set_metric():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ r6 = tgen.gears["r6"]
+ r7 = tgen.gears["r7"]
+
+ r7.vtysh_cmd(
+ """
+ configure terminal
+ route-map rmap permit 20
+ no set aigp-metric
+ """
+ )
+
+ result = check_aigp_metric(r6, "10.0.0.72/32", None)
+ assert result is True, result
+
+
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))