summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_tunnel.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-01-01 12:21:40 +0200
committerGitHub <noreply@github.com>2024-01-01 12:21:40 +0200
commit4519506c6f5360c73c0342e049d716465857802e (patch)
tree55464d0c6e1b632c2ba384e47fd9b568f8d11958 /smoketest/scripts/cli/test_interfaces_tunnel.py
parent15e55e4ea9201d9cb2e64c63fd109c9b98509947 (diff)
parent66ce19058b7b8597536ddf63bbca027add2ca8a1 (diff)
downloadvyos-1x-4519506c6f5360c73c0342e049d716465857802e.tar.gz
vyos-1x-4519506c6f5360c73c0342e049d716465857802e.zip
Merge pull request #2728 from c-po/verify-T5880
T5880: verify_source_interface() should not allow dynamic interfaces like ppp, l2tp, ipoe or sstpc client interfaces
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_tunnel.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_tunnel.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_tunnel.py b/smoketest/scripts/cli/test_interfaces_tunnel.py
index 2a7a519fd..dd9f1d2d1 100755
--- a/smoketest/scripts/cli/test_interfaces_tunnel.py
+++ b/smoketest/scripts/cli/test_interfaces_tunnel.py
@@ -393,5 +393,21 @@ class TunnelInterfaceTest(BasicInterfaceTest.TestCase):
self.assertEqual(tunnel_config['encapsulation'], conf['linkinfo']['info_kind'])
self.assertEqual(tunnel_config['remote'], conf['linkinfo']['info_data']['remote'])
+ def test_tunnel_invalid_source_interface(self):
+ encapsulation = 'gre'
+ remote = '192.0.2.1'
+ interface = 'tun7543'
+
+ self.cli_set(self._base_path + [interface, 'encapsulation', encapsulation])
+ self.cli_set(self._base_path + [interface, 'remote', remote])
+
+ for dynamic_interface in ['l2tp0', 'ppp4220', 'sstpc0', 'ipoe654']:
+ self.cli_set(self._base_path + [interface, 'source-interface', dynamic_interface])
+ # verify() - we can not source from dynamic interfaces
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+ self.cli_set(self._base_path + [interface, 'source-interface', 'eth0'])
+ self.cli_commit()
+
if __name__ == '__main__':
unittest.main(verbosity=2)