summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-12 19:56:51 +0200
committerGitHub <noreply@github.com>2023-07-12 19:56:51 +0200
commit64360db360a36f45083a1ff6a5d5245e192ab165 (patch)
treed7e9e56425db51d06ed5f52880c8690fffd422b9 /smoketest
parent45e39efb3955a1fff5340685674ce3c0fb6592cc (diff)
parentcedf7ecfb6048cce1082d234f9d859f955b0c2cd (diff)
downloadvyos-1x-64360db360a36f45083a1ff6a5d5245e192ab165.tar.gz
vyos-1x-64360db360a36f45083a1ff6a5d5245e192ab165.zip
Merge pull request #2085 from aapostoliuk/T5338-sagitta
bgp: T5338: Added 'protocols bgp interface <int> mpls forwarding' feature
Diffstat (limited to 'smoketest')
-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)