Skip to content

Add boot tests (HMS-10336)#85

Draft
thozza wants to merge 16 commits intoosbuild:mainfrom
thozza:HMS-10336
Draft

Add boot tests (HMS-10336)#85
thozza wants to merge 16 commits intoosbuild:mainfrom
thozza:HMS-10336

Conversation

@thozza
Copy link
Copy Markdown
Member

@thozza thozza commented May 6, 2026

WIP

thozza added 2 commits May 6, 2026 16:09
The Schutzfile pins the images library commit that the boot test
infrastructure uses. The update script fetches the latest commit
from GitHub and updates the ref, mirroring the pattern from the
images library's update-schutzfile-osbuild.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Clone the images library at the Schutzfile-pinned ref, then
delegate to its setup-osbuild-repo (which auto-detects the host
distro and reads the per-distro osbuild commit from the images
library's own Schutzfile) and install-dependencies scripts.
The images repo URL is overridable via IMAGES_REPO_URL for
cross-testing with draft PRs in the images library.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
@thozza thozza force-pushed the HMS-10336 branch 5 times, most recently from e54db94 to 075bad4 Compare May 6, 2026 19:15
Build a container from a Containerfile into local podman storage
at localhost/bootc-foundry/<name>:latest. This script is isolated
from build.sh so the container source can be swapped to a registry
pull without changing the build logic.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
thozza added 13 commits May 6, 2026 21:43
Build a disk image using the images library's cmd/build tool.
Create the build config JSON (with optional installer payload
ref), invoke cmd/build with the bootc container ref, and write
info.json into the output directory for boot-image to consume.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Discover the build output directory and config, then delegate to
the images library's boot-image script. boot-image reads info.json
to determine the boot method (QEMU, ISO, cloud) and runs
check-host-config for post-boot validation.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Add scripts that update GitHub PR with the GitLab CI pipeline status and
unregister a RHEL host. Also add the file with terraform ref and also
team SSH keys, which get configured as trusted on the CI runner. These
files were taken from the osbuild/images and osbuild/osbuild-composer
repositories and amended for the use in this repo.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Parse COPY directives from Containerfiles to extract directory
paths for CI change detection rules. Handle arch-specific
substitution of ${TARGETARCH}, skip heredoc and file copies,
and deduplicate directory references.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Build change rules from parsed COPY directives, compose CI job
dictionaries with runner tags and script sections, and assemble
the full GitLab CI config. Installer entries with a payload
containerfile get extra container build steps and expanded
change detection rules.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Wire up main() to read config, parse all referenced
Containerfiles, generate CI jobs, and emit YAML to stdout.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Define the central test matrix for boot tests. Each distro maps to
a list of Containerfiles with their target image type and supported
architectures. The generator reads this to produce the GitLab CI
configuration.

The osbuild/images CI runs only on Fedora. As a consequence, it uses
packages for boot-testing, which are not available on RHEL or CentOS
Stream. To not complicate the setup in this repository, let's use
Fedora runner as well for all distros. For the purpose of boot-testing
the disk images built from derived containers, there is no downside in
doing it all on Fedora.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Building RHEL derived bootc container images needs accessing RHEL
repositories to install additional packages. Add a
subscription-needed flag to the test config, propagate it as a CI
variable, and register the system with subscription-manager when
the flag is set.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Generated from test/config.yml by test/generate_ci.py. This file
is committed so it is reviewable in PRs. Regenerate with
'python3 test/generate_ci.py > .gitlab-ci.yml' after changing
the config or generator.

Update .yamllint.yaml to use consistent 2-space indentation for
sequences, matching PyYAML's default output format. This ensures
the generated .gitlab-ci.yml passes yamllint validation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Regenerate .gitlab-ci.yml on every PR that touches the config,
generator, or the CI file itself, and fail if the result differs
from what is committed. This catches forgotten regeneration after
config or generator changes.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Automatically fetch the latest images library main branch
commit, update the Schutzfile ref, and open a PR. The resulting
PR triggers the normal GitLab CI pipeline so the updated images
library version is boot-tested before merging.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Add 'make test' to run the generator unit tests and 'make
generate-ci' to regenerate .gitlab-ci.yml from the test config.

Assisted-by: Claude Code
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Comment thread test/test_generate_ci.py
[
"COPY qcow2-${TARGETARCH}/usr/ /usr/",
"COPY stream10-qcow2 /root/Containerfile",
],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not do any string fixtures when the final goal is to actually boot the image and check it there. Since podman is part of the base image, this can be as efficient and simple as: podman build --dry-run /root/Containerfile

Btw currently it does not build correctly, I am finishing a PR where it will be fixed for all containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants