Skip to content

ephemeral: Add test-basic subcommand - #244

Closed
henrywang wants to merge 1 commit into
bootc-dev:mainfrom
henrywang:simple-test
Closed

henrywang wants to merge 1 commit into
bootc-dev:mainfrom
henrywang:simple-test

Conversation

@henrywang

Copy link
Copy Markdown

Add bcvk ephemeral test-basic <image> which boots an ephemeral VM and verifies systemd reached a healthy state via systemctl is-system-running. This provides a quick smoke test for bootc container images.

Assisted-by: Claude Code (Opus 4.6)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new ephemeral test-basic subcommand to the bcvk tool, which serves as a smoke test by booting an ephemeral VM and verifying its health using systemctl is-system-running. The update includes the command logic, a corresponding integration test, and comprehensive documentation. Feedback was provided to improve the robustness of the health check by adding the --wait flag to the systemctl command and to remove an unnecessary -- separator from the SSH arguments to ensure consistency with existing command-line behavior.

Comment thread crates/kit/src/ephemeral.rs
Add `bcvk ephemeral test-basic <image>` which boots an ephemeral VM and
verifies systemd reached a healthy state via `systemctl is-system-running`.
This provides a quick smoke test for bootc container images.

Assisted-by: Claude Code (Opus 4.6)
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
@henrywang

Copy link
Copy Markdown
Author

PASS [ 23.295s] ( 3/18) integration-tests::integration-tests test_ephemeral_test_basic

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know I suggested this as a kind of offhand comment, but a few things here.

  • Commands we expose should generally also appear as varlink; maybe going forward we actually try to have the CLI be sugar around varlink just to force this
  • If we're making "is system healthy" commands probably it should apply to libvirt too?
  • Bigger picture...I would really like bcvk to help be an awesome component of testing frameworks - but without growing into a complete framework itself ideally. But in that vein we need to ask how to make this extensible

Combining the above...one thing I was thinking about here and have some code towards in an unpushed commit is - what if we bridged e.g. the dbus socket or systemd dbus/varlink itself? Worth investigating because then it becomes way more flexible, we aren't just hardcoding one systemd API call.

@cgwalters cgwalters added the agent/fixme Reviewer agent found issues that need fixing label Sep 10, 2026
@cgwalters

Copy link
Copy Markdown
Collaborator

cc bootc-dev/actions#53

@cgwalters cgwalters added agent/code Triggers the drafter agent agent/fixme Reviewer agent found issues that need fixing and removed agent/fixme Reviewer agent found issues that need fixing labels Sep 10, 2026
@cgwalters

Copy link
Copy Markdown
Collaborator

Blah, our AW deployment only works on branches starting with agent/. xref #356

cgwalters-bot added a commit to cgwalters-forge/bcvk that referenced this pull request Sep 28, 2026
A quick "does this image boot healthy" check is what most CI consumers
of bcvk end up writing by hand with run-ssh, so give it a name:
`bcvk ephemeral test-basic IMAGE` is shorthand for run-ssh with
`systemctl is-system-running --wait`, which also lists the failed units
when the system comes up degraded, and exits non-zero unless it reaches
"running". Now that bcvk masks bootloader-update.service, stock images
reach "running" in an ephemeral VM, so a degraded state really means
something is wrong with the image.

Rather than duplicating run-ssh's VM lifecycle and SSH handling, it
re-executes bcvk as run-ssh with the same arguments, so it can't drift
from it. The options are still declared (flattened from `ephemeral
run`) so they are validated up front and show up in --help and the man
page.

Based on bootc-dev#244 by Xiaofeng Wang and the automated follow-up bootc-dev#357,
reworked per review there.

Closes: bootc-dev#356
Generated-by: AI
cgwalters-bot added a commit to cgwalters-forge/bcvk that referenced this pull request Sep 30, 2026
A quick "does this image boot healthy" check is what most CI consumers
of bcvk end up writing by hand with run-ssh, so give it a name:
`bcvk ephemeral test-basic IMAGE` is shorthand for run-ssh with
`systemctl is-system-running --wait`, which also lists the failed units
when the system comes up degraded, and exits non-zero unless it reaches
"running". Now that bcvk masks bootloader-update.service, stock images
reach "running" in an ephemeral VM, so a degraded state really means
something is wrong with the image.

Rather than duplicating run-ssh's VM lifecycle and SSH handling, it
re-executes bcvk as run-ssh with the same arguments, so it can't drift
from it. The options are still declared (flattened from `ephemeral
run`) so they are validated up front and show up in --help and the man
page.

Based on bootc-dev#244 by Xiaofeng Wang and the automated follow-up bootc-dev#357,
reworked per review there.

Closes: bootc-dev#356
Generated-by: AI
cgwalters-bot added a commit to cgwalters-forge/bcvk that referenced this pull request Sep 30, 2026
A quick "does this image boot healthy" check is what most CI consumers
of bcvk end up writing by hand with run-ssh, so give it a name:
`bcvk ephemeral test-basic IMAGE` is shorthand for run-ssh with
`systemctl is-system-running --wait`, which also lists the failed units
when the system comes up degraded, and exits non-zero unless it reaches
"running". Now that bcvk masks bootloader-update.service, stock images
reach "running" in an ephemeral VM, so a degraded state really means
something is wrong with the image.

Rather than duplicating run-ssh's VM lifecycle and SSH handling, it
re-executes bcvk as run-ssh with the same arguments, so it can't drift
from it. The options are still declared (flattened from `ephemeral
run`) so they are validated up front and show up in --help and the man
page.

Based on bootc-dev#244 by Xiaofeng Wang and the automated follow-up bootc-dev#357,
reworked per review there.

Closes: bootc-dev#356
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
cgwalters pushed a commit that referenced this pull request Oct 1, 2026
A quick "does this image boot healthy" check is what most CI consumers
of bcvk end up writing by hand with run-ssh, so give it a name:
`bcvk ephemeral test-basic IMAGE` is shorthand for run-ssh with
`systemctl is-system-running --wait`, which also lists the failed units
when the system comes up degraded, and exits non-zero unless it reaches
"running". Now that bcvk masks bootloader-update.service, stock images
reach "running" in an ephemeral VM, so a degraded state really means
something is wrong with the image.

Rather than duplicating run-ssh's VM lifecycle and SSH handling, it
re-executes bcvk as run-ssh with the same arguments, so it can't drift
from it. The options are still declared (flattened from `ephemeral
run`) so they are validated up front and show up in --help and the man
page.

Based on #244 by Xiaofeng Wang and the automated follow-up #357,
reworked per review there.

Closes: #356
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters

Copy link
Copy Markdown
Collaborator

Thanks so much for starting this! This ended up being rebased and tweaked a bit in #393

Which now that I look basically ignored my comments on #244 (review) so...sorry we probably could have just landed what was here. I'll file another issue for followups!

@cgwalters cgwalters closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/code Triggers the drafter agent agent/fixme Reviewer agent found issues that need fixing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants