summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-18 18:04:34 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-18 18:15:30 +0200
commit029f9839c21317ec5959b331eee25da472d08dc1 (patch)
tree4d4d9b8d3d142f783e0cc84015303a9e2920cfc7 /smoketest
parentb3e486604c46c4aec858706ac90c833f3b4ebe5c (diff)
downloadvyos-1x-029f9839c21317ec5959b331eee25da472d08dc1.tar.gz
vyos-1x-029f9839c21317ec5959b331eee25da472d08dc1.zip
openvpn: T2969: force creation of tunnel interfaces
A lot of VyOS code requires the Kernel interface to be present in order to properly work and adjust the interface to the users CLI intends (alias, ipv6, vrf - just to name a few). OpenVPN - when run in client mode - only creates the interface (e.g. vtun1) when the connection to the OpenVPN server was successful. This can't be always the case due to e.g. software-updates or routing issues to the remote side. This will in the end result in a zombie OpenVPN client interface where some config items might not have been set when the interface finally comes up - imagine a wrong assigned VRF instance. By always creating the OpenVPN interface manuall we ensure that all the CLI settings are properly configured in the OS kernel.
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_openvpn.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_openvpn.py b/smoketest/scripts/cli/test_interfaces_openvpn.py
index 0ac91c170..2af07a579 100755
--- a/smoketest/scripts/cli/test_interfaces_openvpn.py
+++ b/smoketest/scripts/cli/test_interfaces_openvpn.py
@@ -17,6 +17,8 @@
import os
import unittest
+from netifaces import interfaces
+
from vyos.configsession import ConfigSession
from vyos.configsession import ConfigSessionError
from vyos.util import cmd
@@ -72,8 +74,8 @@ class TestInterfacesOpenVPN(unittest.TestCase):
self.assertIn(f'remote {remote_host}', config)
self.assertIn('persist-tun', config)
-
self.assertTrue(process_named_running(PROCESS_NAME))
+ self.assertIn(interface, interfaces())
if __name__ == '__main__':
# Our SSL certificates need a subject ...