Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[OpenWrt] Added isolate property
- Loading branch information
Showing
with
33 additions
and
0 deletions.
-
+12
−0
netjsonconfig/backends/openwrt/schema.py
-
+21
−0
tests/openwrt/test_wireless.py
|
@@ -77,10 +77,22 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
"isolate_property": { |
|
|
"properties": { |
|
|
"isolate": { |
|
|
"type": "boolean", |
|
|
"title": "isolate clients", |
|
|
"default": False, |
|
|
"format": "checkbox", |
|
|
"propertyOrder": 9, |
|
|
} |
|
|
} |
|
|
}, |
|
|
"ap_wireless_settings": { |
|
|
"allOf": [ |
|
|
{"$ref": "#/definitions/wmm_wireless_property"}, |
|
|
{"$ref": "#/definitions/macfilter_wireless"}, |
|
|
{"$ref": "#/definitions/isolate_property"}, |
|
|
] |
|
|
}, |
|
|
"bridge_interface": { |
|
|
|
@@ -1389,3 +1389,24 @@ def test_wifi_iface_list_option(self): |
|
|
option ssid 'open' |
|
|
""") |
|
|
self.assertEqual(o.render(), expected) |
|
|
|
|
|
def test_isolate(self): |
|
|
o = OpenWrt({ |
|
|
"interfaces": [ |
|
|
{ |
|
|
"name": "wlan0", |
|
|
"type": "wireless", |
|
|
"wireless": { |
|
|
"radio": "radio0", |
|
|
"mode": "access_point", |
|
|
"ssid": "open", |
|
|
"isolate": True |
|
|
} |
|
|
} |
|
|
] |
|
|
}) |
|
|
self.assertIn("option isolate '1'", o.render()) |
|
|
# try entering an invalid value |
|
|
o.config['interfaces'][0]['wireless']['isolate'] = 'wrong' |
|
|
with self.assertRaises(ValidationError): |
|
|
o.validate() |