diff options
Diffstat (limited to 'src/leap/eip')
-rw-r--r-- | src/leap/eip/checks.py | 4 | ||||
-rw-r--r-- | src/leap/eip/openvpnconnection.py | 3 | ||||
-rw-r--r-- | src/leap/eip/tests/test_config.py | 14 | ||||
-rw-r--r-- | src/leap/eip/tests/test_openvpnconnection.py | 3 |
4 files changed, 19 insertions, 5 deletions
diff --git a/src/leap/eip/checks.py b/src/leap/eip/checks.py index 0d07ef08..de738de6 100644 --- a/src/leap/eip/checks.py +++ b/src/leap/eip/checks.py @@ -451,7 +451,7 @@ class EIPConfigChecker(object): domain = config.get('provider', None) uri = self._get_provider_definition_uri(domain=domain) - if sys.platform == "darwin": + if sys.platform == "darwin": verify = get_mac_cabundle() else: verify = True @@ -465,7 +465,7 @@ class EIPConfigChecker(object): def fetch_eip_service_config(self, skip_download=False, force_download=False, config=None, uri=None, # domain=None, - autocacert=True): + autocacert=True, verify=True): if skip_download: return True if config is None: diff --git a/src/leap/eip/openvpnconnection.py b/src/leap/eip/openvpnconnection.py index 4953db11..455735c8 100644 --- a/src/leap/eip/openvpnconnection.py +++ b/src/leap/eip/openvpnconnection.py @@ -107,7 +107,7 @@ class OpenVPNManagement(object): return [] except socket.error as exc: logger.debug('socket error: %s' % exc.message) - except select.error as exc: + except select.error as exc: logger.debug('select error: %s' % exc.message) def _send_short_command(self, cmd): @@ -374,7 +374,6 @@ to be triggered for each one of them. logger.warning('management socket died') return - #shutting openvpn failured #try patching in old openvpn host and trying again # XXX could be more than one! diff --git a/src/leap/eip/tests/test_config.py b/src/leap/eip/tests/test_config.py index 5977ef3c..05e78de4 100644 --- a/src/leap/eip/tests/test_config.py +++ b/src/leap/eip/tests/test_config.py @@ -28,6 +28,8 @@ class EIPConfigTest(BaseLeapTest): __name__ = "eip_config_tests" provider = "testprovider.example.org" + maxDiff = None + def setUp(self): pass @@ -130,6 +132,18 @@ class EIPConfigTest(BaseLeapTest): args.append('/tmp/test.socket') args.append('unix') + args.append('--script-security') + args.append('2') + + if _system == "Linux": + args.append('--up') + args.append('/etc/leap/resolv-update') + args.append('--down') + args.append('/etc/leap/resolv-update') + args.append('--plugin') + args.append('/usr/lib/openvpn/openvpn-down-root.so') + args.append("'script_type=down /etc/leap/resolv-update'") + # certs # XXX get values from specs? args.append('--cert') diff --git a/src/leap/eip/tests/test_openvpnconnection.py b/src/leap/eip/tests/test_openvpnconnection.py index f7493567..95bfb2f0 100644 --- a/src/leap/eip/tests/test_openvpnconnection.py +++ b/src/leap/eip/tests/test_openvpnconnection.py @@ -91,9 +91,10 @@ class OpenVPNConnectionTest(BaseLeapTest): # while fixing. kali. openvpn_connection = openvpnconnection.OpenVPNConnection() - with patch.object(psutil, "get_process_list") as mocked_psutil: + with patch.object(psutil, "process_iter") as mocked_psutil: mocked_process = Mock() mocked_process.name = "openvpn" + mocked_process.cmdline = ["openvpn", "-foo", "-bar", "-gaaz"] mocked_psutil.return_value = [mocked_process] with self.assertRaises(eipexceptions.OpenVPNAlreadyRunning): openvpn_connection._check_if_running_instance() |