Commit 583358f30f for frr
commit 583358f30f6f9217e7d4091e3b9b4a29ab33eb11
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Mon Oct 12 14:18:21 2026 +0200
topotests: check aigp commands in running-config in bgp_aigp
No test checks how "neighbor PEER aigp", "bgp bestpath aigp" and
"set aigp-metric" are displayed in "show running-config".
These commands are displayed by bgp_config_write_peer_global(),
bgp_config_write() and route_map_action_show().
Fix this by checking the running configuration of r1 and 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 f214c20da3..fa0de875c6 100644
--- a/tests/topotests/bgp_aigp/test_bgp_aigp.py
+++ b/tests/topotests/bgp_aigp/test_bgp_aigp.py
@@ -27,6 +27,9 @@ peer1 and peer2 are eBGP peers of r7, and both advertise a prefix with
the AIGP attribute. r7 accepts it from peer1 ("neighbor PEER aigp"),
and ignores it from peer2.
+The AIGP commands are displayed in the running configuration of r1
+and r7.
+
r7 sets aigp-metric 0 for 10.0.0.72/32, and r6 receives the AIGP
attribute with a metric of 0.
@@ -354,6 +357,30 @@ def test_bgp_aigp_ebgp_peer():
assert result is True, result
+def test_bgp_aigp_running_config():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ r1 = tgen.gears["r1"]
+ r7 = tgen.gears["r7"]
+
+ output = r1.vtysh_cmd("show running-config")
+ assert " bgp bestpath aigp\n" in output, "r1, bgp bestpath aigp not displayed"
+
+ output = r7.vtysh_cmd("show running-config")
+ for line in (
+ " neighbor 192.168.7.101 aigp\n",
+ " set aigp-metric igp-metric\n",
+ " set aigp-metric 72\n",
+ ):
+ assert line in output, "r7, {} not displayed".format(line.strip())
+ assert (
+ " neighbor 192.168.7.102 aigp\n" not in output
+ ), "r7, neighbor 192.168.7.102 aigp displayed"
+
+
def test_bgp_aigp_metric_zero():
tgen = get_topogen()