summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2023-07-11 17:04:02 +0300
committeraapostoliuk <a.apostoliuk@vyos.io>2023-07-11 17:32:19 +0300
commitcedf7ecfb6048cce1082d234f9d859f955b0c2cd (patch)
treee9d5439e24180965b762416d11e76ccf5af06662 /smoketest/scripts/cli
parent0586941f7bc3bcd55721d7c44164ef7a2de9423d (diff)
downloadvyos-1x-cedf7ecfb6048cce1082d234f9d859f955b0c2cd.tar.gz
vyos-1x-cedf7ecfb6048cce1082d234f9d859f955b0c2cd.zip
bgp: T5338: Added 'protocols bgp interface <int> mpls forwarding' feature
Added 'protocols bgp interface <int> mpls forwarding' feature. It is possible to permit BGP install VPN prefixes without transport labels. This configuration will install VPN prefixes originated from an e-bgp session, and with the next-hop directly connected.
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 2fd5d0c9b..f4801486a 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2021-2022 VyOS maintainers and contributors
+# Copyright (C) 2021-2023 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -18,6 +18,7 @@ import unittest
from base_vyostest_shim import VyOSUnitTestSHIM
+from vyos.ifconfig import Section
from vyos.configsession import ConfigSessionError
from vyos.template import is_ipv6
from vyos.util import process_named_running
@@ -1072,5 +1073,38 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
with self.assertRaises(ConfigSessionError):
self.cli_commit()
+ def test_bgp_22_interface_mpls_forwarding(self):
+ interfaces = Section.interfaces('ethernet')
+ self.cli_set(base_path + ['system-as', ASN])
+ for interface in interfaces:
+ self.cli_set(
+ base_path + ['interface', interface, 'mpls', 'forwarding'])
+ self.cli_commit()
+
+ for interface in interfaces:
+ frrconfig = self.getFRRconfig(f'interface {interface}')
+ self.assertIn(f'interface {interface}', frrconfig)
+ self.assertIn(f' mpls bgp forwarding', frrconfig)
+
+ def test_bgp_23_vrf_interface_mpls_forwarding(self):
+ self.create_bgp_instances_for_import_test()
+ interfaces = Section.interfaces('ethernet')
+ for interface in interfaces:
+ self.cli_set(
+ ['interfaces', 'ethernet', interface, 'vrf', import_vrf])
+ self.cli_set(
+ import_vrf_base + [import_vrf] + base_path + ['interface',
+ interface,
+ 'mpls',
+ 'forwarding'])
+ self.cli_commit()
+
+ for interface in interfaces:
+ frrconfig = self.getFRRconfig(f'interface {interface}')
+ self.assertIn(f'interface {interface}', frrconfig)
+ self.assertIn(f' mpls bgp forwarding', frrconfig)
+ self.cli_delete(['interfaces', 'ethernet', interface, 'vrf'])
+
+
if __name__ == '__main__':
unittest.main(verbosity=2)