From: Zbigniew Jędrzejewski-Szmek Date: Sat, 30 May 2026 20:21:19 +0000 (+0200) Subject: test: drop whitespace after shell redirection operators X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=075036f2057cc476bfe42e3cc72d1a39bcc46f3d;p=thirdparty%2Fsystemd.git test: drop whitespace after shell redirection operators --- diff --git a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/success-failure-test-failure.service b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/success-failure-test-failure.service index f4ce013da8d..008906cf3b2 100644 --- a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/success-failure-test-failure.service +++ b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/success-failure-test-failure.service @@ -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" diff --git a/test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh b/test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh index 4cb041a2845..5b5daf56184 100755 --- a/test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh +++ b/test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh @@ -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 "$COUNTER" + echo $((N + 1)) >"$COUNTER" fi systemd-notify --ready --status="Ready" diff --git a/test/test-shutdown.py b/test/test-shutdown.py index 1fe96c8828d..9c63f131df3 100755 --- a/test/test-shutdown.py +++ b/test/test-shutdown.py @@ -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') diff --git a/test/units/TEST-02-UNITTESTS.sh b/test/units/TEST-02-UNITTESTS.sh index 2a38062a410..25d3b8a5b32 100755 --- a/test/units/TEST-02-UNITTESTS.sh +++ b/test/units/TEST-02-UNITTESTS.sh @@ -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 diff --git a/test/units/TEST-07-PID1.transient-unit-container.sh b/test/units/TEST-07-PID1.transient-unit-container.sh index 03ffa91a702..af2e1e9315f 100755 --- a/test/units/TEST-07-PID1.transient-unit-container.sh +++ b/test/units/TEST-07-PID1.transient-unit-container.sh @@ -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 <"$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 diff --git a/test/units/TEST-13-NSPAWN.importctl.sh b/test/units/TEST-13-NSPAWN.importctl.sh index 7eae005f85c..88fde60d02a 100755 --- a/test/units/TEST-13-NSPAWN.importctl.sh +++ b/test/units/TEST-13-NSPAWN.importctl.sh @@ -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 diff --git a/test/units/TEST-13-NSPAWN.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh index 4d38054d943..4c9173bfe03 100755 --- a/test/units/TEST-13-NSPAWN.nspawn.sh +++ b/test/units/TEST-13-NSPAWN.nspawn.sh @@ -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" diff --git a/test/units/TEST-13-NSPAWN.pull-oci.sh b/test/units/TEST-13-NSPAWN.pull-oci.sh index bd42aa0af54..b2a6382377a 100755 --- a/test/units/TEST-13-NSPAWN.pull-oci.sh +++ b/test/units/TEST-13-NSPAWN.pull-oci.sh @@ -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 </usr/lib/systemd/oci-registry/registry.localfile.oci-registry < .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 diff --git a/test/units/TEST-17-UDEV.global-property.sh b/test/units/TEST-17-UDEV.global-property.sh index c9b070e2036..d1648ab9241 100755 --- a/test/units/TEST-17-UDEV.global-property.sh +++ b/test/units/TEST-17-UDEV.global-property.sh @@ -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 diff --git a/test/units/TEST-17-UDEV.queued-events-serialization.sh b/test/units/TEST-17-UDEV.queued-events-serialization.sh index 6720b835a34..4d04e0ef64c 100755 --- a/test/units/TEST-17-UDEV.queued-events-serialization.sh +++ b/test/units/TEST-17-UDEV.queued-events-serialization.sh @@ -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 diff --git a/test/units/TEST-23-UNIT-FILE.statedir.sh b/test/units/TEST-23-UNIT-FILE.statedir.sh index 64de27f55cc..b6e5abd6a1f 100755 --- a/test/units/TEST-23-UNIT-FILE.statedir.sh +++ b/test/units/TEST-23-UNIT-FILE.statedir.sh @@ -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 diff --git a/test/units/TEST-34-DYNAMICUSERMIGRATE.sh b/test/units/TEST-34-DYNAMICUSERMIGRATE.sh index 601e44098d3..2928a21066b 100755 --- a/test/units/TEST-34-DYNAMICUSERMIGRATE.sh +++ b/test/units/TEST-34-DYNAMICUSERMIGRATE.sh @@ -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 diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index e4f9621c8d9..f3974ed7b7a 100755 --- a/test/units/TEST-35-LOGIN.sh +++ b/test/units/TEST-35-LOGIN.sh @@ -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 diff --git a/test/units/TEST-46-HOMED.sh b/test/units/TEST-46-HOMED.sh index 660ccab18a3..5d090b016fc 100755 --- a/test/units/TEST-46-HOMED.sh +++ b/test/units/TEST-46-HOMED.sh @@ -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 diff --git a/test/units/TEST-74-AUX-UTILS.varlinkctl.sh b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh index 0e95360000b..ed2e0cb73bd 100755 --- a/test/units/TEST-74-AUX-UTILS.varlinkctl.sh +++ b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh @@ -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"}' >>" >/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 <"$SSHBINDIR"/ssh < '$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 diff --git a/test/units/TEST-78-SIGQUEUE.sh b/test/units/TEST-78-SIGQUEUE.sh index 552d61bb21b..ae9fc2a7f18 100755 --- a/test/units/TEST-78-SIGQUEUE.sh +++ b/test/units/TEST-78-SIGQUEUE.sh @@ -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 diff --git a/test/units/TEST-80-NOTIFYACCESS.sh b/test/units/TEST-80-NOTIFYACCESS.sh index 0f7fec17ae8..4439e463629 100755 --- a/test/units/TEST-80-NOTIFYACCESS.sh +++ b/test/units/TEST-80-NOTIFYACCESS.sh @@ -10,7 +10,7 @@ set -o pipefail mkfifo /tmp/syncfifo1 /tmp/syncfifo2 sync_in() { - read -r x < /tmp/syncfifo1 + read -r x > "$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 diff --git a/test/units/TEST-87-AUX-UTILS-VM.coredump.sh b/test/units/TEST-87-AUX-UTILS-VM.coredump.sh index 675d37184b5..ae7b38ab029 100755 --- a/test/units/TEST-87-AUX-UTILS-VM.coredump.sh +++ b/test/units/TEST-87-AUX-UTILS-VM.coredump.sh @@ -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" <"/run/systemd/system/systemd-nspawn@$CONTAINER.service.d/override.conf" < /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. diff --git a/test/units/TEST-90-RESTRICT-FSACCESS.enforce.sh b/test/units/TEST-90-RESTRICT-FSACCESS.enforce.sh index a9db9748036..ad1093f44f4 100755 --- a/test/units/TEST-90-RESTRICT-FSACCESS.enforce.sh +++ b/test/units/TEST-90-RESTRICT-FSACCESS.enforce.sh @@ -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) diff --git a/test/units/TEST-91-LIVEUPDATE.sh b/test/units/TEST-91-LIVEUPDATE.sh index bea029afa28..a295c4c230d 100755 --- a/test/units/TEST-91-LIVEUPDATE.sh +++ b/test/units/TEST-91-LIVEUPDATE.sh @@ -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 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'