summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-03-31 08:00:00 +0000
committerMike Yuan <me@yhndnzj.com>2023-04-01 01:48:44 +0800
commite873a9f18a321f27f8015646c390d2112b5f8464 (patch)
tree0c234139bb4b1d680f3ece6c898e1ba87e09da06 /test
parent27d45db38c29d0eb5e2d707507b066438340a792 (diff)
downloadsystemd-e873a9f18a321f27f8015646c390d2112b5f8464.tar.gz
treewide: fix unnecessary $ on arithmetic variables
This should fix shellcheck warning SC2004.
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-35.sh2
-rwxr-xr-xtest/units/testsuite-57-short-lived.sh2
-rwxr-xr-xtest/units/testsuite-59.sh6
3 files changed, 5 insertions, 5 deletions
diff --git a/test/units/testsuite-35.sh b/test/units/testsuite-35.sh
index 8dcd7563bb..0b83a6a536 100755
--- a/test/units/testsuite-35.sh
+++ b/test/units/testsuite-35.sh
@@ -591,7 +591,7 @@ test_ambient_caps() {
# CAP_CHOWN | CAP_KILL
MASK=$(((1 << 0) | (1 << 5)))
- if [ $(("$BND" & "$MASK")) -ne "$MASK" ] ; then
+ if [ $((BND & MASK)) -ne "$MASK" ] ; then
echo "CAP_CHOWN or CAP_KILL not available in bounding set, skipping test." >&2
return
fi
diff --git a/test/units/testsuite-57-short-lived.sh b/test/units/testsuite-57-short-lived.sh
index 115b0d56f6..e596392204 100755
--- a/test/units/testsuite-57-short-lived.sh
+++ b/test/units/testsuite-57-short-lived.sh
@@ -4,7 +4,7 @@ set -ex
if [ -f /tmp/testsuite-57.counter ] ; then
read -r counter < /tmp/testsuite-57.counter
- counter=$(("$counter" + 1))
+ counter=$((counter + 1))
else
counter=0
fi
diff --git a/test/units/testsuite-59.sh b/test/units/testsuite-59.sh
index db8dc27ab9..aabebb2bb6 100755
--- a/test/units/testsuite-59.sh
+++ b/test/units/testsuite-59.sh
@@ -116,13 +116,13 @@ LEAVE=0
function reload() {
systemd-notify --reloading --status="Adding 11 to exit status"
- EXIT_STATUS=\$((\$EXIT_STATUS + 11))
+ EXIT_STATUS=\$((EXIT_STATUS + 11))
systemd-notify --ready --status="Back running"
}
function leave() {
systemd-notify --stopping --status="Adding 7 to exit status"
- EXIT_STATUS=\$((\$EXIT_STATUS + 7))
+ EXIT_STATUS=\$((EXIT_STATUS + 7))
LEAVE=1
return 0
}
@@ -138,7 +138,7 @@ while [ \$LEAVE = 0 ] ; do
done
systemd-notify --status="Adding 3 to exit status"
-EXIT_STATUS=\$((\$EXIT_STATUS + 3))
+EXIT_STATUS=\$((EXIT_STATUS + 3))
exit \$EXIT_STATUS
EOF