Update from upstream #11
@ -1594,7 +1594,9 @@ OSBuild Composer for building images
|
|||||||
|
|
||||||
* ``name`` -- name of the Koji package
|
* ``name`` -- name of the Koji package
|
||||||
* ``distro`` -- image for which distribution should be build TODO examples
|
* ``distro`` -- image for which distribution should be build TODO examples
|
||||||
* ``image_types`` -- a list of image types to build (e.g. ``qcow2``)
|
* ``image_types`` -- a list with a single image type string or just a
|
||||||
|
string representing the image type to build (e.g. ``qcow2``). In any
|
||||||
|
case, only a single image type can be provided as an argument.
|
||||||
|
|
||||||
Optional keys:
|
Optional keys:
|
||||||
|
|
||||||
|
@ -1171,7 +1171,21 @@ def make_schema():
|
|||||||
"version": {"type": "string"},
|
"version": {"type": "string"},
|
||||||
"distro": {"type": "string"},
|
"distro": {"type": "string"},
|
||||||
"target": {"type": "string"},
|
"target": {"type": "string"},
|
||||||
"image_types": {"$ref": "#/definitions/strings"},
|
# Only a single image_type can be specified
|
||||||
|
# https://github.com/osbuild/koji-osbuild/commit/c7252650814f82281ee57b598cb2ad970b580451
|
||||||
|
# https://github.com/osbuild/koji-osbuild/commit/f21a2de39b145eb94f3d49cb4d8775a33ba56752
|
||||||
|
"image_types": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "array",
|
||||||
|
"items": {"type": "string"},
|
||||||
|
"description": "Deprecated variant",
|
||||||
|
"minItems": 1,
|
||||||
|
"maxItems": 1,
|
||||||
|
},
|
||||||
|
{"type": "string"},
|
||||||
|
]
|
||||||
|
},
|
||||||
"arches": {"$ref": "#/definitions/list_of_strings"},
|
"arches": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"release": {"type": "string"},
|
"release": {"type": "string"},
|
||||||
"repo": {"$ref": "#/definitions/list_of_strings"},
|
"repo": {"$ref": "#/definitions/list_of_strings"},
|
||||||
|
@ -8,6 +8,7 @@ import koji as orig_koji
|
|||||||
|
|
||||||
from tests import helpers
|
from tests import helpers
|
||||||
from pungi.phases import osbuild
|
from pungi.phases import osbuild
|
||||||
|
from pungi.checks import validate
|
||||||
|
|
||||||
|
|
||||||
class OSBuildPhaseTest(helpers.PungiTestCase):
|
class OSBuildPhaseTest(helpers.PungiTestCase):
|
||||||
@ -105,6 +106,24 @@ class OSBuildPhaseTest(helpers.PungiTestCase):
|
|||||||
phase = osbuild.OSBuildPhase(compose)
|
phase = osbuild.OSBuildPhase(compose)
|
||||||
self.assertTrue(phase.skip())
|
self.assertTrue(phase.skip())
|
||||||
|
|
||||||
|
def test_fail_multiple_image_types(self):
|
||||||
|
cfg = {
|
||||||
|
"name": "test-image",
|
||||||
|
"distro": "rhel-8",
|
||||||
|
# more than one image type is not allowed
|
||||||
|
"image_types": ["qcow2", "rhel-ec2"],
|
||||||
|
}
|
||||||
|
compose = helpers.DummyCompose(
|
||||||
|
self.topdir,
|
||||||
|
{
|
||||||
|
"osbuild": {"^Everything$": [cfg]},
|
||||||
|
"osbuild_target": "image-target",
|
||||||
|
"osbuild_version": "1",
|
||||||
|
"osbuild_release": "2",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
self.assertNotEqual(validate(compose.conf), ([], []))
|
||||||
|
|
||||||
|
|
||||||
class RunOSBuildThreadTest(helpers.PungiTestCase):
|
class RunOSBuildThreadTest(helpers.PungiTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user