stages(kickstart): mutual exclusive ostree options
These options are mutually exclusive, this updates the schema and test case to ensure this is detected at schema validation time.
This commit is contained in:
parent
20d8d3a9a8
commit
1b5ab0ee03
2 changed files with 22 additions and 1 deletions
|
|
@ -92,7 +92,11 @@ SCHEMA = r"""
|
|||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["path"],
|
||||
"anyOf": [
|
||||
{"required": ["path", "ostree"], "not": {"required": ["ostreecontainer"]}},
|
||||
{"required": ["path", "ostreecontainer"], "not": {"required": ["ostree"]}},
|
||||
{"required": ["path"], "not": {"required": ["ostree", "ostreecontainer"]}}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
|
|
|
|||
|
|
@ -342,6 +342,23 @@ def test_kickstart_valid(tmp_path, test_input, expected): # pylint: disable=unu
|
|||
# ostreecontainer
|
||||
({"ostreecontainer": {"url": "http://some-ostree-url.com/foo",
|
||||
"transport": "not-valid"}}, "'not-valid' is not one of ["),
|
||||
# not both ostreecontainer and ostree
|
||||
(
|
||||
{
|
||||
"ostreecontainer": {
|
||||
"url": "http://some-ostree-url.com/foo",
|
||||
},
|
||||
"ostree": {
|
||||
"osname": "some-osname",
|
||||
"url": "http://some-ostree-url.com/foo",
|
||||
"ref": "some-ref",
|
||||
"remote": "some-remote",
|
||||
"gpg": True,
|
||||
},
|
||||
},
|
||||
"is not valid under any of the given schemas",
|
||||
),
|
||||
|
||||
],
|
||||
)
|
||||
def test_schema_validation_bad_apples(test_data, expected_err):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue