Permalink
Browse files

[openwisp] Fixed openvpn integration (partially backward incompatible)

  • Loading branch information...
nemesisdesign committed Sep 2, 2016
1 parent 7bc283a commit afbc3a386bc360320f5f92250640da069777b821
Showing with 28 additions and 26 deletions.
  1. +1 −3 netjsonconfig/backends/openwisp/openwisp.py
  2. +27 −23 tests/openwisp/test_backend.py
@@ -9,8 +9,7 @@
class OpenWisp(OpenWrt):
""" OpenWisp 1.x Backend """
schema = schema
openwisp_env = Environment(loader=PackageLoader('netjsonconfig.backends.openwisp',
'templates'),
openwisp_env = Environment(loader=PackageLoader('netjsonconfig.backends.openwisp', 'templates'),
trim_blocks=True)
def validate(self):
@@ -48,7 +47,6 @@ def _get_install_context(self):
if vpn.get('dev_type') != 'tap':
continue
tap = vpn.copy()
tap['name'] = tap['config_value']
l2vpn.append(tap)
# bridge list
bridges = []
@@ -64,34 +64,38 @@ class TestBackend(unittest.TestCase, _TabsMixin):
],
"openvpn": [
{
"config_name": "openvpn",
"config_value": "2693",
"enabled": "1",
"client": "1",
"ca": "/tmp/owispmanager/openvpn/x509/ca_1_service.pem",
"cert": "/tmp/owispmanager/openvpn/x509/l2vpn_client_2693.pem",
"cipher": "AES-128-CBC",
"comp_lzo": "yes",
"dev": "tap0",
"dev_type": "tap",
"proto": "tcp-client",
"remote": "vpn.openwisp.org 12128",
"nobind": "1",
"down": "/tmp/owispmanager/openvpn/vpn_2693_script_down.sh",
"enabled": True,
"keepalive": "5 40",
"ns_cert_type": "server",
"resolv_retry": "infinite",
"comp_lzo": "yes",
"tls_client": "1",
"ca": "/tmp/owispmanager/openvpn/x509/ca_1_service.pem",
"key": "/tmp/owispmanager/openvpn/x509/l2vpn_client_2693.pem",
"cert": "/tmp/owispmanager/openvpn/x509/l2vpn_client_2693.pem",
"log": "/tmp/openvpn_2693.log",
"mode": "client",
"mute": 10,
"mute_replay_warnings": True,
"name": "2693",
"nobind": True,
"ns_cert_type": "server",
"persist_tun": True,
"proto": "tcp-client",
"remote": [
{
"host": "vpn.openwisp.org",
"port": 12128
}
],
"resolv_retry": True,
"script_security": 1,
"tls_client": True,
"up": "/tmp/owispmanager/openvpn/vpn_2693_script_up.sh",
"down": "/tmp/owispmanager/openvpn/vpn_2693_script_down.sh",
"cipher": "AES-128-CBC",
"script_security": "3",
"up_delay": "1",
"up_restart": "1",
"persist_tun": "1",
"mute_replay_warnings": "1",
"verb": "1",
"mute": "10",
"log": "/tmp/openvpn_2693.log"
"up_delay": 1,
"up_restart": True,
"verb": 1
}
],
"tc_options": [

0 comments on commit afbc3a3

Please sign in to comment.