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

31 Commits

Author SHA1 Message Date
Pragyan Poudyal
a6d886170e composefs-backend: Rename 'composefs-native' to 'composefs-backend'
We were using composefs-native and composefs-backend interchangeably.
Replace all instances of `composefs-native` with `composefs-backend`

Move all composefs-backend options to a single struct so that we can
test for boolean instead of testing for Some/None for composefs-backend
options

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-17 07:05:42 -04: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
3fd43a747f test: Fix packit-reboot.yml download URL issue (#1664)
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-10-03 21:22:33 +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
Joseph Marrero Corchado
f39c9e3c27 tests: add custom selinux policy test
Ensure that if a custom policy is added in a
Containerfile, the resulting deployment has the expected
labels as well.

Assisted by Claude Code

Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
2025-10-01 16:04:10 -04:00
John Eckersberg
8cf0971719 tests: skip initramfs if no composefs in cmdline
The systemd unit is conditional on this so without it the test will
always fail.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-29 16:49:13 -04:00
John Eckersberg
cee9315f25 examples: use "system" bootc binaries
Since we're running this under tmt, the "system" bootc binaries were
built from source and injected into the integration disk image.  No
need to rebuild these inside of the test job itself.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-29 16:49:13 -04:00
John Eckersberg
5cacf27242 examples: move under tmt/tests/
Doing this as a distinct commit so as to not conflate future
modifications with the bulk code movement.

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-29 16:49:13 -04:00
John Eckersberg
fc7f32d10a tmt: Add test for bootc examples build scripts
Add test-26-examples-build to validate that the bootc-bls and bootc-uki
example build scripts work correctly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
2025-09-29 16:49:13 -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
Xiaofeng Wang
54f8562dad test: Add integration test running on github runner
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-09-10 20:55:00 +08:00
Colin Walters
09b6c1c81f Merge pull request #1590 from cgwalters/journal-test
tests: Verify we emit journal messages
2025-09-10 03:20:05 -04:00
Colin Walters
c76001a274 tests: Verify we emit journal messages
Followup to previous commit.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-05 16:56:04 -04:00
Brendan Shephard
e3530d4b82 Update reboot-required file with staged image context
This change updates the /run/reboot-required file to include information
about the staged bootc image. This will provide users with information
about what bootc image will be effective after the system has been
rebooted.

Fixes #1574
Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
2025-09-05 23:01:51 +10:00
Colin Walters
849a634152 Un-hide soft-reboot
We debugged https://github.com/ostreedev/ostree/issues/3503 and
it's basically a systemd/Anaconda bug. So we can consider
soft reboots an available feature from our end (as systemd
does), but certainly one that will require integration testing on
the OS/distro side.

If you're building a system and you don't want to enable
soft reboots, just `rm /usr/lib/systemd/system/soft-reboot.target`
or so should do the trick.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-09-03 11:22:34 -04:00
Colin Walters
d61f681c4e sysroot: Fix regression in status locking
The previous locking code was just wrong; my bad for not stress
testing it.

Fix it an add a test too.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-25 15:40:52 -04:00
Joseph Marrero Corchado
0a3fa5d2d4 cli: add support for soft-reboots
This commit adds --soft-reboot=required|auto to the
cli which uses the ostree api's to setup soft-reboots
during switch, update and rollback operations.

Co-authored-by: Colin Walters <walters@verbum.org>

Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-15 14:52:49 -04:00
Colin Walters
e7a3835946 ci/tmt: distro-sync ostree+systemd
This is a hackaround for https://gitlab.com/redhat/centos-stream/containers/bootc/-/issues/1174

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-15 14:21:49 +02:00
Colin Walters
f61ba60bbc Add initramfs infrastructure
This adds scaffolding to install a stub binary which can
optionally be added into the initramfs;
prep for us doing real work during setup as we aim
to move to the native composefs backend.

The binary is *built* but is only installed by a
new `Makefile` target, so existing build system
users won't pick it up. Our development-only
`Dockerfile` gains a build option to use it
(and also ensures the initramfs is regenerated).

However previously we also discussed moving the fstab
logic into the initramfs:
https://github.com/bootc-dev/bootc/pull/1113

I might try doing that once this lands.

One notable thing is that even this trivial nearly-no-op
binary is still 4MB which I think is mostly due
to linking in a whole copy of prebuilt rust `std`.
In theory we could try going to `#[no_std]` but I
don't think it'll be viable once we start doing more here.
Probably most practical thing re size is `-Z build-std` + LTO.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-08 09:30:32 -04:00
Colin Walters
9d3ccd048c Add bootc internals cfs
This exposes the current functionality of the cfsctl binary.
It's not a crate right now, and it's not a lot of code, so we just
fork it.

I did take the effort to use `git subtree merge` to do the import.
For the record, here's how I did it:

- In composefs-rs: git subtree split --prefix=crates/cfsctl
- In bootc: git subtree add --prefix=crates/lib/cfsctl ../../containers/composefs-rs/ <git sha1 from above>

In cfsctl I also:

- Adjusted it to accept the bootc-configured composefs repo
  (which note is right now hardcoded to sha512, not sha256)
- Dropped the http stuff since I don't think it really makes
  sense vs OCI

Signed-off-by: Colin Walters <walters@verbum.org>
2025-08-01 14:12:03 -04:00
Colin Walters
07faf7d052 store: Add support for composefs
This is prep for wider usage of it in this project.
Like the containers-image: storage, it is only initialized
on demand right now.

(An obvious next step is to redo things so the ostree storage is also on-demand)

- This is hardcoded to SHA512 right now...but we clearly want
  a way to configure that or maybe we just really default to 512?
- We explicitly bridge between the ostree fsverity enablement
  to the composefs verity enablement
- Right now the usage is just a stub but I plan to expose
  more here

Signed-off-by: Colin Walters <walters@verbum.org>
2025-07-31 17:54:19 -04:00
Robert Sturla
7cef4c541e test: add integration tests for 'bootc switch --apply'
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
2025-07-30 22:47:40 +01:00
gursewak1997
389f6f305d Create /run/reboot-required by default
When staging a new deployment, create /run/reboot-required to signal that
a reboot is needed. This file is monitored by kured (Kubernetes Reboot
Daemon) and other tools to detect when a system needs to be rebooted.

This makes it easier to integrate bootc with kured and similar tools
without requiring manual configuration or bridging.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-06-18 10:47:48 -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
Xiaofeng Wang
15ea729e2b test: Add README.md in tmt folder for integration test local running
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2025-06-09 13:42:37 +08:00
Colin Walters
856e480cb7 cli: Don't emit ANSI codes to stderr
It seems the tracing crate is broken in this respect. Digging
through best practices, `anstream` is used by clap and looks sane.
We're basically just following their example.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-29 14:54:13 -04:00
Colin Walters
d71855d516 spec: Add stateroot
As we head towards factory reset work, this will be of critical
importance.

For now this only shows up in the API, not in human readable
status.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-05-14 21:28:21 -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
Evan Goode
4cea3e56f1 test: Use to-existing-root --acknowledge-destructive
In the test suite, pass the --acknowledge-destructive flag to `bootc
install to-existing-root` to avoid the 20 second timer.

Signed-off-by: Evan Goode <mail@evangoo.de>
2025-04-16 20:31:12 +00: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