From: Colin Walters Date: Thu, 29 Jun 2023 06:08:56 +0000 (-0400) Subject: tests/transactionality: Port a bit to xshell X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2^2~66^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=54c731554ea2f73bd0553d22628fb0d438d1ee96;p=ostree.git tests/transactionality: Port a bit to xshell This will give us more useful error messages which should help debug a flake. --- diff --git a/tests/inst/src/destructive.rs b/tests/inst/src/destructive.rs index 4382c84b..2cc3a0c2 100644 --- a/tests/inst/src/destructive.rs +++ b/tests/inst/src/destructive.rs @@ -459,17 +459,14 @@ fn impl_transaction_test>( // 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: {})",