Commit d304add1cd for frr
commit d304add1cda3447fb7110fc22059339c915268de
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Mon Oct 12 14:19:49 2026 +0200
topotests: check aigp with a peer-group in bgp_oad
No test configures "neighbor PEER aigp" on a peer-group. The inheritance
of the aigp flag by the peer-group members is not checked, nor the case
of two members of the same peer-group with a different aigp flag, while
PEER_FLAG_AIGP is part of PEER_UPDGRP_FLAGS and splits the update-groups.
On a peer-group member, "no neighbor MEMBER aigp" does not unset the
flag: peer_flag_modify() inherits it again from the peer-group. To get
two members with a different flag, the flag must be removed from the
peer-group and set explicitly on one member.
Fix this by moving the two OAD sessions of r2 into a peer-group that
carries the aigp flag. To stop advertising AIGP to r1, configure "neighbor
192.168.2.3 aigp" on the r3 member, then remove the flag from the
peer-group. r2 still receives AIGP from r3, and r1 no longer receives it.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/tests/topotests/bgp_oad/r2/frr.conf b/tests/topotests/bgp_oad/r2/frr.conf
index 67f29501af..59f8eb833c 100644
--- a/tests/topotests/bgp_oad/r2/frr.conf
+++ b/tests/topotests/bgp_oad/r2/frr.conf
@@ -7,14 +7,13 @@ int r2-eth1
!
router bgp 65002
no bgp ebgp-requires-policy
- neighbor 192.168.1.1 remote-as external
- neighbor 192.168.1.1 timers 1 3
- neighbor 192.168.1.1 timers connect 1
+ neighbor PG peer-group
+ neighbor PG remote-as external
+ neighbor PG timers 1 3
+ neighbor PG timers connect 1
+ neighbor PG aigp
+ neighbor 192.168.1.1 peer-group PG
neighbor 192.168.1.1 oad
- neighbor 192.168.1.1 aigp
- neighbor 192.168.2.3 remote-as external
- neighbor 192.168.2.3 timers 1 3
- neighbor 192.168.2.3 timers connect 1
+ neighbor 192.168.2.3 peer-group PG
neighbor 192.168.2.3 oad
- neighbor 192.168.2.3 aigp
!
diff --git a/tests/topotests/bgp_oad/test_bgp_oad.py b/tests/topotests/bgp_oad/test_bgp_oad.py
index 5f581b5649..606fb4885b 100644
--- a/tests/topotests/bgp_oad/test_bgp_oad.py
+++ b/tests/topotests/bgp_oad/test_bgp_oad.py
@@ -17,10 +17,12 @@ across EBGP-OAD sessions (r3 -> r2 -> r1) when explicitly enabled with
Per draft-uttaro-idr-bgp-oad section 3.20 the default value of AIGP_SESSION
is "disabled" for EBGP-OAD sessions, hence "neighbor PEER aigp" is configured
-on both ends of each OAD session (r3<->r2, r2<->r1).
+on both ends of each OAD session (r3<->r2, r2<->r1). On r2, both sessions
+inherit it from a peer-group.
Finally, check that AIGP is NOT propagated over an EBGP-OAD session once
-"neighbor PEER aigp" is removed, confirming the default is "disabled".
+"neighbor PEER aigp" is removed, confirming the default is "disabled". On
+r2, it is removed from the peer-group, and kept on the r3 member only.
"""
import os
@@ -203,12 +205,15 @@ def test_bgp_oad():
# an EBGP-OAD session (draft-uttaro-idr-bgp-oad section 3.20). Disable AIGP
# on the r2 -> r1 OAD session only: r2 still learns the AIGP metric from r3
# (that session keeps "neighbor aigp"), but r2 must no longer advertise it
- # to r1.
+ # to r1. Both sessions are members of the same peer-group: AIGP is removed
+ # from the peer-group, and configured on the r3 member, so that the two
+ # members have a different aigp flag.
r2.vtysh_cmd(
"""
configure terminal
router bgp 65002
- no neighbor 192.168.1.1 aigp
+ neighbor 192.168.2.3 aigp
+ no neighbor PG aigp
"""
)