From 54c731554ea2f73bd0553d22628fb0d438d1ee96 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 29 Jun 2023 02:08:56 -0400 Subject: [PATCH] tests/transactionality: Port a bit to xshell This will give us more useful error messages which should help debug a flake. --- tests/inst/src/destructive.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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: {})", -- 2.30.2