Skip to content

Commit

Permalink
Updated main NetJSON schema #30
Browse files Browse the repository at this point in the history
Updated DeviceConfiguration according to latest NetJSON spec.
Closes #30.
  • Loading branch information
nemesifier committed Nov 30, 2015
1 parent e5597a0 commit 86ca33a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 30 deletions.
41 changes: 24 additions & 17 deletions netjsonconfig/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@
"type": "object",
"title": "Address",
"additionalProperties": True,
"required": [
"proto",
"family"
],
"properties": {
"address": {
"type": "string"
},
"mask": {
"type": "integer"
},
"gateway": {
"type": "string"
"proto": {
"type": "string",
"enum": [
"static",
"dhcp"
]
},
"family": {
"type": "string",
Expand All @@ -67,12 +69,14 @@
"ipv6"
]
},
"proto": {
"type": "string",
"enum": [
"static",
"dhcp"
]
"address": {
"type": "string"
},
"mask": {
"type": "integer"
},
"gateway": {
"type": "string"
}
}
}
Expand Down Expand Up @@ -184,12 +188,15 @@
"wps"
]
},
"ciphers": {
"type": "array"
},
"key": {
"type": "string"
},
"ciphers": {
"type": "array",
"items": {
"type": "string"
}
},
"disabled": {
"type": "boolean",
"default": False
Expand Down
12 changes: 8 additions & 4 deletions tests/openwrt/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ def test_additional_proto(self):
"type": "wireless",
"addresses": [
{
"proto": "3g"
"proto": "3g",
"family": "ipv4"
}
]
}
Expand Down Expand Up @@ -307,7 +308,8 @@ def test_interface_custom_attrs(self):
"empty": "",
"addresses": [
{
"proto": "3g"
"proto": "3g",
"family": "ipv4"
}
]
}
Expand Down Expand Up @@ -335,7 +337,8 @@ def test_simple_bridge(self):
"type": "ethernet",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
]
},
Expand Down Expand Up @@ -379,7 +382,8 @@ def test_eth_bridge(self):
"type": "ethernet",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
]
},
Expand Down
27 changes: 18 additions & 9 deletions tests/openwrt/test_wireless.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ def test_wifi_encryption_wep_open(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -295,7 +296,8 @@ def test_wifi_encryption_wep_shared(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -338,7 +340,8 @@ def test_wifi_encryption_wpa_personal(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -383,7 +386,8 @@ def test_wifi_encryption_wpa2_personal(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -429,7 +433,8 @@ def test_encryption_disabled(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -474,7 +479,8 @@ def test_multiple_wifi(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand All @@ -496,7 +502,8 @@ def test_multiple_wifi(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -549,7 +556,8 @@ def test_wifi_bridge(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down Expand Up @@ -615,7 +623,8 @@ def test_wifi_network(self):
"type": "wireless",
"addresses": [
{
"proto": "dhcp"
"proto": "dhcp",
"family": "ipv4"
}
],
"wireless": {
Expand Down

0 comments on commit 86ca33a

Please sign in to comment.