Skip to content

Commit b696395

Browse files
committed
internals: Add a helper verb to initiate a reboot
This is intended to aid unit testing outside of `upgrade --apply`. Signed-off-by: Colin Walters <[email protected]>
1 parent 778ec6a commit b696395

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/lib/src/cli.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ pub(crate) enum InternalsOpts {
472472
// The stateroot
473473
stateroot: String,
474474
},
475+
/// Initiate a reboot the same way we would after --apply; intended
476+
/// primarily for testing.
477+
Reboot,
475478
#[cfg(feature = "rhsm")]
476479
/// Publish subscription-manager facts to /etc/rhsm/facts/bootc.facts
477480
PublishRhsmFacts,
@@ -1230,6 +1233,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
12301233
Ok(())
12311234
}
12321235
},
1236+
InternalsOpts::Reboot => crate::reboot::reboot(),
12331237
InternalsOpts::Fsck => {
12341238
let sysroot = &get_storage().await?;
12351239
crate::fsck::fsck(&sysroot, std::io::stdout().lock()).await?;

0 commit comments

Comments
 (0)