Permalink
Browse files

[openvpn] Allow to omit seconds in status attribute

  • Loading branch information...
nemesisdesign committed Feb 8, 2017
1 parent 42204cc commit c4aa07a6636ab6ed80bfdabf9bd815bca8e8b808
Showing with 8 additions and 1 deletion.
  1. +1 −1 netjsonconfig/backends/openvpn/schema.py
  2. +7 −0 tests/openvpn/test_backend.py
@@ -292,7 +292,7 @@
"description": "Write operational status to file every n seconds; "
"eg: \"/var/run/openvpn.status 10\"",
"type": "string",
"pattern": "^((\\S*) ([0-9]*)|)$",
"pattern": "^((\\S*) ([0-9]*)|(\\S*)|)$",
"propertyOrder": 35,
},
"status_version": {
@@ -1,3 +1,4 @@
import copy
import tarfile
import unittest
@@ -220,6 +221,12 @@ def test_no_status_file(self):
self.assertNotIn('status', output)
self.assertNotIn('status-version', output)
def test_status_file_no_seconds(self):
conf = copy.deepcopy(self._simple_conf)
conf['openvpn'][0]['status'] = '/var/run/openvpn.status'
c = OpenVpn(conf)
self.assertIn('status /var/run/openvpn.status', c.render())
def test_server_bridge(self):
c = OpenVpn({
"openvpn": [{

0 comments on commit c4aa07a

Please sign in to comment.