diff --git a/stages/org.osbuild.oscap.autotailor.meta.json b/stages/org.osbuild.oscap.autotailor.meta.json index 11091790..8d4daede 100644 --- a/stages/org.osbuild.oscap.autotailor.meta.json +++ b/stages/org.osbuild.oscap.autotailor.meta.json @@ -36,9 +36,21 @@ }, "tailoring": { "additionalProperties": false, - "required": [ - "profile_id", - "datastream" + "oneOf": [ + { + "required": [ + "profile_id", + "datastream", + "new_profile" + ] + }, + { + "required": [ + "profile_id", + "datastream", + "tailored_profile_id" + ] + } ], "type": "object", "description": "OpenSCAP configuration variables", diff --git a/stages/test/test_autotailor.py b/stages/test/test_autotailor.py index c06c42e0..00bfe0e0 100644 --- a/stages/test/test_autotailor.py +++ b/stages/test/test_autotailor.py @@ -148,6 +148,11 @@ def test_oscap_autotailor_json_smoke(mock_subprocess_run, fake_json_input, stage "tailored_profile_id": "some-new-profile" }, "{'datastream': 'some-datastream', 'tailored_profile_id': 'some-new-profile'}" + " 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", "tailoring_file": "/some/tailoring/file.json"