Skip to content

Commit

Permalink
[OpenWrt] Added isolate property
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Apr 1, 2016
1 parent bfbf23d commit 269c7bf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions netjsonconfig/backends/openwrt/schema.py
Expand Up @@ -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": {
Expand Down
21 changes: 21 additions & 0 deletions tests/openwrt/test_wireless.py
Expand Up @@ -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.