test/run/boot: migrate to a v2 manifest
This commit migrates the test to a brand new V2, F38-based manifest. It's actually based on osbuild-composer interpretation of the Fedora Cloud Base image.
This commit is contained in:
parent
cf00c5b214
commit
e4933b4fd6
4 changed files with 2022 additions and 1163 deletions
1
Makefile
1
Makefile
|
|
@ -213,7 +213,6 @@ $(TEST_MANIFESTS_GEN): %.json: %.mpp.yaml
|
||||||
$(SRCDIR)/tools/osbuild-mpp -I "$(SRCDIR)/test/data/manifests" "$<" "$@"
|
$(SRCDIR)/tools/osbuild-mpp -I "$(SRCDIR)/test/data/manifests" "$<" "$@"
|
||||||
|
|
||||||
$(SRCDIR)/test/data/manifests/f34-base.json: $(SRCDIR)/test/data/manifests/f34-build.json
|
$(SRCDIR)/test/data/manifests/f34-base.json: $(SRCDIR)/test/data/manifests/f34-build.json
|
||||||
$(SRCDIR)/test/data/manifests/fedora-boot.json: $(SRCDIR)/test/data/manifests/f34-build.json
|
|
||||||
$(SRCDIR)/test/data/manifests/filesystem.json: $(SRCDIR)/test/data/manifests/f34-build.json
|
$(SRCDIR)/test/data/manifests/filesystem.json: $(SRCDIR)/test/data/manifests/f34-build.json
|
||||||
|
|
||||||
.PHONY: test-data
|
.PHONY: test-data
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,70 +1,231 @@
|
||||||
mpp-vars:
|
# Taken from osbuild/images 3314f4c9fc
|
||||||
arch: x86_64
|
# Noticed the org.osbuild.test that was added.
|
||||||
release: 34
|
|
||||||
releasever: f$release
|
version: '2'
|
||||||
snapshot: '20210512'
|
pipelines:
|
||||||
pipeline:
|
- mpp-import-pipelines:
|
||||||
build:
|
path: fedora-vars.ipp.yaml
|
||||||
mpp-import-pipeline:
|
- mpp-import-pipeline:
|
||||||
path: fedora-build.mpp.yaml
|
path: fedora-build-v2.ipp.yaml
|
||||||
|
id: build
|
||||||
runner:
|
runner:
|
||||||
mpp-format-string: org.osbuild.fedora{release}
|
mpp-format-string: org.osbuild.fedora{release}
|
||||||
stages:
|
- name: os
|
||||||
- name: org.osbuild.kernel-cmdline
|
build: name:build
|
||||||
options:
|
stages:
|
||||||
root_fs_uuid: 76a22bf4-f153-4541-b6c7-0332c0dfaeac
|
- type: org.osbuild.kernel-cmdline
|
||||||
kernel_opts: ro biosdevname=0 net.ifnames=0
|
options:
|
||||||
- name: org.osbuild.rpm
|
root_fs_uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
|
||||||
options:
|
kernel_opts: ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0
|
||||||
gpgkeys:
|
- type: org.osbuild.rpm
|
||||||
- "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBF1RVqsBEADWMBqYv/G1r4PwyiPQCfg5fXFGXV1FCZ32qMi9gLUTv1CX7rYy\nH4Inj93oic+lt1kQ0kQCkINOwQczOkm6XDkEekmMrHknJpFLwrTK4AS28bYF2RjL\nM+QJ/dGXDMPYsP0tkLvoxaHr9WTRq89A+AmONcUAQIMJg3JxXAAafBi2UszUUEPI\nU35MyufFt2ePd1k/6hVAO8S2VT72TxXSY7Ha4X2J0pGzbqQ6Dq3AVzogsnoIi09A\n7fYutYZPVVAEGRUqavl0th8LyuZShASZ38CdAHBMvWV4bVZghd/wDV5ev3LXUE0o\nitLAqNSeiDJ3grKWN6v0qdU0l3Ya60sugABd3xaE+ROe8kDCy3WmAaO51Q880ZA2\niXOTJFObqkBTP9j9+ZeQ+KNE8SBoiH1EybKtBU8HmygZvu8ZC1TKUyL5gwGUJt8v\nergy5Bw3Q7av520sNGD3cIWr4fBAVYwdBoZT8RcsnU1PP67NmOGFcwSFJ/LpiOMC\npZ1IBvjOC7KyKEZY2/63kjW73mB7OHOd18BHtGVkA3QAdVlcSule/z68VOAy6bih\nE6mdxP28D4INsts8w6yr4G+3aEIN8u0qRQq66Ri5mOXTyle+ONudtfGg3U9lgicg\nz6oVk17RT0jV9uL6K41sGZ1sH/6yTXQKagdAYr3w1ix2L46JgzC+/+6SSwARAQAB\ntDFGZWRvcmEgKDMyKSA8ZmVkb3JhLTMyLXByaW1hcnlAZmVkb3JhcHJvamVjdC5v\ncmc+iQI4BBMBAgAiBQJdUVarAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK\nCRBsEwJtEslE0LdAD/wKdAMtfzr7O2y06/sOPnrb3D39Y2DXbB8y0iEmRdBL29Bq\n5btxwmAka7JZRJVFxPsOVqZ6KARjS0/oCBmJc0jCRANFCtM4UjVHTSsxrJfuPkel\nvrlNE9tcR6OCRpuj/PZgUa39iifF/FTUfDgh4Q91xiQoLqfBxOJzravQHoK9VzrM\nNTOu6J6l4zeGzY/ocj6DpT+5fdUO/3HgGFNiNYPC6GVzeiA3AAVR0sCyGENuqqdg\nwUxV3BIht05M5Wcdvxg1U9x5I3yjkLQw+idvX4pevTiCh9/0u+4g80cT/21Cxsdx\n7+DVHaewXbF87QQIcOAing0S5QE67r2uPVxmWy/56TKUqDoyP8SNsV62lT2jutsj\nLevNxUky011g5w3bc61UeaeKrrurFdRs+RwBVkXmtqm/i6g0ZTWZyWGO6gJd+HWA\nqY1NYiq4+cMvNLatmA2sOoCsRNmE9q6jM/ESVgaH8hSp8GcLuzt9/r4PZZGl5CvU\neldOiD221u8rzuHmLs4dsgwJJ9pgLT0cUAsOpbMPI0JpGIPQ2SG6yK7LmO6HFOxb\nAkz7IGUt0gy1MzPTyBvnB+WgD1I+IQXXsJbhP5+d+d3mOnqsd6oDM/grKBzrhoUe\noNadc9uzjqKlOrmrdIR3Bz38SSiWlde5fu6xPqJdmGZRNjXtcyJlbSPVDIloxw==\n=QWRO\n-----END PGP PUBLIC KEY BLOCK-----\n"
|
inputs:
|
||||||
mpp-depsolve:
|
|
||||||
architecture: $arch
|
|
||||||
module-platform-id: $releasever
|
|
||||||
releasever: $releasever
|
|
||||||
repos:
|
|
||||||
- id: default
|
|
||||||
baseurl: https://rpmrepo.osbuild.org/v2/mirror/public/$releasever/$releasever-$arch-fedora-$snapshot/
|
|
||||||
packages:
|
packages:
|
||||||
- '@cloud-server-environment'
|
type: org.osbuild.files
|
||||||
- chrony
|
origin: org.osbuild.source
|
||||||
- dracut-config-generic
|
mpp-depsolve:
|
||||||
- grub2-pc
|
architecture: $arch
|
||||||
- kernel-core
|
module-platform-id: $module_platform_id
|
||||||
- langpacks-en
|
repos:
|
||||||
- polkit
|
mpp-eval: repos
|
||||||
- selinux-policy-targeted
|
packages:
|
||||||
- systemd-udev
|
- "@Fedora Cloud Server"
|
||||||
- name: org.osbuild.locale
|
- chrony
|
||||||
options:
|
- langpacks-en
|
||||||
language: en_US.UTF-8
|
- qemu-guest-agent
|
||||||
- name: org.osbuild.fstab
|
- kernel-core
|
||||||
options:
|
excludes:
|
||||||
filesystems:
|
- dracut-config-rescue
|
||||||
- uuid: 76a22bf4-f153-4541-b6c7-0332c0dfaeac
|
- firewalld
|
||||||
vfs_type: ext4
|
- geolite2-city
|
||||||
path: /
|
- geolite2-country
|
||||||
freq: 1
|
- plymouth
|
||||||
passno: 1
|
options:
|
||||||
- name: org.osbuild.grub2
|
gpgkeys:
|
||||||
options:
|
mpp-eval: gpgkeys
|
||||||
root_fs_uuid: 76a22bf4-f153-4541-b6c7-0332c0dfaeac
|
exclude:
|
||||||
legacy: i386-pc
|
docs: true
|
||||||
saved_entry:
|
install_langs:
|
||||||
mpp-format-string: '{''f''*32}-{rpms[''stages''][''kernel-core''].evra}'
|
- en_US
|
||||||
write_cmdline: false
|
- type: org.osbuild.fix-bls
|
||||||
- name: org.osbuild.test
|
options:
|
||||||
options:
|
prefix: ''
|
||||||
script: /usr/bin/systemctl is-system-running --wait
|
- type: org.osbuild.locale
|
||||||
- name: org.osbuild.selinux
|
options:
|
||||||
options:
|
language: en_US
|
||||||
file_contexts: etc/selinux/targeted/contexts/files/file_contexts
|
- type: org.osbuild.hostname
|
||||||
- name: org.osbuild.fix-bls
|
options:
|
||||||
assembler:
|
hostname: localhost.localdomain
|
||||||
name: org.osbuild.qemu
|
- type: org.osbuild.timezone
|
||||||
options:
|
options:
|
||||||
format: qcow2
|
zone: UTC
|
||||||
filename: fedora-boot.qcow2
|
- type: org.osbuild.fstab
|
||||||
ptuuid: '0x1cd1d44b'
|
options:
|
||||||
root_fs_uuid: 76a22bf4-f153-4541-b6c7-0332c0dfaeac
|
filesystems:
|
||||||
size: 3221225472
|
- uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
|
||||||
|
vfs_type: ext4
|
||||||
|
path: /
|
||||||
|
options: defaults
|
||||||
|
- uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8
|
||||||
|
vfs_type: ext4
|
||||||
|
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: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
|
||||||
|
boot_fs_uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8
|
||||||
|
kernel_opts: ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0
|
||||||
|
legacy: i386-pc
|
||||||
|
uefi:
|
||||||
|
vendor: fedora
|
||||||
|
unified: true
|
||||||
|
saved_entry:
|
||||||
|
mpp-format-string: 'ffffffffffffffffffffffffffffffff-{rpms[''os''][''kernel-core''].evra}'
|
||||||
|
write_cmdline: false
|
||||||
|
config:
|
||||||
|
default: saved
|
||||||
|
- type: org.osbuild.systemd
|
||||||
|
options:
|
||||||
|
enabled_services:
|
||||||
|
- cloud-init.service
|
||||||
|
- cloud-config.service
|
||||||
|
- cloud-final.service
|
||||||
|
- cloud-init-local.service
|
||||||
|
default_target: multi-user.target
|
||||||
|
- type: org.osbuild.test
|
||||||
|
options:
|
||||||
|
script: /usr/bin/systemctl is-system-running --wait
|
||||||
|
- 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: disk.img
|
||||||
|
size: '5368709120'
|
||||||
|
- 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: 1024000
|
||||||
|
start: 413696
|
||||||
|
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
|
||||||
|
uuid: CB07C243-BC44-4717-853E-28852021225B
|
||||||
|
- size: 9048031
|
||||||
|
start: 1437696
|
||||||
|
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
|
||||||
|
uuid: 6264D520-3FB9-423F-8AB8-7A0A8E3D3562
|
||||||
|
devices:
|
||||||
|
device:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
lock: true
|
||||||
|
- type: org.osbuild.mkfs.fat
|
||||||
|
options:
|
||||||
|
volid: 7B7795E7
|
||||||
|
devices:
|
||||||
|
device:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
start: 4096
|
||||||
|
size: 409600
|
||||||
|
lock: true
|
||||||
|
- type: org.osbuild.mkfs.ext4
|
||||||
|
options:
|
||||||
|
uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8
|
||||||
|
label: boot
|
||||||
|
devices:
|
||||||
|
device:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
start: 413696
|
||||||
|
size: 1024000
|
||||||
|
lock: true
|
||||||
|
- type: org.osbuild.mkfs.ext4
|
||||||
|
options:
|
||||||
|
uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
|
||||||
|
label: root
|
||||||
|
devices:
|
||||||
|
device:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
start: 1437696
|
||||||
|
size: 9048031
|
||||||
|
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://root/
|
||||||
|
devices:
|
||||||
|
boot:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
start: 413696
|
||||||
|
size: 1024000
|
||||||
|
boot.efi:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
start: 4096
|
||||||
|
size: 409600
|
||||||
|
root:
|
||||||
|
type: org.osbuild.loopback
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
start: 1437696
|
||||||
|
size: 9048031
|
||||||
|
mounts:
|
||||||
|
- name: root
|
||||||
|
type: org.osbuild.ext4
|
||||||
|
source: root
|
||||||
|
target: /
|
||||||
|
- name: boot
|
||||||
|
type: org.osbuild.ext4
|
||||||
|
source: boot
|
||||||
|
target: /boot
|
||||||
|
- name: boot.efi
|
||||||
|
type: org.osbuild.fat
|
||||||
|
source: boot.efi
|
||||||
|
target: /boot/efi
|
||||||
|
- type: org.osbuild.grub2.inst
|
||||||
|
options:
|
||||||
|
filename: disk.img
|
||||||
|
platform: i386-pc
|
||||||
|
location: 2048
|
||||||
|
core:
|
||||||
|
type: mkimage
|
||||||
|
partlabel: gpt
|
||||||
|
filesystem: ext4
|
||||||
|
prefix:
|
||||||
|
type: partition
|
||||||
|
partlabel: gpt
|
||||||
|
number: 2
|
||||||
|
path: /grub2
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ class TestBoot(test.TestBase):
|
||||||
|
|
||||||
with self.osbuild as osb:
|
with self.osbuild as osb:
|
||||||
with tempfile.TemporaryDirectory(dir="/var/tmp") as temp_dir:
|
with tempfile.TemporaryDirectory(dir="/var/tmp") as temp_dir:
|
||||||
osb.compile_file(manifest, output_dir=temp_dir, exports=["assembler"])
|
osb.compile_file(manifest, output_dir=temp_dir, exports=["image"])
|
||||||
qcow2 = os.path.join(temp_dir, "assembler", "fedora-boot.qcow2")
|
image = os.path.join(temp_dir, "image", "disk.img")
|
||||||
output_file = os.path.join(temp_dir, "output")
|
output_file = os.path.join(temp_dir, "output")
|
||||||
|
|
||||||
subprocess.run(["qemu-system-x86_64",
|
subprocess.run(["qemu-system-x86_64",
|
||||||
|
|
@ -45,7 +45,7 @@ class TestBoot(test.TestBase):
|
||||||
"-device", "virtio-serial",
|
"-device", "virtio-serial",
|
||||||
"-device", "virtserialport,chardev=stdio",
|
"-device", "virtserialport,chardev=stdio",
|
||||||
|
|
||||||
qcow2],
|
image],
|
||||||
encoding="utf8",
|
encoding="utf8",
|
||||||
check=True)
|
check=True)
|
||||||
with open(output_file, "r", encoding="utf8") as f:
|
with open(output_file, "r", encoding="utf8") as f:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue