]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: simplify unit check
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 15 Apr 2024 18:52:59 +0000 (20:52 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 16 Apr 2024 12:25:57 +0000 (14:25 +0200)
test/units/testsuite-50.dissect.sh

index a1c1c42b968192136439fc4561b700e3035c7b73..34e60aa76f06b1db0da356843d0b5a75a03f3560 100755 (executable)
@@ -318,12 +318,8 @@ mksquashfs /tmp/wrong/foo /tmp/wrong.raw
 systemctl mount-image --mkdir testservice-50d.service /tmp/wrong.raw /tmp/img
 test "$(systemctl show -P SubState testservice-50d.service)" = "running"
 systemctl mount-image --mkdir testservice-50d.service "$MINIMAL_IMAGE.raw" /tmp/img root:nosuid
-
-while systemctl show -P SubState testservice-50d.service | grep -q running
-do
-    sleep 0.1
-done
-
+# shellcheck disable=SC2016
+timeout 30s bash -xec 'while [[ $(systemctl show -P SubState testservice-50d.service) == running ]]; do sleep .2; done'
 systemctl is-active testservice-50d.service
 
 # ExtensionImages will set up an overlay