Skip to content

bootc: add integration test for disk.yaml (HMS-9295)#1835

Closed
mvo5 wants to merge 5 commits into
osbuild:mainfrom
mvo5:origin/bootc-build-imgref-test-3
Closed

bootc: add integration test for disk.yaml (HMS-9295)#1835
mvo5 wants to merge 5 commits into
osbuild:mainfrom
mvo5:origin/bootc-build-imgref-test-3

Conversation

@mvo5

@mvo5 mvo5 commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

[based on https://github.com//pull/1828]

This commit adds support to test for disk.yaml

/jira-epic HMS-8839

JIRA: HMS-9295

mvo5 added 5 commits September 4, 2025 14:30
This commit adds a new `randutil.String()` helper
that will generate a random lower/upper/digest/symbols
string by default.

The implements is inspired by pythons random.choice(),
i.e. it is possible to pass a different set of strings
to generate the a way to generate the random string
from. This is useful to generate random container
IDs for example.
We have a more generic way of doing random strings now
so lets use it.
This commit introduces a fake bootc container that contains
just enough content to simulate a bootc image. It is based
on a "FROM scartch" container and does not require a network
connection. It will build a static go binary to provide the
"sleep" binary and the "bootc" binary that is expected by
the bootc introspection code in images.

The code to geneate fake bootc containers is put into
pkg/distro/bootc/bootctest
and can potentially be reused for manifest tests and
for ibcli/bib.

Thanks to Alex for suggesting the static go binary.
This commit adds support to test for disk.yaml
@schutzbot schutzbot changed the title bootc: add integration test for disk.yaml bootc: add integration test for disk.yaml (HMS-9295) Sep 5, 2025

manifestJson := genManifest(t, imgType)
// XXX: test a bit more in-depth
assert.Contains(t, manifestJson, "org.osbuild.write-device")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also try with build-container and ensure it writes the file from the right pipeline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in #1845

@mvo5 mvo5 closed this Sep 8, 2025
@mvo5 mvo5 deleted the origin/bootc-build-imgref-test-3 branch September 8, 2025 11:02
@mvo5

mvo5 commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

I messed up the branch name and then when renaming GH just closed it :/ The updated version is now in #1845

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants