summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-22 15:31:12 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-22 19:38:29 +0100
commit35319790813c78900d0ca54d9ac6905bfe368455 (patch)
treef3393ea791238e08c7bca56b5615bc82a0aadf2c /smoketest/scripts
parent5053f326a9a6534f232463ab55937983fde1901d (diff)
downloadvyos-1x-35319790813c78900d0ca54d9ac6905bfe368455.tar.gz
vyos-1x-35319790813c78900d0ca54d9ac6905bfe368455.zip
smoketest: openvpn: T3080: verify configured keep-alive values
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_openvpn.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_openvpn.py b/smoketest/scripts/cli/test_interfaces_openvpn.py
index 3ca603877..637b42fa0 100755
--- a/smoketest/scripts/cli/test_interfaces_openvpn.py
+++ b/smoketest/scripts/cli/test_interfaces_openvpn.py
@@ -189,6 +189,7 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.assertIn(f'persist-tun', config)
self.assertIn(f'auth {auth_hash}', config)
self.assertIn(f'cipher aes-256-cbc', config)
+
# TLS options
self.assertIn(f'ca {ca_cert}', config)
self.assertIn(f'cert {ssl_cert}', config)
@@ -343,6 +344,8 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.session.set(path + ['local-port', port])
self.session.set(path + ['server', 'subnet', subnet])
self.session.set(path + ['server', 'topology', 'subnet'])
+ self.session.set(path + ['keep-alive', 'failure-count', '5'])
+ self.session.set(path + ['keep-alive', 'interval', '5'])
# clients
self.session.set(path + ['server', 'client', 'client1', 'ip', client_ip])
@@ -383,6 +386,7 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.assertIn(f'topology subnet', config)
self.assertIn(f'lport {port}', config)
self.assertIn(f'push "redirect-gateway def1"', config)
+ self.assertIn(f'keepalive 5 25', config)
# TLS options
self.assertIn(f'ca {ca_cert}', config)
@@ -436,6 +440,8 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.session.set(path + ['server', 'subnet', subnet])
self.session.set(path + ['server', 'topology', 'net30'])
self.session.set(path + ['replace-default-route'])
+ self.session.set(path + ['keep-alive', 'failure-count', '10'])
+ self.session.set(path + ['keep-alive', 'interval', '5'])
self.session.set(path + ['tls', 'ca-cert-file', ca_cert])
self.session.set(path + ['tls', 'cert-file', ssl_cert])
self.session.set(path + ['tls', 'key-file', ssl_key])
@@ -463,6 +469,7 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.assertIn(f'topology net30', config)
self.assertIn(f'lport {port}', config)
self.assertIn(f'push "redirect-gateway def1"', config)
+ self.assertIn(f'keepalive 5 50', config)
# TLS options
self.assertIn(f'ca {ca_cert}', config)
@@ -637,4 +644,4 @@ if __name__ == '__main__':
for file in [ca_cert, ssl_cert, ssl_key, dh_pem, s2s_key, auth_key]:
cmd(f'sudo chown openvpn:openvpn {file}')
- unittest.main()
+ unittest.main(failfast=True)