mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-10 05:18:30 +03:00
tests: Add a sanity check for composefs
Prep for adding some coverage of this flow when booting with composefs.
This commit is contained in:
parent
dd47090e2f
commit
3c7e256cee
31
tests/inst/src/composefs.rs
Normal file
31
tests/inst/src/composefs.rs
Normal file
@ -0,0 +1,31 @@
|
||||
use anyhow::Result;
|
||||
use xshell::cmd;
|
||||
|
||||
pub(crate) fn itest_composefs() -> Result<()> {
|
||||
let sh = xshell::Shell::new()?;
|
||||
if !cmd!(sh, "ostree --version").read()?.contains("- composefs") {
|
||||
println!("SKIP no composefs support");
|
||||
return Ok(());
|
||||
}
|
||||
let mark = match crate::test::get_reboot_mark()? {
|
||||
None => {
|
||||
cmd!(
|
||||
sh,
|
||||
"ostree --repo=/ostree/repo config set ex-integrity.composefs true"
|
||||
)
|
||||
.run()?;
|
||||
// A dummy change; TODO add an ostree command for this
|
||||
cmd!(sh, "rpm-ostree kargs --append=foo=bar").run()?;
|
||||
return Err(crate::test::reboot("1").into());
|
||||
}
|
||||
Some(v) => v,
|
||||
};
|
||||
if mark != "1" {
|
||||
anyhow::bail!("Invalid reboot mark: {mark}")
|
||||
}
|
||||
|
||||
let fstype = cmd!(sh, "findmnt -n -o FSTYPE /").read()?;
|
||||
assert_eq!(fstype.as_str(), "overlay");
|
||||
|
||||
Ok(())
|
||||
}
|
@ -2,6 +2,7 @@ use anyhow::{bail, Result};
|
||||
use libtest_mimic::Trial;
|
||||
use structopt::StructOpt;
|
||||
|
||||
mod composefs;
|
||||
mod destructive;
|
||||
mod repobin;
|
||||
mod sysroot;
|
||||
@ -28,7 +29,10 @@ const TESTS: &[StaticTest] = &[
|
||||
test!(repobin::itest_extensions),
|
||||
test!(repobin::itest_pull_basicauth),
|
||||
];
|
||||
const DESTRUCTIVE_TESTS: &[StaticTest] = &[test!(destructive::itest_transactionality)];
|
||||
const DESTRUCTIVE_TESTS: &[StaticTest] = &[
|
||||
test!(destructive::itest_transactionality),
|
||||
test!(composefs::itest_composefs),
|
||||
];
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(rename_all = "kebab-case")]
|
||||
|
Loading…
Reference in New Issue
Block a user