8d419f
From 494045e03c7e1b81ac4dcea7d4bf776e2bc50c77 Mon Sep 17 00:00:00 2001
8d419f
From: Frantisek Sumsal <frantisek@sumsal.cz>
8d419f
Date: Thu, 10 Feb 2022 12:29:53 +0100
8d419f
Subject: [PATCH] test: accept GC'ed units in newer LVM
8d419f
8d419f
Since lvm 2.03.15 the transient units are started without `-r`, thus
8d419f
disappearing once they finish and breaking the test (which expects them
8d419f
to remain loaded after finishing). Let's accept `LoadState=not-found` as
8d419f
a valid result as well to fix this.
8d419f
8d419f
Follow-up to: d10d562bd4b9f93130fb2b23f2b0d0d4126ea7d4
8d419f
See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855
8d419f
8d419f
(cherry picked from commit b034f02c628057c30a2136289a1b388a6fb9a737)
8d419f
8d419f
Related: #2017035
8d419f
---
8d419f
 test/units/testsuite-64.sh | 8 ++++++++
8d419f
 1 file changed, 8 insertions(+)
8d419f
8d419f
diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh
8d419f
index f75382d90a..dc8b263b10 100755
8d419f
--- a/test/units/testsuite-64.sh
8d419f
+++ b/test/units/testsuite-64.sh
8d419f
@@ -96,6 +96,14 @@ helper_wait_for_lvm_activate() {
8d419f
             if [[ "$(systemctl show -P SubState "$lvm_activate_svc")" == exited ]]; then
8d419f
                 return 0
8d419f
             fi
8d419f
+        else
8d419f
+            # Since lvm 2.03.15 the lvm-activate transient unit no longer remains
8d419f
+            # after finishing, so we have to treat non-existent units as a success
8d419f
+            # as well
8d419f
+            # See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855
8d419f
+            if [[ "$(systemctl show -P LoadState "$lvm_activate_svc")" == not-found ]]; then
8d419f
+                return 0
8d419f
+            fi
8d419f
         fi
8d419f
 
8d419f
         sleep .5