-
Notifications
You must be signed in to change notification settings - Fork 168
WIP: Cfs tests #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP: Cfs tests #1913
Conversation
4d359af to
1229ffa
Compare
There was a problem hiding this comment.
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 adds tests for composefs soft reboot functionality, introducing a reset-soft-reboot command and updating the CLI to handle different soft reboot modes. The changes are generally well-implemented, but I've identified several leftover debugging statements that should be removed to clean up the output. Additionally, there's a critical typo in a test script that needs to be fixed, and a minor encapsulation concern with a newly public field.
tmt/tests/booted/test-soft-reboot.nu
Outdated
| # See ../bug-soft-reboot.md - TMT cannot handle systemd soft-reboots | ||
| ostree admin prepare-soft-reboot --reset | ||
| } else { | ||
| bootc internals perp-soft-reboot --reset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| prepare_soft_reboot_composefs(&storage, &booted_cfs, &deployment, reboot) | ||
| .await | ||
| if reset { | ||
| return reset_soft_reboot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Assume the localhost/bootc image is up to date, and just run tests. | ||
| # Useful for iterating on tests quickly. | ||
| test-tmt-nobuild *ARGS: | ||
| echo {{ARGS}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| let Some(nextroot) = nextroot else { | ||
| tracing::debug!("Nextroot is not a directory"); | ||
| println!("No deployment staged for soft rebooting"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The messages printed to the console for user feedback should ideally be directed to stderr instead of stdout. This is a common practice for diagnostic messages, allowing users to separate program output from informational messages. For example, eprintln!("No deployment staged for soft rebooting");.
| println!("No deployment staged for soft rebooting"); | |
| eprintln!("No deployment staged for soft rebooting"); |
|
|
||
| if !nextroot_mounted { | ||
| tracing::debug!("Nextroot is not a mountpoint"); | ||
| println!("No deployment staged for soft rebooting"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// This spawns a separate VM per test plan to avoid state leakage between tests. | ||
| #[context("Running TMT tests")] | ||
| pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> { | ||
| println!("RunTmtArgs: {args:#?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| let firmware_args = build_firmware_args(sh, image)?; | ||
|
|
||
| println!("firmware_args: {firmware_args:#?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| let imgsrc = imgsrc | ||
|
|
||
| print $"USING IMAGE: ($imgsrc)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ($imgsrc | str ends-with "-local") { | ||
| bootc image copy-to-storage | ||
|
|
||
| print $"After copy-to-storage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Now, switch into the new image | ||
| print $"Applying ($imgsrc)" | ||
| bootc switch --transport containers-storage ($imgsrc) | ||
| print $"Switch to ($imgsrc) COMPLETE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1229ffa to
2462400
Compare
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Aligning with ostree API, now we only initiate soft-reboot if `--apply` is passed to `bootc update`, `bootc switch`, else we only prepare the soft reboot Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
After bootc/commit/49d753f996747a9b1f531abf35ba4e207cf4f020, composefs-rs saves config in the format `oci-config-sha256:`. Update to match the same Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
e166674 to
353bee2
Compare
When `--download-only` is passed, only download the image into the composefs repository but don't finalize it. Conver the /run/composefs/staged-deployment to a JSON file and Add a finalization_locked field depending upon which the finalize service will either finalize the staged deployment or leave it as is for garbage collection (even though GC is not fully implemented right now). Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
No description provided.