Skip to content

Commit

Permalink
[OpenWrt schema] Made file "mode" property required
Browse files Browse the repository at this point in the history
Breaking change.
  • Loading branch information
nemesifier committed Mar 14, 2016
1 parent 04c6058 commit 96d216d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions netjsonconfig/backends/openwrt/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
"additionalProperties": False,
"required": [
"path",
"mode",
"contents"
],
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions tests/openwisp/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ class TestBackend(unittest.TestCase, _TabsMixin):
"files": [
{
"path": "/openvpn/x509/ca_1_service.pem",
"mode": "0644",
"contents": "-----BEGIN CERTIFICATE-----\ntest\n-----END CERTIFICATE-----\n" # noqa
},
{
"path": "/openvpn/x509/l2vpn_client_2693.pem",
"mode": "0644",
"contents": "-----BEGIN CERTIFICATE-----\ntest==\n-----END CERTIFICATE-----\n-----BEGIN RSA PRIVATE KEY-----\ntest\n-----END RSA PRIVATE KEY-----\n" # noqa
}
]
Expand Down Expand Up @@ -225,6 +227,7 @@ def test_cron(self):
config['files'] = [
{
"path": "/crontabs/root",
"mode": "0644",
"contents": "* * * * * echo 'test' > /tmp/test-cron"
}
]
Expand Down
5 changes: 4 additions & 1 deletion tests/openwrt/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,13 @@ def test_file_inclusion(self):
"files": [
{
"path": "/etc/crontabs/root",
"mode": "0644",
"contents": '* * * * * echo "test" > /etc/testfile\n'
'* * * * * echo "test2" > /etc/testfile2'
},
{
"path": "/etc/dummy.conf",
"mode": "0644",
"contents": "testing!"
}
]
Expand Down Expand Up @@ -316,8 +318,8 @@ def test_file_permissions(self):
"files": [
{
"path": "/tmp/hello.sh",
"mode": "0755",
"contents": "echo 'hello world'",
"mode": "0755"
}
]
})
Expand All @@ -332,6 +334,7 @@ def test_file_schema(self):
"files": [
{
"path": "/tmp/hello.sh",
"mode": "0644",
"contents": "echo 'hello world'"
}
]
Expand Down
1 change: 1 addition & 0 deletions tests/test_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def test_valid_arg(self):
'files': [
{
'path': '/etc/test.txt',
'mode': '0644',
'contents': 'test_valid_arg'
}
]
Expand Down

0 comments on commit 96d216d

Please sign in to comment.