]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: fix shellcheck warnings
authorLuca Boccassi <bluca@debian.org>
Mon, 5 Jun 2023 21:48:06 +0000 (22:48 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 6 Jun 2023 01:37:36 +0000 (02:37 +0100)
test/hwdb-test.sh
test/test-sysusers.sh.in

index 3efbad21b6f1f91eae40c0f6d1759523ce8743cc..432a49fa1b4d3bd1ded55ddfc637ffef186bc50f 100755 (executable)
@@ -28,11 +28,11 @@ cp -a "$ROOTDIR/hwdb.d" "$D/etc/udev/hwdb.d"
 err=$("$SYSTEMD_HWDB" update --root "$D" 2>&1 >/dev/null) && rc= || rc=$?
 if [ -n "$err" ]; then
     echo "$err"
-    exit ${rc:-1}
+    exit "${rc:-1}"
 fi
 if [ -n "$rc" ]; then
     echo "$SYSTEMD_HWDB returned $rc"
-    exit $rc
+    exit "$rc"
 fi
 
 if [ ! -e "$D/etc/udev/hwdb.bin" ]; then
@@ -47,7 +47,7 @@ cp -a "$ROOTDIR/test/hwdb.d" "$D/etc/udev/hwdb.d"
 err=$("$SYSTEMD_HWDB" update --root "$D" 2>&1 >/dev/null) && rc= || rc=$?
 if [ -n "$rc" ]; then
     echo "$SYSTEMD_HWDB returned $rc"
-    exit $rc
+    exit "$rc"
 fi
 if [ -n "$err" ]; then
     echo "Expected warnings"
index 3bcc87561fd5b1ac97d20aae798b5de95e55d48d..5d66c6776d2daa104df9bbcb285bd85caa43130b 100755 (executable)
@@ -140,7 +140,7 @@ for f in $(find "$SOURCE"/test-*.input | sort -V); do
 
     # shellcheck disable=SC2050
     [ @ENABLE_COMPAT_MUTABLE_UID_BOUNDARIES@ = 1 ] && bound=555 || bound=$system_guid_max
-    compare "${f%.*}" "(with login.defs)" $bound
+    compare "${f%.*}" "(with login.defs)" "$bound"
 done
 
 rm -f "$TESTDIR"/etc/sysusers.d/* "$TESTDIR"/usr/lib/sysusers.d/*
@@ -156,7 +156,7 @@ for f in $(find "$SOURCE"/test-*.input | sort -V); do
 
     # shellcheck disable=SC2050
     [ @ENABLE_COMPAT_MUTABLE_UID_BOUNDARIES@ = 1 ] && bound=555 || bound=$system_guid_max
-    compare "${f%.*}" "(with login.defs symlinked)" $bound
+    compare "${f%.*}" "(with login.defs symlinked)" "$bound"
 done
 
 rm -f "$TESTDIR"/etc/sysusers.d/* "$TESTDIR"/usr/lib/sysusers.d/*