From f931a8703c7b9d421ded01636cd201bc3c466da5 Mon Sep 17 00:00:00 2001 From: Berik Ashimov Date: Fri, 18 Sep 2026 14:10:41 +0500 Subject: openvpn: T9334: stop rendering "keepalive 0 0" An interval of 0 is how the CLI turns keepalive off, and it rendered "keepalive 0 0" because OpenVPN skipped its own sanity checks on that pair. OpenVPN 2.7.6 dropped the exception and now refuses to start: "keepalive ping: Must be an integer between 1 and 86400, not 0". Leave the directive out of the file instead. Nothing then sets ping or ping-restart, which is the keepalive-off the interval asked for, and a saved configuration still commits untouched. --- smoketest/scripts/cli/test_interfaces_openvpn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/test_interfaces_openvpn.py b/smoketest/scripts/cli/test_interfaces_openvpn.py index b3b832df6..4f1021a36 100755 --- a/smoketest/scripts/cli/test_interfaces_openvpn.py +++ b/smoketest/scripts/cli/test_interfaces_openvpn.py @@ -1419,16 +1419,16 @@ class TestInterfacesOpenVPN(VyOSUnitTestSHIM.TestCase): config = read_file(f'/run/openvpn/{interface}.conf') self.assertIn('keepalive 600 43200', config) - # "interval 0" renders "keepalive 0 0" - OpenVPN skips its own checks - # on that and runs without keepalive, so it has to keep committing - # whatever the failure-count says + # "interval 0" turns keepalive off, which OpenVPN 2.7.6 no longer + # spells "keepalive 0 0", so the directive has to stay out of the + # file - the failure-count still commits whatever it says self.cli_set(path + ['keep-alive', 'interval', '0']) self.cli_set(path + ['keep-alive', 'failure-count', '1']) self.cli_commit() self.assertTrue(is_systemd_service_running(f'openvpn@{interface}.service')) config = read_file(f'/run/openvpn/{interface}.conf') - self.assertIn('keepalive 0 0', config) + self.assertNotIn('keepalive', config) def test_openvpn_server_reject_unconfigured_clients(self): # T8998: reject-unconfigured-clients without server client entries -- cgit v1.2.3