mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-10 05:18:30 +03:00
Merge pull request #2912 from cgwalters/itest-transactionality-debug
tests/inst: A few small patches
This commit is contained in:
commit
25120bd7ad
@ -459,17 +459,14 @@ fn impl_transaction_test<M: AsRef<str>>(
|
||||
// Reset the target ref to booted, and perform a cleanup
|
||||
// to ensure we're re-downloading objects each time
|
||||
let testref = TESTREF;
|
||||
bash!(
|
||||
"
|
||||
systemctl stop rpm-ostreed
|
||||
systemctl stop ostree-finalize-staged
|
||||
systemctl stop ostree-finalize-staged-hold
|
||||
ostree reset testrepo:${testref} ${booted_commit}
|
||||
rpm-ostree cleanup -pbrm
|
||||
",
|
||||
testref,
|
||||
booted_commit
|
||||
)
|
||||
(|| -> Result<()> {
|
||||
cmd!(sh, "systemctl stop rpm-ostreed").run()?;
|
||||
cmd!(sh, "systemctl stop ostree-finalize-staged").run()?;
|
||||
cmd!(sh, "systemctl stop ostree-finalize-staged-hold").run()?;
|
||||
cmd!(sh, "ostree reset testrepo:{testref} {booted_commit}").run()?;
|
||||
cmd!(sh, "rpm-ostree cleanup -pbrm").run()?;
|
||||
Ok(())
|
||||
})()
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"Failed pre-upgrade cleanup (prev strategy: {})",
|
||||
|
@ -26,6 +26,7 @@ const TESTS: &[StaticTest] = &[
|
||||
test!(sysroot::itest_tmpfiles),
|
||||
test!(repobin::itest_basic),
|
||||
test!(repobin::itest_nofifo),
|
||||
test!(repobin::itest_mtime),
|
||||
test!(repobin::itest_extensions),
|
||||
test!(repobin::itest_pull_basicauth),
|
||||
];
|
||||
|
@ -42,6 +42,7 @@ pub(crate) fn itest_mtime() -> Result<()> {
|
||||
"
|
||||
)?;
|
||||
let ts = Path::new("repo").metadata()?.modified().unwrap();
|
||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||
bash!(r#"ostree --repo=repo commit -b test -s "bump mtime" --tree=dir=tmproot >/dev/null"#)?;
|
||||
assert_ne!(ts, Path::new("repo").metadata()?.modified().unwrap());
|
||||
Ok(())
|
||||
|
@ -17,8 +17,6 @@ use hyper::{Body, Request, Response};
|
||||
use hyper_staticfile::Static;
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
pub(crate) type TestFn = fn() -> Result<()>;
|
||||
|
||||
/// Run command and assert that its stderr contains pat
|
||||
pub(crate) fn cmd_fails_with<C: BorrowMut<Command>>(mut c: C, pat: &str) -> Result<()> {
|
||||
let c = c.borrow_mut();
|
||||
|
Loading…
Reference in New Issue
Block a user