tests/transactionality: Port a bit to xshell

This will give us more useful error messages which should
help debug a flake.
This commit is contained in:
Colin Walters
2023-06-29 02:08:56 -04:00
parent a0d17a730d
commit 54c731554e

View File

@ -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: {})",