1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00
Commit Graph

57 Commits

Author SHA1 Message Date
Xiaofeng Wang
fece2e0b58 test: Fix bib test failure and add required package in bib test
error: cannot build manifest: no default fs set: mount "/boot"
requires a filesystem but none set

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2026-01-23 07:01:44 -05:00
Colin Walters
4301c89784 build-sys: Rework sealing to be one build step
Now that we're doing a "from scratch" build we don't
have the mtime issue, and so we can change our build system
to do everything in a single step.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-21 19:15:05 -05:00
Xiaofeng Wang
228704349c test: Add test required packages in Packit provision
install-to-filesystem-var-mount test requires packages which should
be built into image for Packit provision (system-reinstall-bootc on
package mode testing farm runner)

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2026-01-21 07:33:02 -05:00
Colin Walters
27487f1145 build-sys: Avoid propagating local perms into /usr
The `cp -a lbi/usr/. /usr` command was preserving local directory
permissions which in one case for me have a restrictive mode 0750
which breaks booting.

Switch to `install -D -m 0644` which explicitly sets file modes and
creates parent directories with correct 755 permissions, while also
simplifying the directory structure.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-12 19:52:34 +01:00
Colin Walters
a6c87c6667 build-sys: Remove separate integration test image
The previous commit consolidated test content (nushell, cloud-init, etc.)
into the base image. This completes that work by removing the separate
`build-integration-test-image` target and updating all references.

Now `just build` produces the complete test-ready image directly,
simplifying the build pipeline and eliminating the intermediate
`localhost/bootc-integration` image.

Also adds SKIP_CONFIGS support for the coreos testing workflow, which
skips LBIs, test kargs, and install configs that would conflict with FCOS.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-01-08 14:34:23 +01:00
Colin Walters
f1a7624542 build-sys: Consolidate test image content into base
Move all content from the derived test image (hack/Containerfile) into
the main Dockerfile base image. This includes nushell, cloud-init, and
the other testing packages from packages.txt.

This simplifies the build by avoiding the need to juggle multiple images
during testing workflows - the base image now contains everything needed.

Assisted-by: OpenCode (Claude Sonnet 4)
Signed-off-by: Colin Walters <walters@verbum.org>

# Conflicts:
#	hack/Containerfile
2026-01-08 14:34:23 +01:00
Huijing Hei
44b1ccca57 tests: Add test test-tmt-on-coreos
To workaround https://github.com/bootc-dev/bcvk/issues/174, will
build `bootc-integration-coreos` container firstly and save it to
`bootc.tar`, then load it to install.

Signed-off-by: Huijing Hei <hhei@redhat.com>
2026-01-06 17:17:18 +01:00
John Eckersberg
72f1f2720d container: Add path-based compute-composefs-digest command
Add a new `bootc container compute-composefs-digest` command that computes
the bootable composefs digest directly from a filesystem directory path,
defaulting to `/target`. This enables computing digests in container
environments without requiring access to container storage or a booted
host system.

The existing container-storage-based behavior is preserved and renamed
to `compute-composefs-digest-from-storage` (hidden). The `hack/compute-composefs-digest`
script is updated to use the renamed command.

The core digest computation logic is extracted into a new
`bootc_composefs::digest` module with:
- `new_temp_composefs_repo()` helper for DRY temp repository creation
- `compute_composefs_digest()` function with "/" path rejection

Unit tests and an integration test verify the command works correctly,
producing valid SHA-512 hex digests with consistent results across
multiple invocations. Exact digest values are not asserted due to
environmental variations (SELinux labels, timestamps, etc.).

Closes: https://github.com/bootc-dev/bootc/issues/1862

Assisted-by: OpenCode (Claude Opus 4.5)
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-12-18 19:45:22 -05:00
Anish Bhatt
be96cacb9a Silence cloud-init warnings
Silence cloud-init warnings about resizing rootfs. More discussion in https://gitlab.com/fedora/bootc/examples/-/merge_requests/78

Signed-off-by: Anish Bhatt <anish.7@gmail.com>
2025-12-18 14:39:36 -05:00
Colin Walters
3efcbddeb3 lib: Fix bootc status on non-bootc systems
Previously, `BootedStorage::new()` unconditionally tried to open
`/sysroot` before checking the environment type. This caused
`bootc status` to fail on non-ostree/composefs systems.

(We did work in containers and we had tests for that; but
 the container case is special cased even earlier)

Fixes: https://issues.redhat.com/browse/RHEL-135687

Assisted-by: Claude Code (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-14 10:06:53 -05:00
Colin Walters
6f69534f9b Rework sealed build process
Main goal is to reduce signing logic duplication between the systemd-boot
and UKI generation.

However, this quickly snowballed into wanting to actually verify
by providing a custom secure boot keys to bcvk that things worked.
This depends on https://github.com/bootc-dev/bcvk/pull/170

Now as part of that, I ran into what I think are bugs in pesign;
this cuts things back over to using sbsign. I'll file a tracker for that
separately.

Finally as part of this, just remove the TMT example that builds
a sealed image but doesn't actually verify it works - it's already
drifted from what we do outside here. Ultimately what we need
is to shift some of this into the Fedora examples and we just
fetch it here anyways.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-12-11 14:43:26 -05:00
Xiaofeng Wang
3a7dd85ff1 test: Update to work with OSCI gating test
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-12-10 11:12:56 -05:00
Xiaofeng Wang
f687add625 test: Add more distros for composefs test (#1810)
And ignore test-integration-cfs failure on centos-9

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-11-27 13:31:31 +08:00
Colin Walters
6d655af91a cfs: Hard error on external kargs with UKIs
I thought about this with the cloud-init disablement for now
with bcvk. It already works to just not enable `cloud-init.target`
which we were already doing.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-07 15:05:07 -05:00
Colin Walters
f8ce015254 Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk

For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203

This is a blocker for us doing more testing with UKIs.

In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.

In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.

Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.

Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.

Part 2: Rework the Justfile and Dockerfile

This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.

The readonly tests now pass with composefs.

Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-06 19:32:42 -05:00
Xiaofeng Wang
73d08d9648 test: Fix OSCI gating failure
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-11-05 07:32:36 -05:00
Xiaofeng Wang
58876bf20e test: Update test to sync with Fedora CI gating
According to https://src.fedoraproject.org/rpms/bootc/pull-request/59#

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-10-14 10:46:10 -04:00
Xiaofeng Wang
f1dec83720 test: Use SRPM as test code source to work with gating test (#1670)
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-10-08 11:47:44 +08:00
Xiaofeng Wang
704338d26b test: Add Packit and gating test
Use 'system-reinstall-bootc' to re-install TF runner from package mode
to image mode

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-10-02 16:59:56 -04:00
Colin Walters
5d3792e957 build-sys: Various cleanups, doc clarification
First change `.dockerignore` to be an allowlist.
This avoids spurious rebuilds when touching e.g. `tmt/`, and
also crucially we don't leak `.git/` into the sources which
can easily change as one makes commits/branches.
This also requires touching the `hack/` directory which
is now fully self contained.

While we're here, make clear the roles of Justfile vs Makefile.
Remove the `make test`.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-19 16:02:21 -04:00
Colin Walters
d81c395fce ci: Unify more of hack/ and tests/
A key thing for me is that the `Justfile` should be a one-stop
shop for development of the project. It can't have everything but
it should answer the basic questions of "how do I build and test
this project".

This aligns the recently added tmt-on-GHA flow a *bit* more closely
with some of that. Biggest is to use the `just build-integration-test-image` as the canonical
way to build a container image with our testing stuff in it;
which uses our main Dockerfile

Other cleanups:
- Change test script to move into tests/tmt/ as a workaround for
  https://github.com/teemtee/tmt/pull/3037#issuecomment-3259585271
- Change the qemu logic to use SMBIOS credentials so we don't
  have to carry around both a disk image and a SSH key
- Change qemu to use `-snapshot` so we can reuse disks
- Change the scripts to accept data via argv[1] and not environment
- Drop the hardcoded testing directory and use `target/` as
  a generic build artifact dir

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-17 15:20:06 -04:00
Colin Walters
fc057e6a1b build-sys: Rework to have toplevel Dockerfile + Justfile
This is aligning with what I did in https://github.com/ostreedev/ostree/pull/3439

- What gets invoked in e.g. GHA should ideally most be `just` commands
  that are easy to run locally too (with sudo in GHA, without sudo locally)
- Move the "core build" to the toplevel so that one can just `podman build`
  directly too (without the Justfile) and have it do something useful
- The "always build and test in a container" helps for LLM-assisted coding
  because what they can do is inherently sandboxed

Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-11 17:44:54 +02:00
Colin Walters
009e1bf2d6 hack: Rework+cleanup container build
Main motivation: I was looking at making more changes here

- Use an idiom I'd like to standardize more of copy context to `FROM scratch` image
  which is then mounted and consumed in other phases by mounting. This helps
  avoid polluting later containers with intermediate copied files.
- Change `build.sh` to handle being run from any directory
- Drop the `dev-rootfs` stuff as it's weird and awkward; instead we should
  encourage multi-step builds deriving from this image
- Don't make `bootc.tar.zst` only to immediately untar it; just use `COPY`
  from the build container
- Use heredocs to condense multiple `RUN` invocations to avoid pointless
  small layers

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-15 13:29:38 -04:00
Xiaofeng Wang
ad936b7fd7 test: update bootc install script to support Fedora CI gating test
Also rename test-00-bootc-install to bootc-install-provision to
make more sense

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-05-02 17:59:18 +08:00
ckyrouac
44ce2cf2c2 install: Deprecate skip-fetch-check, replace with run-fetch-check
This deprecates skip-fetch-check in favor of the inverse,
run-fetch-check. Updates docs and tests to reflect the change.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
2025-04-08 14:51:58 -04:00
Xiaofeng Wang
ffa709f222 test: drop nested virt required on integration test
Use TF runner as test machine and run all test on TF runner itself

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-04-04 01:13:21 +08:00
Colin Walters
8ca5e49f0c hack: Add missing sysusers.d entry for sudo
TODO add this to the base image

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-14 10:49:23 -05:00
Colin Walters
eb55216f7d provision: Fast track some tmpfiles.d additions
I put these in https://gitlab.com/fedora/bootc/base-images/-/merge_requests/92
too but let's fast track them to our images here so
we unblock testing tmpfiles.d translation.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:38 -05:00
Colin Walters
9363b23fc6 provision: Clean even more rpm stuff
In some cases we have /var/lib/rhsm too... *cry*

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:27 -05:00
Colin Walters
293e9e2e5a hack: Use lint --fatal-warnings
Because if failures somehow creep in we really want to know.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 18:56:27 -05:00
Colin Walters
3461ddee70 provision-derived: Clean lots more stuff
Yeah, we're going to need a `dnf clean all --everything`...

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-12 08:55:20 -05:00
Colin Walters
cb99cf5c95 ci: Bump Fedora to 41
For newer ostree

Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 12:37:38 -05:00
Colin Walters
292d9e165c build: Handle dnf5 in Fedora
Signed-off-by: Colin Walters <walters@verbum.org>
2025-02-03 09:10:37 -05:00
Colin Walters
8990b54244 build.sh: Use our embedded spec
One CI run just got a server error fetching the spec from Fedora.
We have a spec here (which I don't like but we do) so use it
to lower CI flakes.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-01-17 09:55:22 -05:00
Xiaofeng Wang
3aada94752 test: Remove tmt bootc plugin code and use released bootc plugin
Remove tests-intetration folder because TMT bootc plugin replaces
tests-integration

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-12-07 14:33:13 +08:00
Colin Walters
32612035d5 tests: Drop more bind mount instances
These should be unnecessary.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-02 18:11:52 -05:00
Colin Walters
99ef63508d Drop test references to /dev and /var/lib/containers mounts
Keep the bind mounts in the docs though for now because many
people will be using the current docs with older bootc.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-02 18:11:52 -05:00
Chris Kyrouac
140eeacb17 tmt: Add new tmt scripts path to $PATH
Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-10-31 14:44:36 -04:00
Chris Kyrouac
e1ea6f1fed tmt: Add webserver to provision-derived
Our custom tmt image needs to start the web server on port 10022 that
tmt expects.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-10-30 14:30:46 -04:00
Colin Walters
3c7a620bc7 install: Pick up kargs.d kernel arguments too
This was a rather important miss; we need to pick
up the kargs.d files when doing a `bootc install` too.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-27 21:05:11 -04:00
Colin Walters
27d955c44e hack: Remove everything in /tmp
Somehow, something else is leaking into `/tmp` at least in the
GHA runs...remove it all.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-27 19:57:24 -04:00
Colin Walters
969d032bfc Merge pull request #626 from cgwalters/tests-bind-dev
tree: Add missing -v /dev:/dev in a few places
2024-06-24 20:22:17 -04:00
Colin Walters
9a758e3a14 tests: Add pytest and nushell based tests
I've been trying to keep this project in "one" programming
language by writing even tests in Rust...but specifically
for our integration tests it's pretty painful not just to
compile them but have to deal with baking them into the base image.

The tmt framework is very GHA like in that it scrapes the
git source tree and copies it into the target environment, which
works really well with scripts.

Now, if you know me you know I am not a fan of dynamic programming
languages like bash and Python. I'm one of those folks that actually
tries to use Rust for things that feel like "scripts" i.e. they're
*mostly* about forking external processes (see the xtask/
crate which uses "xshell").

Some of our testing code is in Rust too. However...there's a giant
tension here because:

- Iteration speed is very important for tests and scripts
- The artifact being an architecture-dependent binary pushes us
  to inject it into container images; having the binary part
  of the bootc image under test conceptually forces us to reprovision
  for each test change, which is super expensive

Most other people when faced with the testing challenge would
just write shell scripts (or Python); that's definitely what tmt
expects people to do.

The podman project has a mix of a "bats" suite which is all
bash based, and a Go-based framework.

The thing is: bash is easy to mess up and has very little ability
to do static analysis. Go (and Python) are very verbose for forking external
processes.

I've been using https://www.nushell.sh/ for my interactive shell
for quite a while; I know just enough to get by day to day
(but honestly sometimes I still type "bash" and run a few things there
 that I know how to express in bash but not nu)

Anyways though, nushell has a lot of desirable properties for
tests (which are basically scripts):

- Architecture independent
- Running an external process requires zero ceremony; it's the
  default!
- But it *is* easy to e.g. scrape JSON from an external binary
  into a rich data structure
- A decently rich standard library

The downside is, it's a new language. And in the end, I'm
not going to say it's the only way to write tests...maybe we
do end up with some more bash. It wouldn't be the end of the world.
But...after playing with this, I definitely like the result.

OK, and after some debate we decided to add Python too, so this
demos a pytest test.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-24 13:46:13 -04:00
Colin Walters
527151969a tree: Add missing -v /dev:/dev in a few places
We're really going to need to switch over to having the container
do dynamic mounts; cc https://github.com/containers/bootc/issues/380#issuecomment-1983721453

Just noticed this missing in one place, and found others with
a grep.

Right now we do operate without, but it can be racier.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-22 09:21:25 -04:00
Colin Walters
836cdd81bc install: Fix install config kargs + to-filesystem
I think this got broken in a refactoring; add
test coverage.  In general all the heavy
lifting should move out of `baseline.rs`; a
good way to do that is probably to take the
next step of making it its own crate that
doesn't depend on the bootc core logic perhaps.

Closes: https://github.com/containers/bootc/issues/570
Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-16 13:24:10 +00:00
Colin Walters
b97359f48e build: Install git too
This must be a regression from the timestamp change:
91ed63caf1

Without this we fail to parse the timestamp and get errors;
maybe something else changed.

Of course, we should use a non-Makefile language for
this so we get proper error checking.  I may move some
of the makefile bits into xtask.rs or so.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-12 14:35:44 +00:00
Xiaofeng Wang
08ad8121f5 Merge pull request #590 from cgwalters/hack-tmt
hack: Add support for installing cloud-init+rsync
2024-06-12 13:24:47 +08:00
Chris Kyrouac
7ec44f6a0b hack: Add remote lldb utilities to hack dir
This is useful for remote debugging bootc running in a VM.

Until podman-bootc has support for forwarding arbitrary ports,
this custom solution is needed.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-06-11 10:21:59 -04:00
Colin Walters
8657ce5392 hack: Add support for installing cloud-init+rsync
These are things that https://tmt.readthedocs.io/en/stable/
wants, and the goal is to support running under tmt more
directly.

Part of https://github.com/containers/bootc/issues/543

With this I can run:

```
provision:
  how: virtual
  image: /home/walters/src/github/containers/bootc/target/testbootc-cloud.qcow2
summary: Basic smoke test
execute:
    how: tmt
    script: bootc status
```

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-09 16:05:32 -04:00
Colin Walters
0455f808b1 build: Fetch latest spec from Fedora
To get `zstd-devel`.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-04 14:19:44 -04:00