Skip to content

Commit

Permalink
Merge pull request #89 from cgwalters/alias-upgrade
Browse files Browse the repository at this point in the history
cli: Add an alias `update` for `upgrade`
  • Loading branch information
jmarrero authored Mar 28, 2023
2 parents 1230755 + d4ba2f5 commit 9cc9fee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pub(crate) enum TestingOpts {
#[allow(clippy::large_enum_variant)]
pub(crate) enum Opt {
/// Look for updates to the booted container image.
#[clap(alias = "update")]
Upgrade(UpgradeOpts),
/// Target a new container image reference to boot.
Switch(SwitchOpts),
Expand Down
12 changes: 7 additions & 5 deletions lib/src/privtests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ pub(crate) fn impl_run_container() -> Result<()> {
let stout = cmd!(sh, "bootc status").read()?;
assert!(stout.contains("Running in a container (ostree base)."));
drop(stout);
let o = Command::new("bootc").arg("upgrade").output()?;
let st = o.status;
assert!(!st.success());
let stderr = String::from_utf8(o.stderr)?;
assert!(stderr.contains("this command requires a booted host system"));
for c in ["upgrade", "update"] {
let o = Command::new("bootc").arg(c).output()?;
let st = o.status;
assert!(!st.success());
let stderr = String::from_utf8(o.stderr)?;
assert!(stderr.contains("this command requires a booted host system"));
}
println!("ok container integration testing");
Ok(())
}
Expand Down

0 comments on commit 9cc9fee

Please sign in to comment.