Permalink
Browse files

[OpenWrt] Added igmp_snooping property

  • Loading branch information...
nemesisdesign committed Apr 1, 2016
1 parent 5d8e4c7 commit bfbf23d325e7b6c244f501c9bca7cccecd5bff19
Showing with 40 additions and 0 deletions.
  1. +15 −0 netjsonconfig/backends/openwrt/schema.py
  2. +25 −0 tests/openwrt/test_network.py
@@ -83,6 +83,21 @@
{"$ref": "#/definitions/macfilter_wireless"},
]
},
"bridge_interface": {
"allOf": [
{
"properties": {
"igmp_snooping": {
"type": "boolean",
"title": "IGMP snooping",
"default": False,
"format": "checkbox",
"propertyOrder": 4,
}
}
}
]
},
"base_radio_settings": {
"required": ["driver"],
"properties": {
@@ -1014,3 +1014,28 @@ def test_spanning_tree(self):
o.config['interfaces'][0]['stp'] = 'wrong'
with self.assertRaises(ValidationError):
o.validate()
def test_igmp(self):
o = OpenWrt({
"interfaces": [
{
"name": "br-lan",
"type": "bridge",
"igmp_snooping": True,
"bridge_members": ["eth0", "eth1"]
}
]
})
expected = self._tabs("""package network
config interface 'br_lan'
option ifname 'eth0 eth1'
option igmp_snooping '1'
option proto 'none'
option type 'bridge'
""")
self.assertEqual(o.render(), expected)
# try entering an invalid value
o.config['interfaces'][0]['igmp_snooping'] = 'wrong'
with self.assertRaises(ValidationError):
o.validate()

0 comments on commit bfbf23d

Please sign in to comment.