]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop whitespace after shell redirection operators main
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Sat, 30 May 2026 20:21:19 +0000 (22:21 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 20 Jun 2026 00:41:46 +0000 (01:41 +0100)
22 files changed:
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/success-failure-test-failure.service
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh
test/test-shutdown.py
test/units/TEST-02-UNITTESTS.sh
test/units/TEST-07-PID1.transient-unit-container.sh
test/units/TEST-13-NSPAWN.importctl.sh
test/units/TEST-13-NSPAWN.nspawn.sh
test/units/TEST-13-NSPAWN.pull-oci.sh
test/units/TEST-13-NSPAWN.unpriv.sh
test/units/TEST-17-UDEV.global-property.sh
test/units/TEST-17-UDEV.queued-events-serialization.sh
test/units/TEST-23-UNIT-FILE.statedir.sh
test/units/TEST-34-DYNAMICUSERMIGRATE.sh
test/units/TEST-35-LOGIN.sh
test/units/TEST-46-HOMED.sh
test/units/TEST-74-AUX-UTILS.varlinkctl.sh
test/units/TEST-78-SIGQUEUE.sh
test/units/TEST-80-NOTIFYACCESS.sh
test/units/TEST-87-AUX-UTILS-VM.coredump.sh
test/units/TEST-90-RESTRICT-FSACCESS.dm-verity-keyring.sh
test/units/TEST-90-RESTRICT-FSACCESS.enforce.sh
test/units/TEST-91-LIVEUPDATE.sh

index f4ce013da8dde7a7c622216249b710668f6ca3ad..008906cf3b28406cae2177d18b7de3edca03ba0f 100644 (file)
@@ -1,3 +1,3 @@
 [Service]
 Type=notify
-ExecStart=bash -c "echo failure >> /tmp/success-failure-test-result && systemd-notify --ready && sleep infinity"
+ExecStart=bash -c "echo failure >>/tmp/success-failure-test-result && systemd-notify --ready && sleep infinity"
index 4cb041a2845cfca35e44e31b468a3ca5dfe7cde8..5b5daf561847167b4555de26c5f7d9e76c85cfbd 100755 (executable)
@@ -12,7 +12,7 @@ FILE="/tmp/fdstore-data.$PINNED"
 # a restart, the third a stop followed by a start
 
 if [ -e "$COUNTER" ] ; then
-    read -r N < "$COUNTER"
+    read -r N <"$COUNTER"
 else
     N=0
 fi
@@ -23,13 +23,13 @@ if [ "$N" -eq 0 ] ; then
     # First iteration
     test "${LISTEN_FDS:-0}" -eq 0
     test ! -e "$FILE"
-    echo waldi > "$FILE"
-    systemd-notify --fd=3 --fdname="fd-$N-$PINNED" 3< "$FILE"
+    echo waldi >"$FILE"
+    systemd-notify --fd=3 --fdname="fd-$N-$PINNED" 3<"$FILE"
 elif [ "$N" -eq 1 ] || { [ "$N" -eq 2 ] && [ "$PINNED" -eq 1 ]; } ; then
     # Second iteration, or iteration with pinning on
     test "${LISTEN_FDS:-0}" -eq 1
     # We reopen fd #3 here, so that the read offset is at zero each time (hence no <&3 here…)
-    read -r word < /proc/self/fd/3
+    read -r word </proc/self/fd/3
     test "$word" = "waldi"
 else
     test "${LISTEN_FDS:-0}" -eq 0
@@ -39,7 +39,7 @@ fi
 if [ "$N" -ge 2 ] ; then
     rm "$COUNTER" "$FILE"
 else
-    echo $((N + 1)) > "$COUNTER"
+    echo $((N + 1)) >"$COUNTER"
 fi
 
 systemd-notify --ready --status="Ready"
index 1fe96c8828d73e564aefc4dfa4ecd7da52cdf1b5..9c63f131df3f6f9fa6a0e625822fbad917053f7a 100755 (executable)
@@ -94,7 +94,7 @@ def run(args):
         console.sendline('root')
         console.expect('bash.*# ', 10)
 
-        console.sendline('> /testok')
+        console.sendline('>/testok')
 
         logger.info('power off')
         console.sendline('poweroff')
index 2a38062a4104631bab9f7dc5d9d960d02e854375..25d3b8a5b32490f6acdbeba3d259659dd1098013 100755 (executable)
@@ -80,7 +80,7 @@ run_test() {
         --unit="$name" \
         --wait "$test" && ret=0 || ret=$?
 
-    exec {LOCK_FD}> /lock
+    exec {LOCK_FD}>/lock
     flock --exclusive ${LOCK_FD}
 
     if [[ $ret -eq 77 ]] || [[ $ret -eq 127 ]]; then
index 03ffa91a7025cdb1a209de6b1a7bda6782a1029d..af2e1e9315ff199be21f4d34e187042c44faa126 100755 (executable)
@@ -112,7 +112,7 @@ config_container_service() {
     mkdir -p "$container_systemd_dir"
 
     # Generate a phony random machine-id for the container
-    uuidgen -r | tr -d '-' | tr '[:upper:]' '[:lower:]' > "${CONTAINER_ROOT_FS}/etc/machine-id"
+    uuidgen -r | tr -d '-' | tr '[:upper:]' '[:lower:]' >"${CONTAINER_ROOT_FS}/etc/machine-id"
 
     cat <<EOF >"$internal_test_service"
 [Unit]
@@ -121,7 +121,7 @@ After=basic.target
 
 [Service]
 Type=oneshot
-ExecStart=bash -c 'echo "$EXPECTED_OUTPUT"  > "$guest_output"'
+ExecStart=bash -c 'echo "$EXPECTED_OUTPUT"  >"$guest_output"'
 ExecStartPost=systemctl --no-block exit 0
 TimeoutStopSec=15s
 
index 7eae005f85c73c80687f41bbd7755826bedc452c..88fde60d02a1352478cba9226d24e0d1d7fdf3f2 100755 (executable)
@@ -71,8 +71,8 @@ varlinkctl call --more /run/systemd/io.systemd.Import io.systemd.Import.ListTran
 varlinkctl call --more /run/systemd/io.systemd.Import io.systemd.Import.Pull '{"class":"confext","remote":"file:///var/tmp/importtest.tar.gz","local":"importtest8","type":"tar","verify":"no"}'
 cmp /var/tmp/importtest /var/lib/confexts/importtest8/importtest
 
-echo -n "systemd.pull=tar,confext,verify=no:importtest9:file:///var/tmp/importtest.tar.gz " > "$TEST_CMDLINE"
-cat /proc/cmdline >> "$TEST_CMDLINE"
+echo -n "systemd.pull=tar,confext,verify=no:importtest9:file:///var/tmp/importtest.tar.gz " >"$TEST_CMDLINE"
+cat /proc/cmdline >>"$TEST_CMDLINE"
 mount --bind "$TEST_CMDLINE" /proc/cmdline
 
 cat /proc/cmdline
index 4d38054d943968d2301d5b1eca12dc9db0076f79..4c9173bfe03d14c96a86508039a9e95660d607c4 100755 (executable)
@@ -1525,7 +1525,7 @@ testcase_link_journal_host() {
     root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.link-journal.XXX)"
     create_dummy_container "$root"
 
-    systemd-id128 new > "$root"/etc/machine-id
+    systemd-id128 new >"$root"/etc/machine-id
 
     hoge="/var/log/journal/$(cat "$root"/etc/machine-id)/"
     mkdir -p "$hoge"
index bd42aa0af544574b6174cf6325290d14dd493bc3..b2a6382377a8ddfac9f80218add249d6937e01ac 100755 (executable)
@@ -101,7 +101,7 @@ EOF
 cat /var/tmp/pull-oci-test/v2/ocicombo/manifests/latest
 jq < /var/tmp/pull-oci-test/v2/ocicombo/manifests/latest
 
-cat > /usr/lib/systemd/oci-registry/registry.localfile.oci-registry <<EOF
+cat >/usr/lib/systemd/oci-registry/registry.localfile.oci-registry <<EOF
 {
         "defaultProtocol" : "file",
         "overrideRegistry" : "/var/tmp/pull-oci-test"
index 31a75eae3f10ae96269541784aae584f4bf24b87..086b1fe6f6f78115d5901e079c0b094f4ebfe6f1 100755 (executable)
@@ -67,7 +67,7 @@ EOF
 loginctl enable-linger testuser
 
 run0 -u testuser mkdir -p .config/systemd/nspawn/
-run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" > .config/systemd/nspawn/zurps.nspawn"
+run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" >.config/systemd/nspawn/zurps.nspawn"
 run0 -u testuser systemctl start --user systemd-nspawn@zurps.service
 
 machinectl status zurps
@@ -194,14 +194,14 @@ run0 -u testuser mkdir /var/tmp/image-tar
 run0 -u testuser importctl --user export-tar zurps /var/tmp/image-tar/kurps.tar.gz -m
 run0 -u testuser importctl --user import-tar /var/tmp/image-tar/kurps.tar.gz -m
 
-run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" > .config/systemd/nspawn/kurps.nspawn"
+run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" >.config/systemd/nspawn/kurps.nspawn"
 run0 -u testuser systemctl start --user systemd-nspawn@kurps.service
 machinectl terminate kurps
 
-run0 -u testuser -D /var/tmp/image-tar/ bash -c 'sha256sum kurps.tar.gz > SHA256SUMS'
+run0 -u testuser -D /var/tmp/image-tar/ bash -c 'sha256sum kurps.tar.gz >SHA256SUMS'
 run0 -u testuser importctl --user pull-tar file:///var/tmp/image-tar/kurps.tar.gz nurps --verify=checksum -m
 
-run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" > .config/systemd/nspawn/nurps.nspawn"
+run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" >.config/systemd/nspawn/nurps.nspawn"
 run0 -u testuser systemctl start --user systemd-nspawn@nurps.service
 machinectl terminate nurps
 
@@ -234,7 +234,7 @@ assert_in 'wamms' "$(run0 -u testuser machinectl --user list-images)"
 run0 -u testuser machinectl --user image-status wamms
 run0 -u testuser machinectl --user show-image wamms
 
-run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" > .config/systemd/nspawn/wamms.nspawn"
+run0 -u testuser -i "echo -e \"[Exec]\nKillSignal=SIGKILL\n\" >.config/systemd/nspawn/wamms.nspawn"
 run0 -u testuser systemctl start --user systemd-nspawn@wamms.service
 
 run0 -u testuser systemctl stop --user systemd-nspawn@zurps.service
index c9b070e2036ad77a54cce8cefd235197e48f7040..d1648ab9241e248b602130b1a69c2a2e5cb804c8 100755 (executable)
@@ -31,7 +31,7 @@ trap cleanup EXIT
 rules="/run/udev/rules.d/99-test-17.global-property.rules"
 
 mkdir -p "${rules%/*}"
-cat > "$rules" <<'EOF'
+cat >"$rules" <<'EOF'
 ENV{FOO}=="?*", ENV{PROP_FOO}="$env{FOO}"
 ENV{BAR}=="?*", ENV{PROP_BAR}="$env{BAR}"
 EOF
index 6720b835a3455a091a71a563b6db1e8dfb225c98..4d04e0ef64c359a2fa7d6465fee5f25a9fd89d65 100755 (executable)
@@ -11,7 +11,7 @@ set -o pipefail
 rules="/run/udev/rules.d/99-test-17.serialization.rules"
 
 mkdir -p "${rules%/*}"
-cat > "$rules" <<'EOF'
+cat >"$rules" <<'EOF'
 SUBSYSTEM!="mem", GOTO="end"
 KERNEL!="null", GOTO="end"
 ACTION=="remove", GOTO="end"
@@ -19,7 +19,7 @@ ACTION=="remove", GOTO="end"
 IMPORT{db}="INVOCATIONS"
 IMPORT{program}="/usr/bin/bash -c 'systemctl show --property=InvocationID systemd-udevd.service'"
 ENV{INVOCATIONS}+="%E{ACTION}_%E{SEQNUM}_%E{InvocationID}"
-ACTION=="add", RUN+="/usr/bin/bash -c ':/tmp/marker'", RUN+="/usr/bin/sleep 10"
+ACTION=="add", RUN+="/usr/bin/bash -c ': >/tmp/marker'", RUN+="/usr/bin/sleep 10"
 
 LABEL="end"
 EOF
index 64de27f55cc2c51175a479b31f6d980e38c18c52..b6e5abd6a1fee3c3b6de5996c1fa16e79ea7e19e 100755 (executable)
@@ -56,8 +56,8 @@ test "$(readlink "$HOME"/.local/state/foo)" = ../../.config/foo
 # Check that this will work safely a second time
 systemd-run --user -p StateDirectory=foo -p ConfigurationDirectory=foo --wait true
 
-( ! systemd-run --user -p StateDirectory=foo::ro --wait bash -c "echo foo > $HOME/.local/state/foo/baz")
-( ! systemd-run --user -p StateDirectory=foo:bar:ro --wait bash -c "echo foo > $HOME/.local/state/foo/baz")
+( ! systemd-run --user -p StateDirectory=foo::ro --wait bash -c "echo foo >$HOME/.local/state/foo/baz")
+( ! systemd-run --user -p StateDirectory=foo:bar:ro --wait bash -c "echo foo >$HOME/.local/state/foo/baz")
 ( ! test -f "$HOME"/.local/state/foo/baz)
 test -L "$HOME"/.local/state/bar
 
index 601e44098d376513c280019fc2e561f6a15d1ed9..2928a21066b123b70c54fd5f8410ea3daf8ad22b 100755 (executable)
@@ -23,7 +23,7 @@ test_directory() {
     (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"=zzz test -f "${path}"/zzz/test-missing)
     systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -d "${path}"/www
     systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -L "${path}"/ro
-    (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo > ${path}/www/test-missing")
+    (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo >${path}/www/test-missing")
 
     test -d "${path}"/zzz
     test ! -L "${path}"/zzz
@@ -50,7 +50,7 @@ test_directory() {
     (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"=zzz test -f "${path}"/zzz/test-missing)
     systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" test -d "${path}"/www
     systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" test -L "${path}"/ro
-    (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo > ${path}/www/test-missing")
+    (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo >${path}/www/test-missing")
 
     test -L "${path}"/zzz
     test -d "${path}"/private/zzz
@@ -76,7 +76,7 @@ test_directory() {
     (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"=zzz test -f "${path}"/zzz/test-missing)
     systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -d "${path}"/www
     systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -L "${path}"/ro
-    (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo > ${path}/www/test-missing")
+    (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo >${path}/www/test-missing")
 
     test -d "${path}"/zzz
     test ! -L "${path}"/zzz
index e4f9621c8d9a42d574fea3c70bf14a9e7c902b96..f3974ed7b7ac6aba8968bd424bc002a9145f668c 100755 (executable)
@@ -694,7 +694,7 @@ session optional   pam_systemd.so default-capability-ambient-set=CAP_CHOWN,CAP_K
 session required   pam_unix.so
 EOF
 
-    cat > "$SCRIPT" <<'EOF'
+    cat >"$SCRIPT" <<'EOF'
 #!/usr/bin/env bash
 set -ex
 typeset -i AMB MASK
index 660ccab18a33c68f72fc2a0e32675ab54f9ea057..5d090b016fcf3dfc4474befae87ddb07fac0dd28 100755 (executable)
@@ -1016,12 +1016,12 @@ testcase_fscrypt() {
             bash -c 'keyctl link @u @s; eval "$1"' -- "$2"
     }
 
-    fscrypt_run0 fsfsfs1234 'echo "hello fscrypt" > /home/fscrypttest/file1'
+    fscrypt_run0 fsfsfs1234 'echo "hello fscrypt" >/home/fscrypttest/file1'
     [[ "$(fscrypt_run0 fsfsfs1234 'cat /home/fscrypttest/file1')" == "hello fscrypt" ]]
     fscrypt_run0 fsfsfs1234 'mkdir /home/fscrypttest/subdir'
     fscrypt_run0 fsfsfs1234 'dd if=/dev/urandom of=/home/fscrypttest/subdir/blob bs=4096 count=8 status=none'
     fscrypt_run0 fsfsfs1234 'cp /home/fscrypttest/subdir/blob /home/fscrypttest/subdir/blob.copy && cmp /home/fscrypttest/subdir/blob /home/fscrypttest/subdir/blob.copy'
-    fscrypt_run0 fsfsfs1234 'echo appended >> /home/fscrypttest/file1 && grep -F appended /home/fscrypttest/file1 >/dev/null'
+    fscrypt_run0 fsfsfs1234 'echo appended >>/home/fscrypttest/file1 && grep -F appended /home/fscrypttest/file1 >/dev/null'
     fscrypt_run0 fsfsfs1234 'rm /home/fscrypttest/subdir/blob.copy && test ! -e /home/fscrypttest/subdir/blob.copy'
 
     systemctl stop user@"$(id -u fscrypttest)".service 2>/dev/null || true
index 0e95360000be4899bc6ea717b7bc98969f8f0d9c..ed2e0cb73bd0e775ab4d2eb80a46d59478c30389 100755 (executable)
@@ -106,7 +106,7 @@ rm_rf_sshbindir() {
 trap rm_rf_sshbindir EXIT
 
 # Create a fake "ssh" binary that validates everything works as expected if invoked for the "ssh-unix:" Varlink transport
-cat > "$SSHBINDIR"/ssh <<'EOF'
+cat >"$SSHBINDIR"/ssh <<'EOF'
 #!/usr/bin/env bash
 
 set -xe
@@ -122,7 +122,7 @@ chmod +x "$SSHBINDIR"/ssh
 SYSTEMD_SSH="$SSHBINDIR/ssh" varlinkctl info ssh-unix:foobar:/run/systemd/journal/io.systemd.journal
 
 # Now build another fake "ssh" binary that does the same for "ssh-exec:"
-cat > "$SSHBINDIR"/ssh <<'EOF'
+cat >"$SSHBINDIR"/ssh <<'EOF'
 #!/usr/bin/env bash
 
 set -xe
@@ -294,8 +294,8 @@ chmod +x "$UPGRADE_SERVER"
 UPGRADE_SOCKET2="$(mktemp -d)/upgrade.sock"
 systemd-notify --fork -q -- python3 "$UPGRADE_SERVER" "$UPGRADE_SOCKET2"
 
-echo "file input test" > /tmp/test-upgrade-input
-result="$(varlinkctl call --upgrade "unix:$UPGRADE_SOCKET2" io.systemd.test.Reverse '{"foo":"file"}' < /tmp/test-upgrade-input)"
+echo "file input test" >/tmp/test-upgrade-input
+result="$(varlinkctl call --upgrade "unix:$UPGRADE_SOCKET2" io.systemd.test.Reverse '{"foo":"file"}' </tmp/test-upgrade-input)"
 echo "$result" | grep "<<< UPGRADED >>>" >/dev/null
 echo "$result" | grep '"foo": "file"' >/dev/null
 echo "$result" | grep "tset tupni elif" >/dev/null
@@ -303,7 +303,7 @@ echo "$result" | grep "tset tupni elif" >/dev/null
 # Test --upgrade over ssh-exec: transport (pipe pair, not a bidirectional socket).
 # This exercises the input_fd != output_fd path in sd_varlink_call_and_upgrade().
 # Reuse the same server script without a socket argument - it speaks over stdin/stdout.
-cat > "$SSHBINDIR"/ssh <<EOF
+cat >"$SSHBINDIR"/ssh <<EOF
 #!/usr/bin/env bash
 exec python3 "$UPGRADE_SERVER"
 EOF
@@ -322,7 +322,7 @@ systemd-notify --fork -q -- python3 "$UPGRADE_SERVER" "$UPGRADE_SOCKET"
 # Since stdout goes to the socket (not the terminal), write results to a file for verification.
 EXEC_RESULT="$(mktemp)"
 varlinkctl call --upgrade --exec "unix:$UPGRADE_SOCKET" io.systemd.test.Reverse '{"foo":"bar"}' -- \
-        bash -c "head -2 > '$EXEC_RESULT'; echo 'hello world'; head -1 >> '$EXEC_RESULT'"
+        bash -c "head -2 >'$EXEC_RESULT'; echo 'hello world'; head -1 >>'$EXEC_RESULT'"
 grep "<<< UPGRADED >>>" "$EXEC_RESULT" >/dev/null
 grep '"foo": "bar"' "$EXEC_RESULT" >/dev/null
 grep "dlrow olleh" "$EXEC_RESULT" >/dev/null
@@ -358,8 +358,8 @@ SERVE_PID=$(systemd-notify --fork -- \
                                    varlinkctl serve io.systemd.Compress.Decompress gunzip)
 
 SERVE_TMPDIR="$(mktemp -d)"
-echo "untrusted data decompressed safely via varlink serve" | gzip > "$SERVE_TMPDIR/compressed.gz"
-result="$(varlinkctl call --upgrade "unix:$SERVE_SOCKET" io.systemd.Compress.Decompress '{}' < "$SERVE_TMPDIR/compressed.gz")"
+echo "untrusted data decompressed safely via varlink serve" | gzip >"$SERVE_TMPDIR/compressed.gz"
+result="$(varlinkctl call --upgrade "unix:$SERVE_SOCKET" io.systemd.Compress.Decompress '{}' <"$SERVE_TMPDIR/compressed.gz")"
 echo "$result" | grep "untrusted data decompressed safely" >/dev/null
 kill "$SERVE_PID" 2>/dev/null || true
 wait "$SERVE_PID" 2>/dev/null || true
index 552d61bb21b00a85ad5d88093263c76ae162abac..ae9fc2a7f1812f36511165dd6e4f01e26818b981 100755 (executable)
@@ -3,7 +3,7 @@
 set -ex
 set -o pipefail
 
-if ! env --block-signal=SIGUSR1 true 2> /dev/null ; then
+if ! env --block-signal=SIGUSR1 true 2>/dev/null; then
     echo "env tool too old, can't block signals, skipping test." >&2
     echo OK >/testok
     exit 0
index 0f7fec17ae87816abcc9d371ff5389033a442643..4439e46362933d1edfe6e575700092d8f9491469 100755 (executable)
@@ -10,7 +10,7 @@ set -o pipefail
 mkfifo /tmp/syncfifo1 /tmp/syncfifo2
 
 sync_in() {
-    read -r x < /tmp/syncfifo1
+    read -r x </tmp/syncfifo1
     test "$x" = "$1"
 }
 
@@ -100,14 +100,14 @@ assert_in "D-Bus: org.freedesktop.DBus.Error.UnknownObject" "$(systemctl status
 # Now test basic fdstore behaviour
 
 MYSCRIPT="/tmp/myscript$RANDOM.sh"
-cat >> "$MYSCRIPT" <<'EOF'
+cat >>"$MYSCRIPT" <<'EOF'
 #!/usr/bin/env bash
 set -eux
 set -o pipefail
 test "$FDSTORE" -eq 7
 N="/tmp/$RANDOM"
-echo $RANDOM > "$N"
-systemd-notify --fd=4 --fdname=quux --pid=parent 4< "$N"
+echo $RANDOM >"$N"
+systemd-notify --fd=4 --fdname=quux --pid=parent 4<"$N"
 rm "$N"
 systemd-notify --ready
 exec sleep infinity
index 675d37184b5716a9c30ba1693153436166428000..ae7b38ab029bedc6f3669f991ff3a8d448f57406 100755 (executable)
@@ -84,7 +84,7 @@ if cgroupfs_supports_user_xattrs; then
     mkdir -p "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d"
     # Bind-mounting /etc into the container kinda defeats the purpose of --volatile=,
     # but we need the ASan-related overrides scattered across /etc
-    cat > "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d/override.conf" <<EOF
+    cat >"/run/systemd/system/systemd-nspawn@$CONTAINER.service.d/override.conf" <<EOF
 [Service]
 ExecStart=
 ExecStart=systemd-nspawn --quiet --link-journal=try-guest --keep-unit --machine=%i --boot \
index 6237483a4575c5d13a4ddf6261f44847df864244..b1c1de2583abf15e75981e5103521d5aac04ddc7 100755 (executable)
@@ -85,7 +85,7 @@ HELPER_PID=$!
 while IFS= read -r -t 60 line <&3; do
     echo "$line"
     [[ "$line" == LINK_IDS=* ]] && break
-done > /tmp/restrict-fsaccess-dvk-attach.out
+done >/tmp/restrict-fsaccess-dvk-attach.out
 
 # Fail closed if helper died before printing the full handshake: an unattached
 # program would let the subsequent verity exec test pass trivially.
index a9db974803678c0f7b773c4e2efa81bd8dd97d3f..ad1093f44f4e03e0f421cf8363bd28aba8450298 100755 (executable)
@@ -119,7 +119,7 @@ HELPER_PID=$!
 while IFS= read -r -t 60 line <&3; do
     echo "$line"
     [[ "$line" == LINK_IDS=* ]] && break
-done > /tmp/restrict-fsaccess-attach.out
+done >/tmp/restrict-fsaccess-attach.out
 
 VERITY_MAP_ID=$(sed -n 's/^VERITY_MAP_ID=//p' /tmp/restrict-fsaccess-attach.out)
 BSS_MAP_ID=$(sed -n 's/^BSS_MAP_ID=//p' /tmp/restrict-fsaccess-attach.out)
index bea029afa28d52e9429cef9546428a83fa4f6db5..a295c4c230d6f85bf85eac1bdfa1242839cd0576 100755 (executable)
@@ -187,7 +187,7 @@ set -eux
 state_file=/run/TEST-91-LIVEUPDATE-failure.attempt
 attempt=$(cat "$state_file" 2>/dev/null || echo 0)
 attempt=$((attempt + 1))
-echo "$attempt" > "$state_file"
+echo "$attempt" >"$state_file"
 if [[ "$attempt" -eq 1 ]]; then
     systemd-notify --fd=0 --fdname=mem </dev/zero
 else
@@ -267,8 +267,8 @@ else
 
     # Exercise the FD-store preservation chain across a kexec for a privileged
     # nspawn container managed as a system service:
-    #   payload (inside container) -> systemd-nspawn@fdstore.service fdstore
-    #   -> LUO -> after kexec PID 1 restores the fdstore -> systemd-nspawn ->
+    #   payload (inside container)  systemd-nspawn@fdstore.service fdstore
+    #   → LUO → after kexec PID 1 restores the fdstore → systemd-nspawn →
     #   payload verifies content matches.
     create_dummy_container /var/lib/machines/fdstore
     cat >/var/lib/machines/fdstore/sbin/init <<'EOF'