summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_vxlan.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-12-10 20:54:44 +0100
committerChristian Poessinger <christian@poessinger.com>2021-12-10 20:54:44 +0100
commiteb29d8d5a0bc536364b4024ec6c336451b58ba49 (patch)
treec612679baeb683372b765a975a85f5d0ecccf43f /smoketest/scripts/cli/test_interfaces_vxlan.py
parent4948380a588dea59a01e6e33b9b8e1524ba6a4ed (diff)
downloadvyos-1x-eb29d8d5a0bc536364b4024ec6c336451b58ba49.tar.gz
vyos-1x-eb29d8d5a0bc536364b4024ec6c336451b58ba49.zip
vxlan: T3700: add support for external controlled FDB
Background information [1]. Specifies whether an external control plane (e.g. ip route encap/EVPN) or the internal FDB should be used. [1]: https://legacy.netdevconf.info/2.2/slides/prabhu-linuxbridge-tutorial.pdf
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_vxlan.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_vxlan.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_vxlan.py b/smoketest/scripts/cli/test_interfaces_vxlan.py
index f63c850d8..17874af89 100755
--- a/smoketest/scripts/cli/test_interfaces_vxlan.py
+++ b/smoketest/scripts/cli/test_interfaces_vxlan.py
@@ -16,6 +16,7 @@
import unittest
+from vyos.configsession import ConfigSessionError
from vyos.ifconfig import Interface
from vyos.util import get_interface_config
@@ -78,6 +79,9 @@ class VXLANInterfaceTest(BasicInterfaceTest.TestCase):
label = options['linkinfo']['info_data']['label']
self.assertIn(f'parameters ipv6 flowlabel {label}', self._options[interface])
+ if any('external' in s for s in self._options[interface]):
+ self.assertTrue(options['linkinfo']['info_data']['external'])
+
self.assertEqual('vxlan', options['linkinfo']['info_kind'])
self.assertEqual('set', options['linkinfo']['info_data']['df'])
self.assertEqual(f'0x{tos}', options['linkinfo']['info_data']['tos'])
@@ -85,5 +89,30 @@ class VXLANInterfaceTest(BasicInterfaceTest.TestCase):
self.assertEqual(Interface(interface).get_admin_state(), 'up')
ttl += 10
+ def test_vxlan_external(self):
+ interface = 'vxlan0'
+ source_address = '192.0.2.1'
+ self.cli_set(self._base_path + [interface, 'external'])
+ self.cli_set(self._base_path + [interface, 'source-address', source_address])
+
+ # Now add some more interfaces - this must fail and a CLI error needs
+ # to be generated as Linux can only handle one VXLAN tunnel when using
+ # external mode.
+ for intf in self._interfaces:
+ for option in self._options.get(intf, []):
+ self.cli_set(self._base_path + [intf] + option.split())
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+
+ # Remove those test interfaces again
+ for intf in self._interfaces:
+ self.cli_delete(self._base_path + [intf])
+
+ self.cli_commit()
+
+ options = get_interface_config(interface)
+ self.assertTrue(options['linkinfo']['info_data']['external'])
+ self.assertEqual('vxlan', options['linkinfo']['info_kind'])
+
if __name__ == '__main__':
unittest.main(verbosity=2)