diff options
author | Christian Breunig <christian@breunig.cc> | 2024-01-17 06:35:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 06:35:51 +0100 |
commit | 0afa8dd813195b43f7ac3c9f0c11fdc8dae31668 (patch) | |
tree | b84cfe5737e6342a993444b64f7e201814dfda79 /smoketest/scripts/cli/test_vpn_l2tp.py | |
parent | bf08f0f2538b5068ff1a41b51dac832b04a7d4be (diff) | |
parent | d187803c31175e471397dd4f77040ab56d2e1073 (diff) | |
download | vyos-1x-0afa8dd813195b43f7ac3c9f0c11fdc8dae31668.tar.gz vyos-1x-0afa8dd813195b43f7ac3c9f0c11fdc8dae31668.zip |
Merge pull request #2832 from aapostoliuk/T5865-circinus
T5865: Moved ipv6 pools to named ipv6 pools in accel-ppp
Diffstat (limited to 'smoketest/scripts/cli/test_vpn_l2tp.py')
-rwxr-xr-x | smoketest/scripts/cli/test_vpn_l2tp.py | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/smoketest/scripts/cli/test_vpn_l2tp.py b/smoketest/scripts/cli/test_vpn_l2tp.py index 5b3e419bd..129a9c602 100755 --- a/smoketest/scripts/cli/test_vpn_l2tp.py +++ b/smoketest/scripts/cli/test_vpn_l2tp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2023 VyOS maintainers and contributors +# Copyright (C) 2023-2024 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 @@ -55,6 +55,13 @@ class TestVPNL2TPServer(BasicAccelPPPTest.TestCase): self.set(['ppp-options', 'lcp-echo-interval', lcp_echo_interval]) self.set(['ppp-options', 'lcp-echo-timeout', lcp_echo_timeout]) + allow_ipv6 = 'allow' + random = 'random' + self.set(['ppp-options', 'ipv6', allow_ipv6]) + self.set(['ppp-options', 'ipv6-intf-id', random]) + self.set(['ppp-options', 'ipv6-accept-peer-intf-id']) + self.set(['ppp-options', 'ipv6-peer-intf-id', random]) + # commit changes self.cli_commit() @@ -76,6 +83,13 @@ class TestVPNL2TPServer(BasicAccelPPPTest.TestCase): self.assertEqual(conf['ppp']['lcp-echo-timeout'], lcp_echo_timeout) self.assertEqual(conf['ppp']['lcp-echo-failure'], lcp_echo_failure) + for tmp in ['ipv6pool', 'ipv6_nd', 'ipv6_dhcp']: + self.assertEqual(conf['modules'][tmp], None) + self.assertEqual(conf['ppp']['ipv6'], allow_ipv6) + self.assertEqual(conf['ppp']['ipv6-intf-id'], random) + self.assertEqual(conf['ppp']['ipv6-peer-intf-id'], random) + self.assertTrue(conf['ppp'].getboolean('ipv6-accept-peer-intf-id')) + def test_l2tp_server_authentication_protocols(self): # Test configuration of local authentication for PPPoE server self.basic_config() @@ -92,44 +106,6 @@ class TestVPNL2TPServer(BasicAccelPPPTest.TestCase): self.assertEqual(conf['modules']['auth_mschap_v2'], None) - def test_l2tp_server_client_ipv6_pool(self): - # Test configuration of IPv6 client pools - self.basic_config() - - # Enable IPv6 - allow_ipv6 = 'allow' - random = 'random' - self.set(['ppp-options', 'ipv6', allow_ipv6]) - self.set(['ppp-options', 'ipv6-intf-id', random]) - self.set(['ppp-options', 'ipv6-accept-peer-intf-id']) - self.set(['ppp-options', 'ipv6-peer-intf-id', random]) - - prefix = '2001:db8:ffff::/64' - prefix_mask = '128' - client_prefix = f'{prefix},{prefix_mask}' - self.set(['client-ipv6-pool', 'prefix', prefix, 'mask', prefix_mask]) - - delegate_prefix = '2001:db8::/40' - delegate_mask = '56' - self.set(['client-ipv6-pool', 'delegate', delegate_prefix, 'delegation-prefix', delegate_mask]) - - # commit changes - self.cli_commit() - - # Validate configuration values - conf = ConfigParser(allow_no_value=True, delimiters='=') - conf.read(self._config_file) - - for tmp in ['ipv6pool', 'ipv6_nd', 'ipv6_dhcp']: - self.assertEqual(conf['modules'][tmp], None) - - self.assertEqual(conf['ppp']['ipv6'], allow_ipv6) - self.assertEqual(conf['ppp']['ipv6-intf-id'], random) - self.assertEqual(conf['ppp']['ipv6-peer-intf-id'], random) - self.assertTrue(conf['ppp'].getboolean('ipv6-accept-peer-intf-id')) - - self.assertEqual(conf['ipv6-pool'][client_prefix], None) - self.assertEqual(conf['ipv6-pool']['delegate'], f'{delegate_prefix},{delegate_mask}') if __name__ == '__main__': unittest.main(verbosity=2) |