tests/transactionality: Port a bit to xshell
authorColin Walters <walters@verbum.org>
Thu, 29 Jun 2023 06:08:56 +0000 (02:08 -0400)
committerColin Walters <walters@verbum.org>
Thu, 29 Jun 2023 06:08:56 +0000 (02:08 -0400)
This will give us more useful error messages which should
help debug a flake.

tests/inst/src/destructive.rs

index 4382c84b9c8a794c5a3b7cc50402f65f103b05ba..2cc3a0c2669b1db2eb7daa804f34dc06ff7dc0a1 100644 (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: {})",