Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
omertuc committed Oct 23, 2024
1 parent 9876584 commit 83b4afc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests-integration/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(crate) const BASE_ARGS: &[&str] = &[

// Arbitrary
const NON_DEFAULT_STATEROOT: &str = "foo";
const SOME_OTHER_STATEROOT: &str = "bar";

/// Clear out and delete any ostree roots, leverage bootc hidden wipe-ostree command to get rid of
/// otherwise hard to delete deployment files
Expand Down Expand Up @@ -157,6 +158,26 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
);
Ok(())
}),
Trial::test("Install on already ostree target", move || {
// Do an initial install just to get ostree on our system
let sh = &xshell::Shell::new()?;
reset_root(sh, image)?;
cmd!(sh, "sudo {BASE_ARGS...} {target_args...} {image} bootc install to-existing-root --stateroot {NON_DEFAULT_STATEROOT} --acknowledge-destructive {generic_inst_args...}").run()?;
generic_post_install_verification()?;
assert!(
Utf8Path::new(&format!("/ostree/deploy/{NON_DEFAULT_STATEROOT}")).try_exists()?
);

// Now try again to a different stateroot
let sh = &xshell::Shell::new()?;
reset_root(sh, image)?;
cmd!(sh, "sudo {BASE_ARGS...} {target_args...} {image} bootc install to-existing-root --replace alongside --stateroot {SOME_OTHER_STATEROOT} --acknowledge-destructive {generic_inst_args...}").run()?;
generic_post_install_verification()?;
assert!(
Utf8Path::new(&format!("/ostree/deploy/{NON_DEFAULT_STATEROOT}")).try_exists()?
);
Ok(())
}),
Trial::test("without an install config", move || {
let sh = &xshell::Shell::new()?;
reset_root(sh, image)?;
Expand Down

0 comments on commit 83b4afc

Please sign in to comment.