stages/autotailor: fix stage schema
There was a small mistake in the schema since either one of `new_profile` or `tailored_profile_id` is required. This commit fixes this and updates the tests to check for this case.
This commit is contained in:
parent
5bf252a2c1
commit
3fa8ab8cbc
2 changed files with 20 additions and 3 deletions
|
|
@ -36,9 +36,21 @@
|
||||||
},
|
},
|
||||||
"tailoring": {
|
"tailoring": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": [
|
"oneOf": [
|
||||||
"profile_id",
|
{
|
||||||
"datastream"
|
"required": [
|
||||||
|
"profile_id",
|
||||||
|
"datastream",
|
||||||
|
"new_profile"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"required": [
|
||||||
|
"profile_id",
|
||||||
|
"datastream",
|
||||||
|
"tailored_profile_id"
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "OpenSCAP configuration variables",
|
"description": "OpenSCAP configuration variables",
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,11 @@ def test_oscap_autotailor_json_smoke(mock_subprocess_run, fake_json_input, stage
|
||||||
"tailored_profile_id": "some-new-profile"
|
"tailored_profile_id": "some-new-profile"
|
||||||
}, "{'datastream': 'some-datastream', 'tailored_profile_id': 'some-new-profile'}"
|
}, "{'datastream': 'some-datastream', 'tailored_profile_id': 'some-new-profile'}"
|
||||||
+ " is not valid under any of the given schemas"),
|
+ " is not valid under any of the given schemas"),
|
||||||
|
({
|
||||||
|
"datastream": "some-datastream",
|
||||||
|
"profile_id": "some-profile-id",
|
||||||
|
}, "{'datastream': 'some-datastream', 'profile_id': 'some-profile-id'}"
|
||||||
|
+ " is not valid under any of the given schemas"),
|
||||||
({
|
({
|
||||||
"datastream": "some-datastream",
|
"datastream": "some-datastream",
|
||||||
"tailoring_file": "/some/tailoring/file.json"
|
"tailoring_file": "/some/tailoring/file.json"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue