Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[openvpn] Allow to omit seconds in status attribute
- Loading branch information
Showing
with
8 additions
and
1 deletion.
-
+1
−1
netjsonconfig/backends/openvpn/schema.py
-
+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": [{ |
|
|