Repository navigation
tests: Port test-switch-zstd-chunked to Rust - #2550
Merged
cgwalters merged 2 commits intoOct 9, 2026
Merged
Conversation
The nushell tests keep breaking on subtle behaviour changes between nushell versions, so the plan is to move them to Rust with xshell. This is the first one. It builds an image on the target, pushes it, switches to it and reboots, so it needs pieces many of the others share: TAP output, dispatch on TMT_REBOOT_COUNT, `bootc status --json`, and the UKI Containerfile helper from tap.nu. The tests become subcommands of a new `booted` group in bootc-integration-tests, which the bootc-tests subpackage already puts in the test image. Every failure exits 1, which tmt counts as a test failure: checks return errors rather than panicking (a panic exits 101, which tmt reports as an error), and a failing command no longer passes its own exit code through the way nushell did. Nothing runs this yet; the next commit points tmt at it. Related: bootc-dev#2547 Assisted-by: AI Signed-off-by: Andrew Dunn <andrew@dunn.dev>
The tmt generator only finds scripts in tmt/tests/booted, so nothing runs the Rust port from the previous commit. Teach it to read the same number/tmt/extra header from `//` comments in crates/tests-integration/src/booted/*.rs, and to generate each test there as `bootc-integration-tests booted <module>`. plan-50 keeps its name and now runs the Rust port, and the nushell version goes. The plan is now disabled outside running_env=image_mode, as test-27 is. Packit, and the gating runs sharing its prepare steps, boot an image built from Containerfile.packit, which doesn't install bootc-tests, and Packit's Copr build doesn't pass `--with tests`. That drops this test's runs on Packit's ostree images, and in gating, until bootc-tests is built there. Related: bootc-dev#2547 Assisted-by: AI Signed-off-by: Andrew Dunn <andrew@dunn.dev>
cgwalters
approved these changes
Oct 9, 2026
cgwalters
left a comment
Collaborator
There was a problem hiding this comment.
Neat! Thanks for starting the ball rolling on this. I personally think this looks nicer indeed.
| adjust: | ||
| - when: running_env != image_mode | ||
| enabled: false | ||
| because: only the image_mode test image installs bootc-tests |
Collaborator
There was a problem hiding this comment.
Actually though what we want to do is create e.g. bootc-tests.rpm or so.
| @@ -0,0 +1,178 @@ | |||
| // number: 50 | |||
Collaborator
There was a problem hiding this comment.
I think this is ok for now but as a followup since we're porting anyways let's require some structured metadata here. I think YAML frontmatter would be appropriate, we could perhaps extract that from rustdoc and avoid parsing rust code on our own?
Or just require
// # tmt-begin
...
/// # tmt-end
or so?
cgwalters
enabled auto-merge (rebase)
October 9, 2026 19:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First port for #2547.
test-switch-zstd-chunked.nubecomesbootc-integration-tests booted switch-zstd-chunked, and its tmt entry runs that instead ofnu. I picked it because it builds an image on the target, pushes it, switches to it and reboots, so it brings over pieces many other tests share: TAP output, dispatch onTMT_REBOOT_COUNT,bootc status --jsonand the UKI Containerfile helper from tap.nu.Ported tests are modules under a new
bootedsubcommand in tests-integration. The bootc-tests subpackage already installs that binary in the test image, so packaging doesn't change. Your issue suggests a separatebootc-testsbinary; would you rather have that?cargo xtask update-generatednow also reads thenumber/tmt/extraheader from//comments incrates/tests-integration/src/booted/*.rs, so plan-50 keeps its name, summary, duration andskip_if_ostree(for #2402). Every failure exits 1, which tmt reports as a failure: checks return errors instead of panicking (a panic's 101 is a tmt error), and a failing command no longer passes its own exit code through as nushell did (podman's 125 was a tmt error).Packit
Packit, and gating runs using the same prepare steps, boot an image built from Containerfile.packit, which doesn't install bootc-tests, and Packit's Copr build doesn't pass
--with tests. So the plan is now disabled outsiderunning_env=image_mode, with the same rule as test-27. Onlycargo xtask run-tmtappliesskip_if_ostree, so today plan-50 runs and passes on Packit's ostree images (all four tier-1 targets on #2314); this drops those runs, and gating's, until bootc-tests is built there. Every later port hits the same gap, so I'd look at getting bootc-tests into the Packit image next.flowchart TD header["header comments in booted/switch_zstd_chunked.rs"] -->|cargo xtask update-generated| plan["plan-50 runs<br/>bootc-integration-tests booted switch-zstd-chunked"] plan --> env{running_env} env -->|image_mode| bcvk["run-tmt boots the Dockerfile image,<br/>which installs bootc-tests"] env -->|Packit and gating| off["plan disabled:<br/>Containerfile.packit has no bootc-tests"]Testing
In a Fedora 44 container,
make validate,cargo xtask update-generated direct --checkand the tests-integration and xtask unit tests pass. Withbootc,podman,skopeoandtmt-rebootstubbed out, the port and the nushell original print the same TAP lines on both boots and when each check fails, pass and fail in the same cases, and generate the same UKI stages. In a test VM,just test-tmt switch-zstd-chunkedpasses on composefs BLS and unsealed UKI.