diff --git a/test/data/images-ref/README b/test/data/images-ref/README index 679777b6..a9432ea9 100644 --- a/test/data/images-ref/README +++ b/test/data/images-ref/README @@ -4,14 +4,16 @@ identical to images produced by the previous `images` implementation. Generate new ones with: ``` -./gen-image-def +./gen-image-def ``` and put them into git. e.g. ``` -$ ./gen-image-def ~/devel/osbuild/images centos 9 x86_64 qcow2 -$ git add centos/9/x86_64/qcow2/centos_9-x86_64-qcow2-empty.yaml +$ ./gen-image-def ~/devel/osbuild/images centos 9 x86_64 qcow2 empty +$ git add centos/9/x86_64/qcow2/empty/centos_9-x86_64-qcow2-empty.yaml ``` (ideally we would generate them on the fly). +When doing customizations, pass "full" as the last parameter. + [0] https://github.com/osbuild/images diff --git a/test/data/images-ref/centos/9/aarch64/ami/centos_9-aarch64-ami-empty.yaml b/test/data/images-ref/centos/9/aarch64/ami/empty/centos_9-aarch64-ami-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/ami/centos_9-aarch64-ami-empty.yaml rename to test/data/images-ref/centos/9/aarch64/ami/empty/centos_9-aarch64-ami-empty.yaml diff --git a/test/data/images-ref/centos/9/aarch64/edge-commit/centos_9-aarch64-edge_commit-empty.yaml b/test/data/images-ref/centos/9/aarch64/edge-commit/empty/centos_9-aarch64-edge_commit-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/edge-commit/centos_9-aarch64-edge_commit-empty.yaml rename to test/data/images-ref/centos/9/aarch64/edge-commit/empty/centos_9-aarch64-edge_commit-empty.yaml diff --git a/test/data/images-ref/centos/9/aarch64/image-installer/centos_9-aarch64-image_installer-empty.yaml b/test/data/images-ref/centos/9/aarch64/image-installer/empty/centos_9-aarch64-image_installer-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/image-installer/centos_9-aarch64-image_installer-empty.yaml rename to test/data/images-ref/centos/9/aarch64/image-installer/empty/centos_9-aarch64-image_installer-empty.yaml diff --git a/test/data/images-ref/centos/9/aarch64/minimal-raw/centos_9-aarch64-minimal_raw-empty.yaml b/test/data/images-ref/centos/9/aarch64/minimal-raw/empty/centos_9-aarch64-minimal_raw-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/minimal-raw/centos_9-aarch64-minimal_raw-empty.yaml rename to test/data/images-ref/centos/9/aarch64/minimal-raw/empty/centos_9-aarch64-minimal_raw-empty.yaml diff --git a/test/data/images-ref/centos/9/aarch64/qcow2/centos_9-aarch64-qcow2-empty.yaml b/test/data/images-ref/centos/9/aarch64/qcow2/empty/centos_9-aarch64-qcow2-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/qcow2/centos_9-aarch64-qcow2-empty.yaml rename to test/data/images-ref/centos/9/aarch64/qcow2/empty/centos_9-aarch64-qcow2-empty.yaml diff --git a/test/data/images-ref/centos/9/aarch64/tar/centos_9-aarch64-tar-empty.yaml b/test/data/images-ref/centos/9/aarch64/tar/empty/centos_9-aarch64-tar-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/tar/centos_9-aarch64-tar-empty.yaml rename to test/data/images-ref/centos/9/aarch64/tar/empty/centos_9-aarch64-tar-empty.yaml diff --git a/test/data/images-ref/centos/9/aarch64/vhd/centos_9-aarch64-vhd-empty.yaml b/test/data/images-ref/centos/9/aarch64/vhd/empty/centos_9-aarch64-vhd-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/aarch64/vhd/centos_9-aarch64-vhd-empty.yaml rename to test/data/images-ref/centos/9/aarch64/vhd/empty/centos_9-aarch64-vhd-empty.yaml diff --git a/test/data/images-ref/centos/9/ppc64le/tar/centos_9-ppc64le-tar-empty.yaml b/test/data/images-ref/centos/9/ppc64le/tar/empty/centos_9-ppc64le-tar-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/ppc64le/tar/centos_9-ppc64le-tar-empty.yaml rename to test/data/images-ref/centos/9/ppc64le/tar/empty/centos_9-ppc64le-tar-empty.yaml diff --git a/test/data/images-ref/centos/9/s390x/tar/centos_9-s390x-tar-empty.yaml b/test/data/images-ref/centos/9/s390x/tar/empty/centos_9-s390x-tar-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/s390x/tar/centos_9-s390x-tar-empty.yaml rename to test/data/images-ref/centos/9/s390x/tar/empty/centos_9-s390x-tar-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/ami/centos_9-x86_64-ami-empty.yaml b/test/data/images-ref/centos/9/x86_64/ami/empty/centos_9-x86_64-ami-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/ami/centos_9-x86_64-ami-empty.yaml rename to test/data/images-ref/centos/9/x86_64/ami/empty/centos_9-x86_64-ami-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/ami/full/centos_9-x86_64-ami-full.yaml b/test/data/images-ref/centos/9/x86_64/ami/full/centos_9-x86_64-ami-full.yaml new file mode 100644 index 00000000..025ae69d --- /dev/null +++ b/test/data/images-ref/centos/9/x86_64/ami/full/centos_9-x86_64-ami-full.yaml @@ -0,0 +1,636 @@ +version: '2' +pipelines: + - name: build + runner: org.osbuild.centos9 + stages: + - type: org.osbuild.rpm + inputs: + packages: + type: org.osbuild.files + origin: org.osbuild.source + references: + - id: sha256:bf35d0b80342ad44ca298ed07fcc9d3f8d43a2700964586a4a5e2c0a49766528 + - id: sha256:3993c379c029014a9c4b2adf5d23397b3c7421467a0cb3575ff925bb6f6329b0 + - id: sha256:8ec5e9e6f70bf1a0b5692ef948d1194bdb074342ed14045f9e84820367a98c6a + - id: sha256:1b11757d33424678ba2d9d6fbd9eb6293a7bfa196dca15a29af179af778c235d + - id: sha256:8a1bf05d306aa663e856f3c450c8b2ddc6800116b818c7d3b65503cd89f7682a + - id: sha256:e0031c189e34e10d9c202fa8d75f72d3296a239164fe6b07e7dc206c7b723d98 + - id: sha256:c1cc69e61c0f1c7ade8df0f2994e582e7c1f2c57d1ec192a0baf9f96b7739d9d + - id: sha256:a07b0a6df6f248078ebaf93e5bea115093f8a79e0a830e383b6c0b9f7f1605f5 + - id: sha256:21fb8eaa1cfa55dbc0ed009dc98fbbbc9de4ecaef53d51dc41ab1b0ae867ed49 + - id: sha256:02b2f585447caaaef59cc58cda1cbf6db27530690fdb13f747f3fdeb762c4b15 + - id: sha256:9e7ab438597fee20e16e8e441bed0ce966bd59e0fb993fa7c94be31fb1384d88 + - id: sha256:93cd8e20fc07f08337cb9d9fa9996274658f6395574e874379c4c4157e922700 + - id: sha256:bf35d0b80342ad44ca298ed07fcc9d3f8d43a2700964586a4a5e2c0a49766528 + - id: sha256:48af68b2888775d102da39bebbe05cf07bca2f2ab9f1103dd19359d64083c70b + - id: sha256:a07b0a6df6f248078ebaf93e5bea115093f8a79e0a830e383b6c0b9f7f1605f5 + - id: sha256:21fb8eaa1cfa55dbc0ed009dc98fbbbc9de4ecaef53d51dc41ab1b0ae867ed49 + - id: sha256:02b2f585447caaaef59cc58cda1cbf6db27530690fdb13f747f3fdeb762c4b15 + - id: sha256:9e7ab438597fee20e16e8e441bed0ce966bd59e0fb993fa7c94be31fb1384d88 + - id: sha256:93cd8e20fc07f08337cb9d9fa9996274658f6395574e874379c4c4157e922700 + - id: sha256:bf35d0b80342ad44ca298ed07fcc9d3f8d43a2700964586a4a5e2c0a49766528 + - id: sha256:48af68b2888775d102da39bebbe05cf07bca2f2ab9f1103dd19359d64083c70b + - id: sha256:3467780239fa16c778e73eaec177e764de52871964adf7f23b0b03c4b6384da6 + - id: sha256:c71d1835b4ce161bb982d7bdefd5e082a6653e15c8b6e1bb684c989052212545 + - id: sha256:2c7fca95dbf12d65ab1b751c38e674a8003a18f288817d3f81081a13c7079d2a + options: + gpgkeys: + - '-----BEGIN PGP PUBLIC KEY BLOCK----- + + + mQINBFzMWxkBEADHrskpBgN9OphmhRkc7P/YrsAGSvvl7kfu+e9KAaU6f5MeAVyn + + rIoM43syyGkgFyWgjZM8/rur7EMPY2yt+2q/1ZfLVCRn9856JqTIq0XRpDUe4nKQ + + 8BlA7wDVZoSDxUZkSuTIyExbDf0cpw89Tcf62Mxmi8jh74vRlPy1PgjWL5494b3X + + 5fxDidH4bqPZyxTBqPrUFuo+EfUVEqiGF94Ppq6ZUvrBGOVo1V1+Ifm9CGEK597c + + aevcGc1RFlgxIgN84UpuDjPR9/zSndwJ7XsXYvZ6HXcKGagRKsfYDWGPkA5cOL/e + + f+yObOnC43yPUvpggQ4KaNJ6+SMTZOKikM8yciyBwLqwrjo8FlJgkv8Vfag/2UR7 + + JINbyqHHoLUhQ2m6HXSwK4YjtwidF9EUkaBZWrrskYR3IRZLXlWqeOi/+ezYOW0m + + vufrkcvsh+TKlVVnuwmEPjJ8mwUSpsLdfPJo1DHsd8FS03SCKPaXFdD7ePfEjiYk + + nHpQaKE01aWVSLUiygn7F7rYemGqV9Vt7tBw5pz0vqSC72a5E3zFzIIuHx6aANry + + Gat3aqU3qtBXOrA/dPkX9cWE+UR5wo/A2UdKJZLlGhM2WRJ3ltmGT48V9CeS6N9Y + + m4CKdzvg7EWjlTlFrd/8WJ2KoqOE9leDPeXRPncubJfJ6LLIHyG09h9kKQARAQAB + + tDpDZW50T1MgKENlbnRPUyBPZmZpY2lhbCBTaWduaW5nIEtleSkgPHNlY3VyaXR5 + + QGNlbnRvcy5vcmc+iQI3BBMBAgAhBQJczFsZAhsDBgsJCAcDAgYVCAIJCgsDFgIB + + Ah4BAheAAAoJEAW1VbOEg8ZdjOsP/2ygSxH9jqffOU9SKyJDlraL2gIutqZ3B8pl + + Gy/Qnb9QD1EJVb4ZxOEhcY2W9VJfIpnf3yBuAto7zvKe/G1nxH4Bt6WTJQCkUjcs + + N3qPWsx1VslsAEz7bXGiHym6Ay4xF28bQ9XYIokIQXd0T2rD3/lNGxNtORZ2bKjD + + vOzYzvh2idUIY1DgGWJ11gtHFIA9CvHcW+SMPEhkcKZJAO51ayFBqTSSpiorVwTq + + a0cB+cgmCQOI4/MY+kIvzoexfG7xhkUqe0wxmph9RQQxlTbNQDCdaxSgwbF2T+gw + + byaDvkS4xtR6Soj7BKjKAmcnf5fn4C5Or0KLUqMzBtDMbfQQihn62iZJN6ZZ/4dg + + q4HTqyVpyuzMXsFpJ9L/FqH2DJ4exGGpBv00ba/Zauy7GsqOc5PnNBsYaHCply0X + + 407DRx51t9YwYI/ttValuehq9+gRJpOTTKp6AjZn/a5Yt3h6jDgpNfM/EyLFIY9z + + V6CXqQQ/8JRvaik/JsGCf+eeLZOw4koIjZGEAg04iuyNTjhx0e/QHEVcYAqNLhXG + + rCTTbCn3NSUO9qxEXC+K/1m1kaXoCGA0UWlVGZ1JSifbbMx0yxq/brpEZPUYm+32 + + o8XfbocBWljFUJ+6aljTvZ3LQLKTSPW7TFO+GXycAOmCGhlXh2tlc6iTc41PACqy + + yy+mHmSv + + =kkH7 + + -----END PGP PUBLIC KEY BLOCK-----' + - type: org.osbuild.selinux + options: + file_contexts: etc/selinux/targeted/contexts/files/file_contexts + labels: + /usr/bin/cp: system_u:object_r:install_exec_t:s0 + - name: os + build: name:build + stages: + - type: org.osbuild.kernel-cmdline + options: + root_fs_uuid: 9851898e-0b30-437d-8fad-51ec16c3697f + kernel_opts: console=tty0 console=ttyS0,115200n8 net.ifnames=0 nvme_core.io_timeout=4294967295 + - type: org.osbuild.rpm + inputs: + packages: + type: org.osbuild.files + origin: org.osbuild.source + references: + - id: sha256:5660f11783e742698cec671d45910e74342fe3e48ddf054f38c0828776b08d00 + - id: sha256:a07b0a6df6f248078ebaf93e5bea115093f8a79e0a830e383b6c0b9f7f1605f5 + - id: sha256:5660f11783e742698cec671d45910e74342fe3e48ddf054f38c0828776b08d00 + - id: sha256:e2f24de304a49d3d3c1261466376ab341c3834eb683d806cb534587f4fd48f8d + - id: sha256:dbf9956aa9c5ccd4c6d92f0550e959f58bb815fb570c305e9d93645eee2082d4 + - id: sha256:9370ee4e95b7172989b9fd3f81860093529113ba42b69be340467d87a94bb253 + - id: sha256:6923dd1bc0460082c5d55a831908c24a282860b7f1cd6c2b79cf1bc8857c639c + - id: sha256:21fb8eaa1cfa55dbc0ed009dc98fbbbc9de4ecaef53d51dc41ab1b0ae867ed49 + - id: sha256:02b2f585447caaaef59cc58cda1cbf6db27530690fdb13f747f3fdeb762c4b15 + - id: sha256:5fdc7e383dc7e1b390e40c3012a2aa03978901c45f3597c1c239c51134d03dbe + - id: sha256:bf35d0b80342ad44ca298ed07fcc9d3f8d43a2700964586a4a5e2c0a49766528 + - id: sha256:443ad85c108c8acb279fc373255ff3444e54cc07c0af87a62962f0adcedd152a + - id: sha256:1ec523ebf26771bd12d4da16d6e041b9be98c6999ab8ad53afc8d82afb56e75c + - id: sha256:5fdc7e383dc7e1b390e40c3012a2aa03978901c45f3597c1c239c51134d03dbe + - id: sha256:3fc8516922a52d754083308fc413432652da40490b0a336294a5d765757be942 + - id: sha256:a77e9cdc1f34c916ec906e61eb889974e144e2e0a8dd613d191f5d877cf2774f + - id: sha256:fed83cba0a72e3b9f6af32c0dbc2c45a0bde5ebcc0a8e4ca27678844d9b82c84 + - id: sha256:fe841d961c3a0038f8a5d15250baff1c2e8efee10e72292ceb5bab8f2633f694 + - id: sha256:5660f11783e742698cec671d45910e74342fe3e48ddf054f38c0828776b08d00 + - id: sha256:368f9ec3b56023c66a7e2a4bd2609dced16bbd5354833cbb3e2eec5c90462133 + - id: sha256:d90b7202318ad799fdf7fc011a6a3d09cb586853981e5c53f381c771e0dc549a + - id: sha256:2c19d6424bd57628cc917ad414752d0135eb9c333b6671568cca9f6c95b8a053 + - id: sha256:fcb160b10ea6f210b8da239c09ea1b28cbcefefe1502486111fcd5ac6d8d99a6 + - id: sha256:1a0970a720caab2869fc7eb436e6b7656fc7efbb24cfa72ae5b49e2f6acbd7ca + - id: sha256:7a5bd1ed08002bc08013ea55c7fffc61047042b3d0979471b6e34d5e5089d334 + - id: sha256:8ff8d40e4a4c726df40795e3134432ac66f7d055d54639c1026e341b6d2bd6e7 + - id: sha256:aba407b81ed016841ea552feadaf0663c7804a64554ba55d3109b3dc8198cdcb + - id: sha256:90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb + - id: sha256:a2f5883db78735971fd620c3e83fb7767bda931555991194501eea3533e879e8 + - id: sha256:5b1e08d9dde2b42e638ce3f27ebfeaf4ab4c6ccded49d48ea60382d290cd90f6 + - id: sha256:fc710b8c27f067288ccb7779e98f7b04e7e0c84256260c93a69f68ad94b78fd8 + - id: sha256:99fec328617e9bc972503d5ed4c4c93218a8c44649cdc875876fdfbba0be383a + - id: sha256:f6a50120d4a785cc75becb370680d24d452f1437c5064db8d22f510c75604a6d + - id: sha256:eda2b1be19a5062fa55b669761df806f9aa4675223ed3cc9cce6eceaf0677939 + - id: sha256:0bdf1ef00f53398361ebaf915f0325ccdc0534447134ba8506a03c71f2c5c9e2 + - id: sha256:dc326a13b89447ad3251f78a5bd784808b85c64bc4fd380d2e9533ffa00428e2 + - id: sha256:9a701ca1bcd3b07afca9ae5f17588a2048341e0bcdab2b5a81e10614d5ca2974 + - id: sha256:476f3ccb0b9ae8b029e7105db14adf652095700dc1c8b87b8caaed29993aab27 + - id: sha256:19ba1894b231183f6dcfffd0adf9b657eb00ea33f1e002cfb04d1f1fc8e79b71 + - id: sha256:874ecbebddb9872c2fc949de3be7888f72ad3ae0e7847ee5ce0503c691503ad0 + - id: sha256:a918a8d5a29ea7c5834c6d46725660eb441653074ab4d9d8876029abce79bfb7 + - id: sha256:04cb12e072878beef30b2e3560c39bf1cb0e5a8896a545e7f4bfb0ec777196b3 + - id: sha256:4eeb0ed8c3fbd5ac0b9a9800a8cc1347f80f14bb505b0df58aefd000f978b269 + - id: sha256:782c4bb3c7a9beb41e451bceb3f4db6de6a331eb31ca76e6a64296251ba2fdb1 + - id: sha256:ce5857e0b504bd3e06f80b27dc88064f0bf214127dd5a2ee1ff849ed78e32c9e + - id: sha256:bd0add6fdee6e6ac62a4ff6bc722f2324a918d8ccc4eda21e043252a10481f0c + - id: sha256:5ac0b916a6d093edc6b702b25864007a7746a1b737c882d5a8a6d1644d731e79 + - id: sha256:0dc67f06d4a10e86af05f9a118375a3509880de5c947f9eab6476900b50d0a39 + - id: sha256:a2e58f805ca848eb1fb0fb207656d11b77a96ab198244c8e7a3fa49ddc5aade6 + - id: sha256:4e81068e88aa80ce2e9bea996a7f9e02244d06eef15c97e72ebb75b22c3ebfc5 + - id: sha256:35a69aa1faeaa821a35f576490244bd7755c226a55e1a93abd0e2b4c7e0401e8 + - id: sha256:4d0e0adebe4eb01e6db63dcdade819e617dc3c9dc412f2b08fed35ae421f8682 + - id: sha256:d8654f2a37c8dd45ed104e5b7c26ec3ee0d74dca488cdd0a400d58a6c4f7875b + - id: sha256:28fc95b01c3d432a448ded25eb5aada86e12319fcb912666f67dd5eb97893933 + - id: sha256:2de43b323b1e26fd256368050a89e6f1ab3ca1c7d469b67e134db4d5ffc7929d + - id: sha256:49e9285da13f2be02b3654b01e74cab5840b8c679f7ad4b528a9cf794d3d3e34 + - id: sha256:e0d9946d02c44f153131552ca5afa5cd0902d0446b0295a329964e78a345327c + - id: sha256:f2b81e75c964a01a845829b272d95e864a2e271e4fcd409c5e7cf5a83de1f127 + - id: sha256:3467780239fa16c778e73eaec177e764de52871964adf7f23b0b03c4b6384da6 + - id: sha256:c71d1835b4ce161bb982d7bdefd5e082a6653e15c8b6e1bb684c989052212545 + - id: sha256:2c7fca95dbf12d65ab1b751c38e674a8003a18f288817d3f81081a13c7079d2a + options: + gpgkeys: + - '-----BEGIN PGP PUBLIC KEY BLOCK----- + + + mQINBFzMWxkBEADHrskpBgN9OphmhRkc7P/YrsAGSvvl7kfu+e9KAaU6f5MeAVyn + + rIoM43syyGkgFyWgjZM8/rur7EMPY2yt+2q/1ZfLVCRn9856JqTIq0XRpDUe4nKQ + + 8BlA7wDVZoSDxUZkSuTIyExbDf0cpw89Tcf62Mxmi8jh74vRlPy1PgjWL5494b3X + + 5fxDidH4bqPZyxTBqPrUFuo+EfUVEqiGF94Ppq6ZUvrBGOVo1V1+Ifm9CGEK597c + + aevcGc1RFlgxIgN84UpuDjPR9/zSndwJ7XsXYvZ6HXcKGagRKsfYDWGPkA5cOL/e + + f+yObOnC43yPUvpggQ4KaNJ6+SMTZOKikM8yciyBwLqwrjo8FlJgkv8Vfag/2UR7 + + JINbyqHHoLUhQ2m6HXSwK4YjtwidF9EUkaBZWrrskYR3IRZLXlWqeOi/+ezYOW0m + + vufrkcvsh+TKlVVnuwmEPjJ8mwUSpsLdfPJo1DHsd8FS03SCKPaXFdD7ePfEjiYk + + nHpQaKE01aWVSLUiygn7F7rYemGqV9Vt7tBw5pz0vqSC72a5E3zFzIIuHx6aANry + + Gat3aqU3qtBXOrA/dPkX9cWE+UR5wo/A2UdKJZLlGhM2WRJ3ltmGT48V9CeS6N9Y + + m4CKdzvg7EWjlTlFrd/8WJ2KoqOE9leDPeXRPncubJfJ6LLIHyG09h9kKQARAQAB + + tDpDZW50T1MgKENlbnRPUyBPZmZpY2lhbCBTaWduaW5nIEtleSkgPHNlY3VyaXR5 + + QGNlbnRvcy5vcmc+iQI3BBMBAgAhBQJczFsZAhsDBgsJCAcDAgYVCAIJCgsDFgIB + + Ah4BAheAAAoJEAW1VbOEg8ZdjOsP/2ygSxH9jqffOU9SKyJDlraL2gIutqZ3B8pl + + Gy/Qnb9QD1EJVb4ZxOEhcY2W9VJfIpnf3yBuAto7zvKe/G1nxH4Bt6WTJQCkUjcs + + N3qPWsx1VslsAEz7bXGiHym6Ay4xF28bQ9XYIokIQXd0T2rD3/lNGxNtORZ2bKjD + + vOzYzvh2idUIY1DgGWJ11gtHFIA9CvHcW+SMPEhkcKZJAO51ayFBqTSSpiorVwTq + + a0cB+cgmCQOI4/MY+kIvzoexfG7xhkUqe0wxmph9RQQxlTbNQDCdaxSgwbF2T+gw + + byaDvkS4xtR6Soj7BKjKAmcnf5fn4C5Or0KLUqMzBtDMbfQQihn62iZJN6ZZ/4dg + + q4HTqyVpyuzMXsFpJ9L/FqH2DJ4exGGpBv00ba/Zauy7GsqOc5PnNBsYaHCply0X + + 407DRx51t9YwYI/ttValuehq9+gRJpOTTKp6AjZn/a5Yt3h6jDgpNfM/EyLFIY9z + + V6CXqQQ/8JRvaik/JsGCf+eeLZOw4koIjZGEAg04iuyNTjhx0e/QHEVcYAqNLhXG + + rCTTbCn3NSUO9qxEXC+K/1m1kaXoCGA0UWlVGZ1JSifbbMx0yxq/brpEZPUYm+32 + + o8XfbocBWljFUJ+6aljTvZ3LQLKTSPW7TFO+GXycAOmCGhlXh2tlc6iTc41PACqy + + yy+mHmSv + + =kkH7 + + -----END PGP PUBLIC KEY BLOCK-----' + - type: org.osbuild.fix-bls + options: + prefix: '' + - type: org.osbuild.locale + options: + language: nl_NL.UTF-8 + - type: org.osbuild.keymap + options: + keymap: us + x11-keymap: + layouts: + - us + - type: org.osbuild.timezone + options: + zone: UTC + - type: org.osbuild.chrony + options: + servers: + - hostname: 169.254.169.123 + minpoll: 4 + maxpoll: 4 + iburst: true + prefer: true + leapsectz: '' + - type: org.osbuild.sysconfig + options: + kernel: + update_default: true + default_kernel: kernel + network: + networking: true + no_zero_conf: true + network-scripts: + ifcfg: + eth0: + bootproto: dhcp + device: eth0 + ipv6init: false + onboot: true + peerdns: true + type: Ethernet + userctl: true + - type: org.osbuild.systemd-logind + options: + filename: 00-getty-fixes.conf + config: + Login: + NAutoVTs: 0 + - type: org.osbuild.cloud-init + options: + filename: 00-rhel-default-user.cfg + config: + system_info: + default_user: + name: ec2-user + - type: org.osbuild.modprobe + options: + filename: blacklist-nouveau.conf + commands: + - command: blacklist + modulename: nouveau + - type: org.osbuild.modprobe + options: + filename: blacklist-amdgpu.conf + commands: + - command: blacklist + modulename: amdgpu + - type: org.osbuild.dracut.conf + options: + filename: sgdisk.conf + config: + install_items: + - sgdisk + - type: org.osbuild.dracut.conf + options: + filename: ec2.conf + config: + add_drivers: + - nvme + - xen-blkfront + - type: org.osbuild.systemd.unit + options: + unit: nm-cloud-setup.service + dropin: 10-rh-enable-for-ec2.conf + config: + Service: + Environment: + - key: NM_CLOUD_SETUP_EC2 + value: 'yes' + - type: org.osbuild.authselect + options: + profile: sssd + - type: org.osbuild.sshd.config + options: + config: + PasswordAuthentication: false + - type: org.osbuild.fstab + options: + filesystems: + - uuid: 9851898e-0b30-437d-8fad-51ec16c3697f + vfs_type: xfs + path: / + options: defaults + - uuid: dbd21911-1c4e-4107-8a9f-14fe6e751358 + vfs_type: xfs + path: /boot + options: defaults + - uuid: 7B77-95E7 + vfs_type: vfat + path: /boot/efi + options: defaults,uid=0,gid=0,umask=077,shortname=winnt + passno: 2 + - type: org.osbuild.grub2 + options: + root_fs_uuid: 9851898e-0b30-437d-8fad-51ec16c3697f + boot_fs_uuid: dbd21911-1c4e-4107-8a9f-14fe6e751358 + kernel_opts: console=tty0 console=ttyS0,115200n8 net.ifnames=0 nvme_core.io_timeout=4294967295 + legacy: i386-pc + uefi: + vendor: centos + unified: true + saved_entry: ffffffffffffffffffffffffffffffff-8-2.fk1.x86_64 + write_cmdline: false + config: + default: saved + - type: org.osbuild.systemd + options: + enabled_services: + - sshd + - NetworkManager + - nm-cloud-setup.service + - nm-cloud-setup.timer + - cloud-init + - cloud-init-local + - cloud-config + - cloud-final + - reboot.target + - tuned + default_target: multi-user.target + - type: org.osbuild.selinux + options: + file_contexts: etc/selinux/targeted/contexts/files/file_contexts + - name: image + build: name:build + stages: + - type: org.osbuild.truncate + options: + filename: image.raw + size: '10737418240' + - type: org.osbuild.sfdisk + options: + label: gpt + uuid: D209C89E-EA5E-4FBD-B161-B461CCE297E0 + partitions: + - bootable: true + size: 2048 + start: 2048 + type: 21686148-6449-6E6F-744E-656564454649 + uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549 + - size: 409600 + start: 4096 + type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B + uuid: 68B2905B-DF3E-4FB3-80FA-49D1E773AA33 + - size: 2097152 + start: 413696 + type: BC13C2FF-59E6-4262-A352-B275FD6F7172 + uuid: CB07C243-BC44-4717-853E-28852021225B + - size: 18460639 + start: 2510848 + type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + uuid: 6264D520-3FB9-423F-8AB8-7A0A8E3D3562 + devices: + device: + type: org.osbuild.loopback + options: + filename: image.raw + lock: true + - type: org.osbuild.mkfs.fat + options: + volid: 7B7795E7 + devices: + device: + type: org.osbuild.loopback + options: + filename: image.raw + start: 4096 + size: 409600 + lock: true + - type: org.osbuild.mkfs.xfs + options: + uuid: dbd21911-1c4e-4107-8a9f-14fe6e751358 + label: boot + devices: + device: + type: org.osbuild.loopback + options: + filename: image.raw + start: 413696 + size: 2097152 + lock: true + - type: org.osbuild.mkfs.xfs + options: + uuid: 9851898e-0b30-437d-8fad-51ec16c3697f + label: root + devices: + device: + type: org.osbuild.loopback + options: + filename: image.raw + start: 2510848 + size: 18460639 + lock: true + - type: org.osbuild.copy + inputs: + root-tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:os + options: + paths: + - from: input://root-tree/ + to: mount://-/ + devices: + '-': + type: org.osbuild.loopback + options: + filename: image.raw + start: 2510848 + size: 18460639 + boot: + type: org.osbuild.loopback + options: + filename: image.raw + start: 413696 + size: 2097152 + boot-efi: + type: org.osbuild.loopback + options: + filename: image.raw + start: 4096 + size: 409600 + mounts: + - name: '-' + type: org.osbuild.xfs + source: '-' + target: / + - name: boot + type: org.osbuild.xfs + source: boot + target: /boot + - name: boot-efi + type: org.osbuild.fat + source: boot-efi + target: /boot/efi + - type: org.osbuild.grub2.inst + options: + filename: image.raw + platform: i386-pc + location: 2048 + core: + type: mkimage + partlabel: gpt + filesystem: xfs + prefix: + type: partition + partlabel: gpt + number: 2 + path: /grub2 +sources: + org.osbuild.curl: + items: + sha256:02b2f585447caaaef59cc58cda1cbf6db27530690fdb13f747f3fdeb762c4b15: + url: https://example.com/repo/packages/dosfstools + sha256:04cb12e072878beef30b2e3560c39bf1cb0e5a8896a545e7f4bfb0ec777196b3: + url: https://example.com/repo/packages/exclude:iwl3160-firmware + sha256:0bdf1ef00f53398361ebaf915f0325ccdc0534447134ba8506a03c71f2c5c9e2: + url: https://example.com/repo/packages/exclude:ivtv-firmware + sha256:0dc67f06d4a10e86af05f9a118375a3509880de5c947f9eab6476900b50d0a39: + url: https://example.com/repo/packages/exclude:iwl6000g2a-firmware + sha256:19ba1894b231183f6dcfffd0adf9b657eb00ea33f1e002cfb04d1f1fc8e79b71: + url: https://example.com/repo/packages/exclude:iwl135-firmware + sha256:1a0970a720caab2869fc7eb436e6b7656fc7efbb24cfa72ae5b49e2f6acbd7ca: + url: https://example.com/repo/packages/redhat-release + sha256:1b11757d33424678ba2d9d6fbd9eb6293a7bfa196dca15a29af179af778c235d: + url: https://example.com/repo/packages/glibc + sha256:1ec523ebf26771bd12d4da16d6e041b9be98c6999ab8ad53afc8d82afb56e75c: + url: https://example.com/repo/packages/authselect-compat + sha256:21fb8eaa1cfa55dbc0ed009dc98fbbbc9de4ecaef53d51dc41ab1b0ae867ed49: + url: https://example.com/repo/packages/xfsprogs + sha256:28fc95b01c3d432a448ded25eb5aada86e12319fcb912666f67dd5eb97893933: + url: https://example.com/repo/packages/exclude:libertas-usb8388-firmware + sha256:2c19d6424bd57628cc917ad414752d0135eb9c333b6671568cca9f6c95b8a053: + url: https://example.com/repo/packages/langpacks-en + sha256:2c7fca95dbf12d65ab1b751c38e674a8003a18f288817d3f81081a13c7079d2a: + url: https://example.com/passed-arch:x86_64/passed-repo:/v2/mirror/public/el9/cs9-x86_64-rt + sha256:2de43b323b1e26fd256368050a89e6f1ab3ca1c7d469b67e134db4d5ffc7929d: + url: https://example.com/repo/packages/exclude:plymouth + sha256:3467780239fa16c778e73eaec177e764de52871964adf7f23b0b03c4b6384da6: + url: https://example.com/passed-arch:x86_64/passed-repo:/v2/mirror/public/el9/cs9-x86_64-appstream + sha256:35a69aa1faeaa821a35f576490244bd7755c226a55e1a93abd0e2b4c7e0401e8: + url: https://example.com/repo/packages/exclude:iwl7260-firmware + sha256:368f9ec3b56023c66a7e2a4bd2609dced16bbd5354833cbb3e2eec5c90462133: + url: https://example.com/repo/packages/gdisk + sha256:3993c379c029014a9c4b2adf5d23397b3c7421467a0cb3575ff925bb6f6329b0: + url: https://example.com/repo/packages/coreutils + sha256:3fc8516922a52d754083308fc413432652da40490b0a336294a5d765757be942: + url: https://example.com/repo/packages/cloud-init + sha256:443ad85c108c8acb279fc373255ff3444e54cc07c0af87a62962f0adcedd152a: + url: https://example.com/repo/packages/@core + sha256:476f3ccb0b9ae8b029e7105db14adf652095700dc1c8b87b8caaed29993aab27: + url: https://example.com/repo/packages/exclude:iwl105-firmware + sha256:48af68b2888775d102da39bebbe05cf07bca2f2ab9f1103dd19359d64083c70b: + url: https://example.com/repo/packages/python3-pyyaml + sha256:49e9285da13f2be02b3654b01e74cab5840b8c679f7ad4b528a9cf794d3d3e34: + url: https://example.com/repo/packages/exclude:dracut-config-rescue + sha256:4d0e0adebe4eb01e6db63dcdade819e617dc3c9dc412f2b08fed35ae421f8682: + url: https://example.com/repo/packages/exclude:libertas-sd8686-firmware + sha256:4e81068e88aa80ce2e9bea996a7f9e02244d06eef15c97e72ebb75b22c3ebfc5: + url: https://example.com/repo/packages/exclude:iwl6050-firmware + sha256:4eeb0ed8c3fbd5ac0b9a9800a8cc1347f80f14bb505b0df58aefd000f978b269: + url: https://example.com/repo/packages/exclude:iwl3945-firmware + sha256:5660f11783e742698cec671d45910e74342fe3e48ddf054f38c0828776b08d00: + url: https://example.com/repo/packages/dracut-config-generic + sha256:5ac0b916a6d093edc6b702b25864007a7746a1b737c882d5a8a6d1644d731e79: + url: https://example.com/repo/packages/exclude:iwl6000-firmware + sha256:5b1e08d9dde2b42e638ce3f27ebfeaf4ab4c6ccded49d48ea60382d290cd90f6: + url: https://example.com/repo/packages/exclude:alsa-firmware + sha256:5fdc7e383dc7e1b390e40c3012a2aa03978901c45f3597c1c239c51134d03dbe: + url: https://example.com/repo/packages/chrony + sha256:6923dd1bc0460082c5d55a831908c24a282860b7f1cd6c2b79cf1bc8857c639c: + url: https://example.com/repo/packages/kernel + sha256:782c4bb3c7a9beb41e451bceb3f4db6de6a331eb31ca76e6a64296251ba2fdb1: + url: https://example.com/repo/packages/exclude:iwl4965-firmware + sha256:7a5bd1ed08002bc08013ea55c7fffc61047042b3d0979471b6e34d5e5089d334: + url: https://example.com/repo/packages/redhat-release-eula + sha256:874ecbebddb9872c2fc949de3be7888f72ad3ae0e7847ee5ce0503c691503ad0: + url: https://example.com/repo/packages/exclude:iwl2000-firmware + sha256:8a1bf05d306aa663e856f3c450c8b2ddc6800116b818c7d3b65503cd89f7682a: + url: https://example.com/repo/packages/platform-python + sha256:8ec5e9e6f70bf1a0b5692ef948d1194bdb074342ed14045f9e84820367a98c6a: + url: https://example.com/repo/packages/xz + sha256:8ff8d40e4a4c726df40795e3134432ac66f7d055d54639c1026e341b6d2bd6e7: + url: https://example.com/repo/packages/rsync + sha256:90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb: + url: https://example.com/repo/packages/tar + sha256:9370ee4e95b7172989b9fd3f81860093529113ba42b69be340467d87a94bb253: + url: https://example.com/repo/packages/shim-x64 + sha256:93cd8e20fc07f08337cb9d9fa9996274658f6395574e874379c4c4157e922700: + url: https://example.com/repo/packages/policycoreutils + sha256:99fec328617e9bc972503d5ed4c4c93218a8c44649cdc875876fdfbba0be383a: + url: https://example.com/repo/packages/exclude:biosdevname + sha256:9a701ca1bcd3b07afca9ae5f17588a2048341e0bcdab2b5a81e10614d5ca2974: + url: https://example.com/repo/packages/exclude:iwl100-firmware + sha256:9e7ab438597fee20e16e8e441bed0ce966bd59e0fb993fa7c94be31fb1384d88: + url: https://example.com/repo/packages/rpm + sha256:a07b0a6df6f248078ebaf93e5bea115093f8a79e0a830e383b6c0b9f7f1605f5: + url: https://example.com/repo/packages/grub2-pc + sha256:a2e58f805ca848eb1fb0fb207656d11b77a96ab198244c8e7a3fa49ddc5aade6: + url: https://example.com/repo/packages/exclude:iwl6000g2b-firmware + sha256:a2f5883db78735971fd620c3e83fb7767bda931555991194501eea3533e879e8: + url: https://example.com/repo/packages/exclude:aic94xx-firmware + sha256:a77e9cdc1f34c916ec906e61eb889974e144e2e0a8dd613d191f5d877cf2774f: + url: https://example.com/repo/packages/cloud-utils-growpart + sha256:a918a8d5a29ea7c5834c6d46725660eb441653074ab4d9d8876029abce79bfb7: + url: https://example.com/repo/packages/exclude:iwl2030-firmware + sha256:aba407b81ed016841ea552feadaf0663c7804a64554ba55d3109b3dc8198cdcb: + url: https://example.com/repo/packages/tuned + sha256:bd0add6fdee6e6ac62a4ff6bc722f2324a918d8ccc4eda21e043252a10481f0c: + url: https://example.com/repo/packages/exclude:iwl5150-firmware + sha256:bf35d0b80342ad44ca298ed07fcc9d3f8d43a2700964586a4a5e2c0a49766528: + url: https://example.com/repo/packages/selinux-policy-targeted + sha256:c1cc69e61c0f1c7ade8df0f2994e582e7c1f2c57d1ec192a0baf9f96b7739d9d: + url: https://example.com/repo/packages/python3 + sha256:c71d1835b4ce161bb982d7bdefd5e082a6653e15c8b6e1bb684c989052212545: + url: https://example.com/passed-arch:x86_64/passed-repo:/v2/mirror/public/el9/cs9-x86_64-baseos + sha256:ce5857e0b504bd3e06f80b27dc88064f0bf214127dd5a2ee1ff849ed78e32c9e: + url: https://example.com/repo/packages/exclude:iwl5000-firmware + sha256:d8654f2a37c8dd45ed104e5b7c26ec3ee0d74dca488cdd0a400d58a6c4f7875b: + url: https://example.com/repo/packages/exclude:libertas-sd8787-firmware + sha256:d90b7202318ad799fdf7fc011a6a3d09cb586853981e5c53f381c771e0dc549a: + url: https://example.com/repo/packages/grub2 + sha256:dbf9956aa9c5ccd4c6d92f0550e959f58bb815fb570c305e9d93645eee2082d4: + url: https://example.com/repo/packages/grub2-efi-x64 + sha256:dc326a13b89447ad3251f78a5bd784808b85c64bc4fd380d2e9533ffa00428e2: + url: https://example.com/repo/packages/exclude:iwl1000-firmware + sha256:e0031c189e34e10d9c202fa8d75f72d3296a239164fe6b07e7dc206c7b723d98: + url: https://example.com/repo/packages/systemd + sha256:e0d9946d02c44f153131552ca5afa5cd0902d0446b0295a329964e78a345327c: + url: https://example.com/repo/packages/exclude:qemu-guest-agent + sha256:e2f24de304a49d3d3c1261466376ab341c3834eb683d806cb534587f4fd48f8d: + url: https://example.com/repo/packages/efibootmgr + sha256:eda2b1be19a5062fa55b669761df806f9aa4675223ed3cc9cce6eceaf0677939: + url: https://example.com/repo/packages/exclude:iprutils + sha256:f2b81e75c964a01a845829b272d95e864a2e271e4fcd409c5e7cf5a83de1f127: + url: https://example.com/repo/packages/exclude:alsa-lib + sha256:f6a50120d4a785cc75becb370680d24d452f1437c5064db8d22f510c75604a6d: + url: https://example.com/repo/packages/exclude:firewalld + sha256:fc710b8c27f067288ccb7779e98f7b04e7e0c84256260c93a69f68ad94b78fd8: + url: https://example.com/repo/packages/exclude:alsa-tools-firmware + sha256:fcb160b10ea6f210b8da239c09ea1b28cbcefefe1502486111fcd5ac6d8d99a6: + url: https://example.com/repo/packages/NetworkManager-cloud-setup + sha256:fe841d961c3a0038f8a5d15250baff1c2e8efee10e72292ceb5bab8f2633f694: + url: https://example.com/repo/packages/yum-utils + sha256:fed83cba0a72e3b9f6af32c0dbc2c45a0bde5ebcc0a8e4ca27678844d9b82c84: + url: https://example.com/repo/packages/dhcp-client diff --git a/test/data/images-ref/centos/9/x86_64/edge-commit/centos_9-x86_64-edge_commit-empty.yaml b/test/data/images-ref/centos/9/x86_64/edge-commit/empty/centos_9-x86_64-edge_commit-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/edge-commit/centos_9-x86_64-edge_commit-empty.yaml rename to test/data/images-ref/centos/9/x86_64/edge-commit/empty/centos_9-x86_64-edge_commit-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/image-installer/centos_9-x86_64-image_installer-empty.yaml b/test/data/images-ref/centos/9/x86_64/image-installer/empty/centos_9-x86_64-image_installer-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/image-installer/centos_9-x86_64-image_installer-empty.yaml rename to test/data/images-ref/centos/9/x86_64/image-installer/empty/centos_9-x86_64-image_installer-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/minimal-raw/centos_9-x86_64-minimal_raw-empty.yaml b/test/data/images-ref/centos/9/x86_64/minimal-raw/empty/centos_9-x86_64-minimal_raw-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/minimal-raw/centos_9-x86_64-minimal_raw-empty.yaml rename to test/data/images-ref/centos/9/x86_64/minimal-raw/empty/centos_9-x86_64-minimal_raw-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/oci/centos_9-x86_64-oci-empty.yaml b/test/data/images-ref/centos/9/x86_64/oci/empty/centos_9-x86_64-oci-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/oci/centos_9-x86_64-oci-empty.yaml rename to test/data/images-ref/centos/9/x86_64/oci/empty/centos_9-x86_64-oci-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/ova/centos_9-x86_64-ova-empty.yaml b/test/data/images-ref/centos/9/x86_64/ova/empty/centos_9-x86_64-ova-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/ova/centos_9-x86_64-ova-empty.yaml rename to test/data/images-ref/centos/9/x86_64/ova/empty/centos_9-x86_64-ova-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/qcow2/centos_9-x86_64-qcow2-empty.yaml b/test/data/images-ref/centos/9/x86_64/qcow2/empty/centos_9-x86_64-qcow2-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/qcow2/centos_9-x86_64-qcow2-empty.yaml rename to test/data/images-ref/centos/9/x86_64/qcow2/empty/centos_9-x86_64-qcow2-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/tar/centos_9-x86_64-tar-empty.yaml b/test/data/images-ref/centos/9/x86_64/tar/empty/centos_9-x86_64-tar-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/tar/centos_9-x86_64-tar-empty.yaml rename to test/data/images-ref/centos/9/x86_64/tar/empty/centos_9-x86_64-tar-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/vhd/centos_9-x86_64-vhd-empty.yaml b/test/data/images-ref/centos/9/x86_64/vhd/empty/centos_9-x86_64-vhd-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/vhd/centos_9-x86_64-vhd-empty.yaml rename to test/data/images-ref/centos/9/x86_64/vhd/empty/centos_9-x86_64-vhd-empty.yaml diff --git a/test/data/images-ref/centos/9/x86_64/vmdk/centos_9-x86_64-vmdk-empty.yaml b/test/data/images-ref/centos/9/x86_64/vmdk/empty/centos_9-x86_64-vmdk-empty.yaml similarity index 100% rename from test/data/images-ref/centos/9/x86_64/vmdk/centos_9-x86_64-vmdk-empty.yaml rename to test/data/images-ref/centos/9/x86_64/vmdk/empty/centos_9-x86_64-vmdk-empty.yaml diff --git a/test/data/images-ref/fedora/40/aarch64/minimal-raw/fedora_40-aarch64-minimal_raw-empty.yaml b/test/data/images-ref/fedora/40/aarch64/minimal-raw/empty/fedora_40-aarch64-minimal_raw-empty.yaml similarity index 100% rename from test/data/images-ref/fedora/40/aarch64/minimal-raw/fedora_40-aarch64-minimal_raw-empty.yaml rename to test/data/images-ref/fedora/40/aarch64/minimal-raw/empty/fedora_40-aarch64-minimal_raw-empty.yaml diff --git a/test/data/images-ref/fedora/40/x86_64/minimal-raw/fedora_40-x86_64-minimal_raw-empty.yaml b/test/data/images-ref/fedora/40/x86_64/minimal-raw/empty/fedora_40-x86_64-minimal_raw-empty.yaml similarity index 100% rename from test/data/images-ref/fedora/40/x86_64/minimal-raw/fedora_40-x86_64-minimal_raw-empty.yaml rename to test/data/images-ref/fedora/40/x86_64/minimal-raw/empty/fedora_40-x86_64-minimal_raw-empty.yaml diff --git a/test/data/images-ref/gen-image-def b/test/data/images-ref/gen-image-def index 7c3ddca3..d389c5b5 100755 --- a/test/data/images-ref/gen-image-def +++ b/test/data/images-ref/gen-image-def @@ -11,6 +11,20 @@ import tempfile import yaml +# XXX: keep in syncwith "test_against_images_ref.py" +# note that the names of customizations/modifications may not fully match +full_customizations = { + "name": "full", + "blueprint": { + "customizations": { + "locale": { + "languages": ["nl_NL.UTF-8"], + }, + }, + }, +} + + # see https://github.com/yaml/pyyaml/issues/234#issuecomment-765894586 class Dumper(yaml.Dumper): # pylint: disable=too-many-ancestors def increase_indent(self, flow: bool = False, indentless: bool = False) -> None: @@ -27,10 +41,23 @@ def uuid_for_path(path, osbuild_manifest): return "" -def generate_reference_image(images_base_dir: str, distro_name: str, distro_ver: str, arch: str, img_type: str) -> None: +def make_buildconfig(customizations: str) -> dict: + match customizations: + case "empty": + return {"name": "empty"} + case "full": + return full_customizations + case _: + raise ValueError(f"unknown customization {customizations}") + + +# pylint: disable=too-many-arguments +def generate_reference_image(images_base_dir: str, distro_name: str, + distro_ver: str, arch: str, img_type: str, + customizations: str) -> None: # pylint: disable=consider-using-with empty_config = tempfile.NamedTemporaryFile() - empty_config.write(b'{"name": "empty"}') + empty_config.write(json.dumps(make_buildconfig(customizations)).encode()) empty_config.flush() # ideally we would just generate all manifests on the fly but today @@ -40,7 +67,7 @@ def generate_reference_image(images_base_dir: str, distro_name: str, distro_ver: env = os.environ.copy() env["OSBUILD_TESTING_RNG_SEED"] = "0" distro = f"{distro_name}-{distro_ver}" - manifest_path = pathlib.Path.cwd() / distro_name / distro_ver / arch / img_type + manifest_path = pathlib.Path.cwd() / distro_name / distro_ver / arch / img_type / customizations manifest_path.parent.mkdir(parents=True, exist_ok=True) subprocess.check_call([ "cmd/gen-manifests/gen-manifests", @@ -52,7 +79,7 @@ def generate_reference_image(images_base_dir: str, distro_name: str, distro_ver: "-types", img_type, "-config", empty_config.name, ], cwd=images_base_dir, env=env) - generated = list(manifest_path.glob("*.json")) + generated = list(manifest_path.glob(f"*-{customizations}.json")) if len(generated) != 1: raise ValueError(f"unexpected number of generated manifests: {generated}") with open(generated[0], encoding="utf8") as fp: @@ -78,13 +105,13 @@ def generate_reference_image(images_base_dir: str, distro_name: str, distro_ver: def run(): # TODO: add argparse - if len(sys.argv) < 5: + if len(sys.argv) < 6: # TODO: remove images-git-checkout parameter and use something # like "go run github.com/osbuild/images/cmd/build@latest" but # this needs something like https://github.com/osbuild/images/pull/902 - print("need argument", file=sys.stderr) + print("need ", file=sys.stderr) sys.exit(1) - generate_reference_image(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5]) + generate_reference_image(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6]) if __name__ == "__main__": diff --git a/test/test_against_images_refs.py b/test/test_against_images_refs.py index 5d43792b..dbbc4e0e 100644 --- a/test/test_against_images_refs.py +++ b/test/test_against_images_refs.py @@ -1,6 +1,7 @@ import json import os import pathlib +import textwrap import yaml import pytest @@ -14,21 +15,22 @@ class _TestCase: def __init__(self, base, ref_yaml_path): self.ref_yaml_path = ref_yaml_path rel = self.ref_yaml_path.relative_to(base) - # dir structure is /// - self.distro_name, self.distro_ver, self.arch, self.img_type, _ = rel.as_posix().split("/") + # dir structure is //// + self.distro_name, self.distro_ver, self.arch, self.img_type, self.customizations, _ = rel.as_posix().split("/") def as_example_yaml(self): # keep in sync with our "example" folder - return f"example/{self.distro_name}/{self}.yaml" + p = pathlib.Path(__file__).parent.parent + return p / f"example/{self.distro_name}/{self.distro_name}-{self.distro_ver}-{self.arch}-{self.img_type}.yaml" def __str__(self): - return f"{self.distro_name}-{self.distro_ver}-{self.arch}-{self.img_type}" + return f"{self.distro_name}-{self.distro_ver}-{self.arch}-{self.img_type}-{self.customizations}" -def reference_manifests(): +def reference_manifests(customizations: str) -> list: tc = [] base = TEST_DATA_PATH / "images-ref" - for path in base.glob("*/*/*/*/*.yaml"): + for path in base.glob(f"*/*/*/*/{customizations}/*.yaml"): tc.append(_TestCase(base, path)) return tc @@ -77,8 +79,8 @@ def test_normalize_rpm_refs(): {"id": "sha256:111"}, {"id": "sha256:222"}] -@pytest.mark.parametrize("tc", reference_manifests()) -def test_images_ref(tmp_path, monkeypatch, tc): +@pytest.mark.parametrize("tc", reference_manifests("empty")) +def test_images_ref_no_customizations(tmp_path, monkeypatch, tc): monkeypatch.setenv("OSBUILD_TESTING_RNG_SEED", "0") monkeypatch.setenv("OTK_EXTERNAL_PATH", "./external") monkeypatch.setenv("OTK_UNDER_TEST", "1") @@ -90,7 +92,40 @@ def test_images_ref(tmp_path, monkeypatch, tc): otk_json = tmp_path / "manifest-otk.json" run(["compile", "-o", os.fspath(otk_json), - tc.as_example_yaml(), + os.fspath(tc.as_example_yaml()), + ]) + with otk_json.open() as fp: + manifest = json.load(fp) + normalize_rpm_refs(manifest) + + assert manifest == ref_manifest + + +@pytest.mark.parametrize("tc", reference_manifests("full")) +def test_images_ref_full_customizations(tmp_path, monkeypatch, tc): + monkeypatch.setenv("OSBUILD_TESTING_RNG_SEED", "0") + monkeypatch.setenv("OTK_EXTERNAL_PATH", "./external") + monkeypatch.setenv("OTK_UNDER_TEST", "1") + + input_otk_path = tmp_path / "input.otk" + # keep in sync with "gen-images-ref" + with input_otk_path.open("w") as fp: + fp.write(textwrap.dedent(f""" + otk.define: + user: + modifications: + locale: nl_NL.UTF-8 + otk.include: {tc.as_example_yaml()} + """)) + + with tc.ref_yaml_path.open() as fp: + ref_manifest = yaml.safe_load(fp) + normalize_rpm_refs(ref_manifest) + + otk_json = tmp_path / "manifest-otk.json" + run(["compile", + "-o", os.fspath(otk_json), + os.fspath(input_otk_path), ]) with otk_json.open() as fp: manifest = json.load(fp)