summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2021-10-25 13:25:35 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2022-01-26 16:50:11 +0100
commit49656aeb43c1e765d51a0c43fac5a8dcb0cad5b7 (patch)
tree77b3209f7a2d77caebcd3455978226d2f1e6825b
parent80444d30ce310f8255fddec3a43a10df66a8f042 (diff)
topotests: set bgp peer-group with maximum-prefix-out
Set different combinations of bgp peer-group with a maximum-prefix-out value. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
-rw-r--r--tests/topotests/bgp_maximum_prefix_out/test_bgp_maximum_prefix_out.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/topotests/bgp_maximum_prefix_out/test_bgp_maximum_prefix_out.py b/tests/topotests/bgp_maximum_prefix_out/test_bgp_maximum_prefix_out.py
index 78ae2438dd..696d6d94ce 100644
--- a/tests/topotests/bgp_maximum_prefix_out/test_bgp_maximum_prefix_out.py
+++ b/tests/topotests/bgp_maximum_prefix_out/test_bgp_maximum_prefix_out.py
@@ -121,6 +121,48 @@ def test_bgp_maximum_prefix_out():
"router bgp\n address-family ipv4\n no neighbor 192.168.255.1 maximum-prefix-out 1",
8,
),
+ # test setting the existing neighbor into a peer-group with a max-prefix-out value
+ (
+ """
+ router bgp
+ neighbor test peer-group
+ neighbor test remote-as 65002
+ neighbor test timers 3 10
+ address-family ipv4
+ neighbor test maximum-prefix-out 3
+ !
+ neighbor 192.168.255.1 peer-group test
+ """,
+ 3,
+ ),
+ # max-prefix-out value of the neighbor must take the precedence
+ (
+ "router bgp\n address-family ipv4\n neighbor 192.168.255.1 maximum-prefix-out 4",
+ 4,
+ ),
+ (
+ "router bgp\n address-family ipv4\n no neighbor 192.168.255.1 maximum-prefix-out",
+ 3,
+ ),
+ (
+ """
+ router bgp
+ no neighbor 192.168.255.1 peer-group test
+ neighbor 192.168.255.1 remote-as 65002
+ neighbor 192.168.255.1 timers 3 10
+ """,
+ 8,
+ ),
+ (
+ "router bgp\n address-family ipv4\n neighbor 192.168.255.1 maximum-prefix-out 5",
+ 5,
+ ),
+ # test setting the existing neighbor with a max-pref-out value into a peer-group with a max-pref-out value
+ ("router bgp\n neighbor 192.168.255.1 peer-group test", 5),
+ (
+ "router bgp\n address-family ipv4\n no neighbor 192.168.255.1 maximum-prefix-out 5",
+ 3,
+ ),
]
def _bgp_converge(router, nb_prefixes):