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.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 0ed66657c..c3a2ffbf9 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -224,6 +224,10 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.cli_set(base_path + ['parameters', 'graceful-shutdown'])
self.cli_set(base_path + ['parameters', 'ebgp-requires-policy'])
+ self.cli_set(base_path + ['parameters', 'bestpath', 'as-path', 'multipath-relax'])
+ self.cli_set(base_path + ['parameters', 'bestpath', 'bandwidth', 'default-weight-for-missing'])
+ self.cli_set(base_path + ['parameters', 'bestpath', 'compare-routerid'])
+
# AFI maximum path support
self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths', 'ebgp', max_path_v4])
self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths', 'ibgp', max_path_v4ibgp])
@@ -242,6 +246,9 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' no bgp default ipv4-unicast', frrconfig)
self.assertIn(f' bgp graceful-restart stalepath-time {stalepath_time}', frrconfig)
self.assertIn(f' bgp graceful-shutdown', frrconfig)
+ self.assertIn(f' bgp bestpath as-path multipath-relax', frrconfig)
+ self.assertIn(f' bgp bestpath bandwidth default-weight-for-missing', frrconfig)
+ self.assertIn(f' bgp bestpath compare-routerid', frrconfig)
self.assertNotIn(f'bgp ebgp-requires-policy', frrconfig)
afiv4_config = self.getFRRconfig(' address-family ipv4 unicast')
@@ -611,6 +618,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f'{family}', frrconfig)
self.assertIn(f'local-install {flowspec_int}', frrconfig)
+
def test_bgp_10_vrf_simple(self):
router_id = '127.0.0.3'
vrfs = ['red', 'green', 'blue']
@@ -644,5 +652,63 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
# zebra_route_map = f' ip protocol bgp route-map {route_map_in}'
# self.assertIn(zebra_route_map, vrfconfig)
+
+ def test_bgp_11_confederation(self):
+ router_id = '127.10.10.2'
+ confed_id = str(int(ASN) + 1)
+ confed_asns = '10 20 30 40'
+
+ self.cli_set(base_path + ['local-as', ASN])
+ self.cli_set(base_path + ['parameters', 'router-id', router_id])
+ self.cli_set(base_path + ['parameters', 'confederation', 'identifier', confed_id])
+ for asn in confed_asns.split():
+ self.cli_set(base_path + ['parameters', 'confederation', 'peers', asn])
+
+ # commit changes
+ self.cli_commit()
+
+ # Verify FRR bgpd configuration
+ frrconfig = self.getFRRconfig(f'router bgp {ASN}')
+ self.assertIn(f'router bgp {ASN}', frrconfig)
+ self.assertIn(f' bgp router-id {router_id}', frrconfig)
+ self.assertIn(f' bgp confederation identifier {confed_id}', frrconfig)
+ self.assertIn(f' bgp confederation peers {confed_asns}', frrconfig)
+
+
+ def test_bgp_12_v6_link_local(self):
+ remote_asn = str(int(ASN) + 10)
+ interface = 'eth0'
+
+ self.cli_set(base_path + ['local-as', ASN])
+ self.cli_set(base_path + ['neighbor', interface, 'address-family', 'ipv6-unicast'])
+ self.cli_set(base_path + ['neighbor', interface, 'interface', 'v6only', 'remote-as', remote_asn])
+
+ # commit changes
+ self.cli_commit()
+
+ # Verify FRR bgpd configuration
+ frrconfig = self.getFRRconfig(f'router bgp {ASN}')
+ self.assertIn(f'router bgp {ASN}', frrconfig)
+ self.assertIn(f' neighbor {interface} interface v6only remote-as {remote_asn}', frrconfig)
+ self.assertIn(f' address-family ipv6 unicast', frrconfig)
+ self.assertIn(f' neighbor {interface} activate', frrconfig)
+ self.assertIn(f' exit-address-family', frrconfig)
+
+ def test_bgp_13_solo(self):
+ remote_asn = str(int(ASN) + 150)
+ neighbor = '192.0.2.55'
+
+ self.cli_set(base_path + ['local-as', ASN])
+ self.cli_set(base_path + ['neighbor', neighbor, 'remote-as', remote_asn])
+ self.cli_set(base_path + ['neighbor', neighbor, 'solo'])
+
+ # commit changes
+ self.cli_commit()
+
+ # Verify FRR bgpd configuration
+ frrconfig = self.getFRRconfig(f'router bgp {ASN}')
+ self.assertIn(f'router bgp {ASN}', frrconfig)
+ self.assertIn(f' neighbor {neighbor} solo', frrconfig)
+
if __name__ == '__main__':
unittest.main(verbosity=2) \ No newline at end of file