diff --git a/pungi/checks.py b/pungi/checks.py index c37e0fd8..94a40b77 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -1141,16 +1141,16 @@ def make_schema(): "version": {"type": "string"}, "distro": {"type": "string"}, "target": {"type": "string"}, - "image_type": {"$ref": "#/definitions/strings"}, + "image_types": {"$ref": "#/definitions/strings"}, "arches": {"$ref": "#/definitions/list_of_strings"}, "release": {"type": "string"}, "repo": {"$ref": "#/definitions/list_of_strings"}, "failable": {"$ref": "#/definitions/list_of_strings"}, + "subvariant": {"type": "string"}, }, - "subvariant": {"type": "string"}, + "required": ["name", "distro", "image_types"], + "additionalProperties": False, }, - "required": ["name", "distro", "image_type"], - "additionalProperties": False, }, }, }, diff --git a/tests/test_osbuild_phase.py b/tests/test_osbuild_phase.py index 9fd04b4d..8fa1f3d1 100644 --- a/tests/test_osbuild_phase.py +++ b/tests/test_osbuild_phase.py @@ -15,15 +15,19 @@ class OSBuildPhaseTest(helpers.PungiTestCase): def test_run(self, ThreadPool): cfg = { "name": "test-image", + "distro": "rhel-8", "version": "1", "target": "image-target", "arches": ["x86_64"], "failable": ["x86_64"], + "image_types": ["qcow2"], } compose = helpers.DummyCompose( self.topdir, {"osbuild": {"^Everything$": [cfg]}} ) + self.assertValidConfig(compose.conf) + pool = ThreadPool.return_value phase = osbuild.OSBuildPhase(compose) @@ -51,7 +55,11 @@ class OSBuildPhaseTest(helpers.PungiTestCase): @mock.patch("pungi.phases.osbuild.ThreadPool") def test_run_with_global_options(self, ThreadPool): - cfg = {"name": "test-image"} + cfg = { + "name": "test-image", + "distro": "rhel-8", + "image_types": ["qcow2"], + } compose = helpers.DummyCompose( self.topdir, { @@ -62,6 +70,8 @@ class OSBuildPhaseTest(helpers.PungiTestCase): }, ) + self.assertValidConfig(compose.conf) + pool = ThreadPool.return_value phase = osbuild.OSBuildPhase(compose) @@ -122,7 +132,7 @@ class RunOSBuildThreadTest(helpers.PungiTestCase): @mock.patch("pungi.phases.osbuild.Linker") @mock.patch("pungi.phases.osbuild.kojiwrapper.KojiWrapper") def test_process(self, KojiWrapper, Linker): - cfg = {"name": "test-image", "distro": "rhel8", "image_types": ["qcow2"]} + cfg = {"name": "test-image", "distro": "rhel-8", "image_types": ["qcow2"]} koji = KojiWrapper.return_value koji.watch_task.side_effect = self.make_fake_watch(0) koji.koji_proxy.osbuildImage.return_value = 1234 @@ -171,7 +181,7 @@ class RunOSBuildThreadTest(helpers.PungiTestCase): mock.call.koji_proxy.osbuildImage( "test-image", "1", - "rhel8", + "rhel-8", ["qcow2"], "image-target", ["aarch64", "x86_64"], @@ -232,7 +242,7 @@ class RunOSBuildThreadTest(helpers.PungiTestCase): @mock.patch("pungi.phases.osbuild.kojiwrapper.KojiWrapper") def test_task_fails(self, KojiWrapper): - cfg = {"name": "test-image", "distro": "rhel8", "image_types": ["qcow2"]} + cfg = {"name": "test-image", "distro": "rhel-8", "image_types": ["qcow2"]} koji = KojiWrapper.return_value koji.watch_task.side_effect = self.make_fake_watch(1) koji.koji_proxy.osbuildImage.return_value = 1234 @@ -257,7 +267,7 @@ class RunOSBuildThreadTest(helpers.PungiTestCase): def test_task_fails_but_is_failable(self, KojiWrapper): cfg = { "name": "test-image", - "distro": "rhel8", + "distro": "rhel-8", "image_types": ["qcow2"], "failable": ["x86_65"], }