Skip to content

xtask: Add an opt-in testcloud + system-reinstall-bootc provisioning path for tmt - #43

Draft
cgwalters-bot wants to merge 1 commit into
mainfrom
bot/reinstall-tmt-2559
Draft

cgwalters-bot wants to merge 1 commit into
mainfrom
bot/reinstall-tmt-2559

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Collaborator

Adds an opt-in --provision=reinstall mode to cargo xtask run-tmt (plus just test-tmt-reinstall). It boots a Fedora/CentOS Stream cloud guest with tmt virtual/testcloud instead of bcvk, transfers the image and this build's bootc/system-reinstall-bootc RPMs, reuses the existing package preparation and expect helper, and requests a guarded tmt prepare reboot. The default bcvk provisioning is unchanged. This is step 1 of the plan in bootc-dev#2559; the combined readonly target, cleanup fix, journal changes and CI edits are not included.

What the run reports it did: regenerated the generated regions (unchanged); added table-driven cloud-alias and RPM-selection tests, with all 32 xtask tests passing; ran a tmt 1.79 dry run that selected the shared install plus local reinstall/reboot phases and executed zero tests. It notes that the plan's claim about an undefined running_env was wrong for fmf 1.7/tmt 1.79 (CannotDecide disables those phases, also in the original header), so existing undefined-context behavior is preserved. A read-only reviewer found an invalid finish --keep option, which was fixed to --until report.

What the run could NOT verify, quoting its summary: "Full validation and real readonly execution were attempted but blocked. BOOTC_base=quay.io/fedora/fedora-bootc:44 just test-tmt-reinstall readonly failed in the package build's /run/packaging/install-buildroot dnf installation: 'Curl error (60)' and 'unable to get local issuer certificate'. just validate passed generated checks and then failed at the CentOS buildroot's equivalent TLS boundary. Direct run-tmt initially failed 'tmt is not available in PATH'; after installing tmt it failed image distro detection because localhost/bootc was not built. No real guest boot, in-place install, reboot, readonly test or cleanup journal was observed; the downstream bootc-destructive-cleanup.service failure was NOT reproduced."

Links:

Draft for operator review; the code has not been reviewed or run by the bot.

Generated-by: https://github.com/cgwalters/#llms

…path for tmt

Add `--provision=reinstall` to `cargo xtask run-tmt` (and a
`just test-tmt-reinstall` wrapper). Instead of booting the image with
bcvk, it boots a cloud guest via tmt's virtual/testcloud provisioner and
runs system-reinstall-bootc in place, so the readonly tmt test can also
cover the in-place reinstall flow. The default bcvk path is unchanged.

This is step 1 of the plan in
bootc-dev#2559

Generated-by: AI
Agent-run: https://github.com/bootc-dev/cgwalters-devspace-sandbox/actions/runs/37975047479/attempts/1
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

Verification run on a devspace (16 cores, AMD EPYC 9V45, RHEL 10.2, KVM, rootless). LLM-run; nothing here was checked by a human. Head is now 5126d33 (was 9628fb1, one commit, one fix squashed in).

Result: the new path works end to end with one fix, and it reproduces the bootc-destructive-cleanup.service failure from bootc-dev#2559.

What ran

  1. cargo check -p xtask, cargo test -p xtask: 32 passed, including test_cloud_image and test_reinstall_rpm. cargo fmt --check and cargo xtask update-generated direct --check are clean. cargo clippy -p xtask -- -D warnings reports 17 errors with the devspace's clippy 0.1.92, none on lines this change adds.
  2. BOOTC_base=quay.io/fedora/fedora-bootc:44 just test-tmt-reinstall readonly (package and image build, then just test-tmt-nobuild --provision=reinstall [--preserve-vm] readonly for the reruns). With the fix below: testcloud booted the fedora-44 cloud image, the prepare phases installed the RPMs, loaded the image and ran system-reinstall-bootc ("Installation complete!"), tmt-reboot in prepare rebooted into the ostree deployment, and the readonly test ran: 000 to 013 pass, 014 fails. About 4.5 minutes per run after the build.
  3. BOOTC_base=quay.io/fedora/fedora-bootc:44 just test-tmt readonly (bcvk path, same tree): plan-01-readonly: PASSED, total: 1 test passed.

The one error in the change, and the fix

As pushed, the run stopped in the reboot prepare phase. tmt-reboot did reboot the guest, but tmt then re-runs that phase from its workdir on the guest, and the reinstalled system has a fresh /var:

prepare task #5: default-3 on default-0
fail: Failed to push workdir to the guest. This usually means that login as 'root' to the guest does not work.
rsync: [Receiver] change_dir#3 "/var/tmp/tmt/bootc-tmt-5s9ktuch-tmt-plans-integration-plan-01-readonly/tmt/plans/integration/plan-01-readonly/tree" failed: No such file or directory (2)

Fix (in hack/provision-reinstall-local.sh, 11 lines): after the reinstall, rsync /var/tmp/tmt (minus the tree/reinstall payload) and /var/lib/tmt if present into /ostree/deploy/default/var. Nothing else in the change was touched.

Host setup the change needs but does not say

These were devspace problems, not bugs in the change, but anyone running it will hit them:

  • tmt must be 1.79.0 with [provision-virtual] (the devspace had 1.78.0 without testcloud; pip install --user 'tmt[provision-virtual]==1.79.0').
  • testcloud 0.12.0 fails with requests-cache 1.3.3: fail: module 'requests_cache' has no attribute '__version__' then Could not get image url for 'fedora-44'. Pinning requests-cache<1.3 fixed it.
  • testcloud needs genisoimage, which RHEL 10 does not ship: fail: [Errno 2] No such file or directory: 'genisoimage'. I used a wrapper around pycdlib-genisoimage in ~/.local/bin.

State of the reinstalled system (Fedora 44 cloud image, btrfs)

$ systemctl --failed --no-pager
  UNIT                              LOAD   ACTIVE SUB    DESCRIPTION
● bootc-destructive-cleanup.service loaded failed failed Cleanup previous the installation after an alongside installation
● bootloader-update.service         loaded failed failed Update bootloader on boot
2 loaded units listed.

$ systemctl status --no-pager -l bootc-destructive-cleanup.service
× bootc-destructive-cleanup.service - Cleanup previous the installation after an alongside installation
     Loaded: loaded (/usr/lib/systemd/system/bootc-destructive-cleanup.service; enabled-runtime; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2026-10-10 02:27:48 UTC; 1min 4s ago
   Main PID: 832 (code=exited, status=123)

$ journalctl -b --no-pager -u bootc-destructive-cleanup.service   (61 lines; "remove failed" warnings trimmed)
fedora-bootc-destructive-cleanup[832]: + mount -o remount,rw /sysroot
fedora-bootc-destructive-cleanup[848]: + xargs -r rpm -e --root=/sysroot --dbpath=/usr/lib/sysimage/rpm
fedora-bootc-destructive-cleanup[847]: + rpm -qa --root=/sysroot --dbpath=/usr/lib/sysimage/rpm
fedora-bootc-destructive-cleanup[1254]: failed to create admindir: No such file or directory
fedora-bootc-destructive-cleanup[1258]: realpath: /etc/resolv.conf: No such file or directory
fedora-bootc-destructive-cleanup[1261]: failed to create admindir: No such file or directory
fedora-bootc-destructive-cleanup[911]: error: %preun(netcat-1.237-3.fc44.x86_64) scriptlet failed, exit status 2
fedora-bootc-destructive-cleanup[911]: error: netcat-1.237-3.fc44.x86_64: erase failed
fedora-bootc-destructive-cleanup[911]: warning: file /var/lib/selinux/targeted/active/users_extra: remove failed: No such file or directory
  (... about 35 more "/var/...: remove failed: No such file or directory" warnings ...)
fedora-bootc-destructive-cleanup[911]: warning: %postun(p11-kit-trust-0.26.2-1.fc44.x86_64) scriptlet failed, exit status 2
fedora-bootc-destructive-cleanup[911]: warning: directory //: remove failed: Device or resource busy
systemd[1]: bootc-destructive-cleanup.service: Main process exited, code=exited, status=123/n/a
systemd[1]: bootc-destructive-cleanup.service: Failed with result 'exit-code'.

$ findmnt /sysroot
/sysroot /dev/vda3[/root] btrfs ro,relatime,seclabel,compress=zstd:1,discard=async,space_cache=v2,subvolid=256,subvol=/root
$ ls /sysroot/var
lib

This matches the diagnosis in the issue: the old root's /var subvolume is not mounted under /sysroot, so netcat's %preun (alternatives) fails and xargs exits 123.

A second unit also failed on the reinstalled guest. Test 014 only looks at systemd-*/bootc-* units, so it was not reported; I did not check whether it also fails on the bcvk path:

bootupctl[873]: error: Failed adopt and update: opening EFI dir: No such file or directory (os error 2)
systemd[1]: bootloader-update.service: Main process exited, code=exited, status=1/FAILURE

Not run

CentOS Stream (only Fedora 44), plans other than readonly, the default c10s base on the reinstall path, and --preserve-vm beyond one run (it worked: the guest stayed up, and tmt run -i <id> cleanup removed it).

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot

cgwalters-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

@cgwalters-bot

cgwalters-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

✅ dispatch ended well. Result: #43

@cgwalters-bot cgwalters-bot moved this from Todo to In Progress in Workstream Oct 31, 2026
@cgwalters-bot
cgwalters-bot force-pushed the bot/reinstall-tmt-2559 branch from 5126d33 to 38bb49c Compare October 31, 2026 19:01
@cgwalters-bot cgwalters-bot added the needs-human The poll stopped here; a person decides what is next label Oct 31, 2026
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

The poll stopped following this pull request: a draft with no checkpoint; mark it ready if the work is complete. It is labelled needs-human; remove the label to have the poll start again on it, with fresh fix rounds.

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

Triage verdict: release (operator's standing rule, tracker#1445)

Finish current-head build, review and VM validation of opt-in reinstall provisioning.

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot cgwalters-bot removed the needs-human The poll stopped here; a person decides what is next label Nov 11, 2026
@cgwalters-bot cgwalters-bot moved this from Needs human to In Progress in Workstream Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:deep Bot draft that needs a real review

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant