Permalink
Browse files

[OpenWrt] Added isolate property

  • Loading branch information...
nemesisdesign committed Apr 1, 2016
1 parent bfbf23d commit 269c7bfdb2a35f38f637324613d7fcf37908af33
Showing with 33 additions and 0 deletions.
  1. +12 −0 netjsonconfig/backends/openwrt/schema.py
  2. +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()

0 comments on commit 269c7bf

Please sign in to comment.