summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_protocols_bgp.py
diff options
context:
space:
mode:
Diffstat (limited to 'smoketest/scripts/cli/test_protocols_bgp.py')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 8d42fafc3..f22b47551 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -131,6 +131,9 @@ peer_group_config = {
def getFRRBGPconfig():
return cmd(f'vtysh -c "show run" | sed -n "/^router bgp {ASN}/,/^!/p"')
+def getFRRBgpAfiConfig(afi):
+ return cmd(f'vtysh -c "show run" | sed -n "/^router bgp {ASN}/,/^!/p" | sed -n "/^ address-family {afi} unicast/,/^ exit-address-family/p"')
+
def getFRRBGPVNIconfig(vni):
return cmd(f'vtysh -c "show run" | sed -n "/^ vni {vni}/,/^!/p"')
@@ -218,6 +221,10 @@ class TestProtocolsBGP(unittest.TestCase):
router_id = '127.0.0.1'
local_pref = '500'
stalepath_time = '60'
+ max_path_v4 = '2'
+ max_path_v4ibgp = '4'
+ max_path_v6 = '8'
+ max_path_v6ibgp = '16'
self.session.set(base_path + ['parameters', 'router-id', router_id])
self.session.set(base_path + ['parameters', 'log-neighbor-changes'])
@@ -229,6 +236,12 @@ class TestProtocolsBGP(unittest.TestCase):
self.session.set(base_path + ['parameters', 'graceful-shutdown'])
self.session.set(base_path + ['parameters', 'ebgp-requires-policy'])
+ # AFI maximum path support
+ self.session.set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths', max_path_v4])
+ self.session.set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths-ibgp', max_path_v4ibgp])
+ self.session.set(base_path + ['address-family', 'ipv6-unicast', 'maximum-paths', max_path_v6])
+ self.session.set(base_path + ['address-family', 'ipv6-unicast', 'maximum-paths-ibgp', max_path_v6ibgp])
+
# commit changes
self.session.commit()
@@ -243,6 +256,14 @@ class TestProtocolsBGP(unittest.TestCase):
self.assertIn(f' bgp graceful-shutdown', frrconfig)
self.assertNotIn(f'bgp ebgp-requires-policy', frrconfig)
+ afiv4_config = getFRRBgpAfiConfig('ipv4')
+ self.assertIn(f' maximum-paths {max_path_v4}', afiv4_config)
+ self.assertIn(f' maximum-paths ibgp {max_path_v4ibgp}', afiv4_config)
+
+ afiv6_config = getFRRBgpAfiConfig('ipv6')
+ self.assertIn(f' maximum-paths {max_path_v6}', afiv6_config)
+ self.assertIn(f' maximum-paths ibgp {max_path_v6ibgp}', afiv6_config)
+
def test_bgp_02_neighbors(self):
# Test out individual neighbor configuration items, not all of them are