summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vpn_l2tp.py
diff options
context:
space:
mode:
authorkhramshinr <khramshinr@gmail.com>2024-05-13 17:26:55 +0600
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-05-16 05:31:14 +0000
commit2d5bb0230757ff683be4400caffdf7127bc61fad (patch)
treece5172242bf77f49e8d8c39d7f46441a68668e01 /smoketest/scripts/cli/test_vpn_l2tp.py
parent8c98231d62cd033800707c05c98a18356d20f338 (diff)
downloadvyos-1x-2d5bb0230757ff683be4400caffdf7127bc61fad.tar.gz
vyos-1x-2d5bb0230757ff683be4400caffdf7127bc61fad.zip
T5756: L2TP RADIUS backup and weight settings
(cherry picked from commit 75d553932504c55e710265776e4865a238223e1f)
Diffstat (limited to 'smoketest/scripts/cli/test_vpn_l2tp.py')
-rwxr-xr-xsmoketest/scripts/cli/test_vpn_l2tp.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vpn_l2tp.py b/smoketest/scripts/cli/test_vpn_l2tp.py
index 8c4e53895..07a7e2906 100755
--- a/smoketest/scripts/cli/test_vpn_l2tp.py
+++ b/smoketest/scripts/cli/test_vpn_l2tp.py
@@ -95,6 +95,29 @@ class TestVPNL2TPServer(BasicAccelPPPTest.TestCase):
self.cli_set(base_path + ['authentication', 'protocols', 'chap'])
self.cli_commit()
+ def test_l2tp_radius_server(self):
+ base_path = ['vpn', 'l2tp', 'remote-access']
+ radius_server = "192.0.2.22"
+ radius_key = "secretVyOS"
+
+ self.cli_set(base_path + ['authentication', 'mode', 'radius'])
+ self.cli_set(base_path + ['gateway-address', '192.0.2.1'])
+ self.cli_set(base_path + ['client-ip-pool', 'SIMPLE-POOL', 'range', '192.0.2.0/24'])
+ self.cli_set(base_path + ['default-pool', 'SIMPLE-POOL'])
+ self.cli_set(base_path + ['authentication', 'radius', 'server', radius_server, 'key', radius_key])
+ self.cli_set(base_path + ['authentication', 'radius', 'server', radius_server, 'priority', '10'])
+ self.cli_set(base_path + ['authentication', 'radius', 'server', radius_server, 'backup'])
+
+ # commit changes
+ self.cli_commit()
+
+ # Validate configuration values
+ conf = ConfigParser(allow_no_value=True)
+ conf.read(self._config_file)
+ server = conf["radius"]["server"].split(",")
+ self.assertIn('weight=10', server)
+ self.assertIn('backup', server)
+
if __name__ == '__main__':
unittest.main(verbosity=2)