tree-wide: drop space after shell redirection ops

Those are all unary operators.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-11-17 16:50:50 +01:00
parent 3a5e748f6b
commit 01100f15ad
29 changed files with 58 additions and 58 deletions
@@ -17,7 +17,7 @@ wait_for_signal() {
} }
sighup_handler() { sighup_handler() {
echo "hup$(( ++COUNTER ))" > /tmp/syncfifo1 echo "hup$(( ++COUNTER ))" >/tmp/syncfifo1
} }
trap sighup_handler SIGHUP trap sighup_handler SIGHUP
@@ -10,7 +10,7 @@ sync_in() {
} }
sync_out() { sync_out() {
echo "$1" > /tmp/syncfifo1 echo "$1" >/tmp/syncfifo1
} }
export SYSTEMD_LOG_LEVEL=debug export SYSTEMD_LOG_LEVEL=debug
+1 -1
View File
@@ -37,7 +37,7 @@ if ret=$("bootctl" --print-boot-path); then
test "$ret" = "/efi" -o "$ret" = "/boot" -o "$ret" = "/boot/efi" test "$ret" = "/efi" -o "$ret" = "/boot" -o "$ret" = "/boot/efi"
fi fi
if "$bootctl" -R > /dev/null ; then if "$bootctl" -R >/dev/null ; then
P=$("$bootctl" -R) P=$("$bootctl" -R)
PP=$("$bootctl" -RR) PP=$("$bootctl" -RR)
+2 -2
View File
@@ -21,7 +21,7 @@ cleanup() {
trap cleanup EXIT trap cleanup EXIT
cat > /run/systemd/system/"$UNIT" <<EOF cat >/run/systemd/system/"$UNIT" <<EOF
[Service] [Service]
ExecStart=true ExecStart=true
RemainAfterExit=yes RemainAfterExit=yes
@@ -32,7 +32,7 @@ systemctl start "$UNIT"
assert_eq "$(systemctl show -P NeedDaemonReload "$UNIT")" no assert_eq "$(systemctl show -P NeedDaemonReload "$UNIT")" no
mkdir /run/systemd/system/"$UNIT".d mkdir /run/systemd/system/"$UNIT".d
cat > /run/systemd/system/"$UNIT".d/desc.conf <<EOF cat >/run/systemd/system/"$UNIT".d/desc.conf <<EOF
[Unit] [Unit]
Description=Test NeedDaemonReload status after creating drop-in Description=Test NeedDaemonReload status after creating drop-in
EOF EOF
+2 -2
View File
@@ -21,13 +21,13 @@ cleanup() {
trap cleanup EXIT trap cleanup EXIT
cat > /run/systemd/system/"$UNIT" <<EOF cat >/run/systemd/system/"$UNIT" <<EOF
[Service] [Service]
ExecStart=true ExecStart=true
EOF EOF
mkdir /run/systemd/system/"$UNIT".d mkdir /run/systemd/system/"$UNIT".d
cat > /run/systemd/system/"$UNIT".d/desc.conf <<EOF cat >/run/systemd/system/"$UNIT".d/desc.conf <<EOF
[Unit] [Unit]
Description=Test NeedDaemonReload status of a masked unit with drop-ins Description=Test NeedDaemonReload status of a masked unit with drop-ins
EOF EOF
+2 -2
View File
@@ -19,7 +19,7 @@ at_exit() {
} }
trap at_exit EXIT trap at_exit EXIT
cat << EOF > /run/systemd/system/mqueue-ownership.socket cat <<EOF >/run/systemd/system/mqueue-ownership.socket
[Unit] [Unit]
Description=Create a message queue with customized ownership Description=Create a message queue with customized ownership
[Socket] [Socket]
@@ -30,7 +30,7 @@ SocketGroup=$group
SocketMode=$mode SocketMode=$mode
EOF EOF
cat << 'EOF' > /run/systemd/system/mqueue-ownership.service cat <<EOF >/run/systemd/system/mqueue-ownership.service
[Unit] [Unit]
Description=Dummy service for the socket unit Description=Dummy service for the socket unit
Requires=%N.socket Requires=%N.socket
+2 -2
View File
@@ -397,7 +397,7 @@ rm -f /tmp/none-existent-file
# server side, to not generate early SIGHUP. Hence, let's just invoke "sleep # server side, to not generate early SIGHUP. Hence, let's just invoke "sleep
# infinity" client side, once we acquired the fd (passing it to it), and kill # infinity" client side, once we acquired the fd (passing it to it), and kill
# it once we verified everything worked. # it once we verified everything worked.
PID=$(systemd-notify --fork -- varlinkctl --exec call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open '{"name": ".host", "mode": "shell", "user": "root", "path": "/usr/bin/bash", "args": ["bash", "-c", "echo $FOO > /tmp/none-existent-file"], "environment": ["FOO=BAR"]}' -- sleep infinity) PID=$(systemd-notify --fork -- varlinkctl --exec call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.Open '{"name": ".host", "mode": "shell", "user": "root", "path": "/usr/bin/bash", "args": ["bash", "-c", "echo $FOO >/tmp/none-existent-file"], "environment": ["FOO=BAR"]}' -- sleep infinity)
timeout 30 bash -c "until test -e /tmp/none-existent-file; do sleep .5; done" timeout 30 bash -c "until test -e /tmp/none-existent-file; do sleep .5; done"
grep -q "BAR" /tmp/none-existent-file grep -q "BAR" /tmp/none-existent-file
kill "$PID" kill "$PID"
@@ -424,7 +424,7 @@ diff /tmp/foo /var/lib/machines/long-running/root/foo
(! varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.CopyTo '{"name": "long-running", "source": "/tmp/foo", "destination": "/root/foo"}') # FileExists (! varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.CopyTo '{"name": "long-running", "source": "/tmp/foo", "destination": "/root/foo"}') # FileExists
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.CopyTo '{"name": "long-running", "source": "/tmp/foo", "destination": "/root/foo", "replace": true}' varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.CopyTo '{"name": "long-running", "source": "/tmp/foo", "destination": "/root/foo", "replace": true}'
echo "sample-test-output" > /tmp/foo echo "sample-test-output" >/tmp/foo
varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.CopyTo '{"name": "long-running", "source": "/tmp/foo", "destination": "/root/foo", "replace": true}' varlinkctl call /run/systemd/machine/io.systemd.Machine io.systemd.Machine.CopyTo '{"name": "long-running", "source": "/tmp/foo", "destination": "/root/foo", "replace": true}'
diff /tmp/foo /var/lib/machines/long-running/root/foo diff /tmp/foo /var/lib/machines/long-running/root/foo
rm -f /tmp/foo /var/lib/machines/long-running/root/foo rm -f /tmp/foo /var/lib/machines/long-running/root/foo
+3 -3
View File
@@ -164,7 +164,7 @@ assert_not_in 'nurps' "$(run0 --pipe -u testuser machinectl --user list-images)"
assert_not_in 'kurps' "$(run0 --pipe -u testuser machinectl --user list-images)" assert_not_in 'kurps' "$(run0 --pipe -u testuser machinectl --user list-images)"
mkdir /home/testuser/.local/state/machines/inodetest mkdir /home/testuser/.local/state/machines/inodetest
echo hallo > /home/testuser/.local/state/machines/inodetest/testfile echo hallo >/home/testuser/.local/state/machines/inodetest/testfile
# Make the file sparse, set an xattr, set an ACL, set a chattr flag, and make it hardlink # Make the file sparse, set an xattr, set an ACL, set a chattr flag, and make it hardlink
ln /home/testuser/.local/state/machines/inodetest/testfile /home/testuser/.local/state/machines/inodetest/testfile.hard ln /home/testuser/.local/state/machines/inodetest/testfile /home/testuser/.local/state/machines/inodetest/testfile.hard
@@ -176,7 +176,7 @@ chown foreign-0:foreign-0 /home/testuser/.local/state/machines/inodetest/testfil
ls -al /home/testuser/.local/state/machines/inodetest ls -al /home/testuser/.local/state/machines/inodetest
# Verify UID squashing # Verify UID squashing
echo gaga > /home/testuser/.local/state/machines/inodetest/squashtest echo gaga >/home/testuser/.local/state/machines/inodetest/squashtest
chown 1000:1000 /home/testuser/.local/state/machines/inodetest/squashtest chown 1000:1000 /home/testuser/.local/state/machines/inodetest/squashtest
# Ensure hardlinked symlinks work # Ensure hardlinked symlinks work
@@ -217,7 +217,7 @@ run0 -u testuser machinectl --user remove inodetest2
# Test tree mangling (i.e. moving the root dir one level up on extract) # Test tree mangling (i.e. moving the root dir one level up on extract)
mkdir -p /var/tmp/mangletest/mangletest-0.1/usr/lib mkdir -p /var/tmp/mangletest/mangletest-0.1/usr/lib
echo "ID=brumm" > /var/tmp/mangletest/mangletest-0.1/usr/lib/os-release echo "ID=brumm" >/var/tmp/mangletest/mangletest-0.1/usr/lib/os-release
tar -C /var/tmp/mangletest/ -cvzf /var/tmp/mangletest.tar.gz mangletest-0.1 tar -C /var/tmp/mangletest/ -cvzf /var/tmp/mangletest.tar.gz mangletest-0.1
run0 --pipe -u testuser importctl -m --user import-tar /var/tmp/mangletest.tar.gz run0 --pipe -u testuser importctl -m --user import-tar /var/tmp/mangletest.tar.gz
cmp /var/tmp/mangletest/mangletest-0.1/usr/lib/os-release /home/testuser/.local/state/machines/mangletest/usr/lib/os-release cmp /var/tmp/mangletest/mangletest-0.1/usr/lib/os-release /home/testuser/.local/state/machines/mangletest/usr/lib/os-release
+2 -2
View File
@@ -86,7 +86,7 @@ systemd-run \
-u runtime-max-sec-test-3.service \ -u runtime-max-sec-test-3.service \
sh -c "while true; do sleep 1; done" sh -c "while true; do sleep 1; done"
mkdir -p /etc/systemd/system/runtime-max-sec-test-3.service.d/ mkdir -p /etc/systemd/system/runtime-max-sec-test-3.service.d/
cat > /etc/systemd/system/runtime-max-sec-test-3.service.d/override.conf << EOF cat >/etc/systemd/system/runtime-max-sec-test-3.service.d/override.conf <<EOF
[Service] [Service]
RuntimeMaxSec=${runtime_max_sec}s RuntimeMaxSec=${runtime_max_sec}s
EOF EOF
@@ -103,7 +103,7 @@ until systemctl is-active runtime-max-sec-test-4.scope; do
sleep 1 sleep 1
done done
mkdir -p /etc/systemd/system/runtime-max-sec-test-4.scope.d/ mkdir -p /etc/systemd/system/runtime-max-sec-test-4.scope.d/
cat > /etc/systemd/system/runtime-max-sec-test-4.scope.d/override.conf << EOF cat >/etc/systemd/system/runtime-max-sec-test-4.scope.d/override.conf <<EOF
[Scope] [Scope]
RuntimeMaxSec=${runtime_max_sec}s RuntimeMaxSec=${runtime_max_sec}s
EOF EOF
+2 -2
View File
@@ -19,10 +19,10 @@ at_exit() {
trap at_exit EXIT trap at_exit EXIT
mkdir -p /run/credstore mkdir -p /run/credstore
cat > /run/credstore/udev.conf.50-testme <<EOF cat >/run/credstore/udev.conf.50-testme <<EOF
udev_log=debug udev_log=debug
EOF EOF
cat > /run/credstore/udev.rules.50-testme <<EOF cat >/run/credstore/udev.rules.50-testme <<EOF
SUBSYSTEM=="net", OPTIONS="log_level=debug" SUBSYSTEM=="net", OPTIONS="log_level=debug"
EOF EOF
+1 -1
View File
@@ -139,7 +139,7 @@ test "$(stat -c %U:%G:%a /tmp/C/3/f1)" = "root:root:644"
test ! -e /tmp/C/4 test ! -e /tmp/C/4
touch /tmp/C/3-origin/f{2,3,4} touch /tmp/C/3-origin/f{2,3,4}
echo -n ABC > /tmp/C/3/f1 echo -n ABC >/tmp/C/3/f1
systemd-tmpfiles --create - <<EOF systemd-tmpfiles --create - <<EOF
C+ /tmp/C/3 0755 daemon daemon - /tmp/C/3-origin C+ /tmp/C/3 0755 daemon daemon - /tmp/C/3-origin
@@ -15,8 +15,8 @@ at_exit() {
trap at_exit EXIT trap at_exit EXIT
mkdir /tmp/test-extra-fd mkdir /tmp/test-extra-fd
echo "Hello" > /tmp/test-extra-fd/1.txt echo "Hello" >/tmp/test-extra-fd/1.txt
echo "Extra" > /tmp/test-extra-fd/2.txt echo "Extra" >/tmp/test-extra-fd/2.txt
# Open files and assign FD to variables # Open files and assign FD to variables
exec {TEST_FD1}</tmp/test-extra-fd/1.txt exec {TEST_FD1}</tmp/test-extra-fd/1.txt
+1 -1
View File
@@ -138,7 +138,7 @@ portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0
# The wrong file should be ignored, given the right one has the xattr set # The wrong file should be ignored, given the right one has the xattr set
trap 'rm -rf /var/cache/wrongext' EXIT trap 'rm -rf /var/cache/wrongext' EXIT
mkdir -p /var/cache/wrongext/usr/lib/extension-release.d /var/cache/wrongext/usr/lib/systemd/system/ mkdir -p /var/cache/wrongext/usr/lib/extension-release.d /var/cache/wrongext/usr/lib/systemd/system/
echo "[Service]" > /var/cache/wrongext/usr/lib/systemd/system/app0.service echo "[Service]" >/var/cache/wrongext/usr/lib/systemd/system/app0.service
touch /var/cache/wrongext/usr/lib/extension-release.d/extension-release.wrongext_somethingwrong.txt touch /var/cache/wrongext/usr/lib/extension-release.d/extension-release.wrongext_somethingwrong.txt
cp /tmp/rootdir/usr/lib/os-release /var/cache/wrongext/usr/lib/extension-release.d/extension-release.app0 cp /tmp/rootdir/usr/lib/os-release /var/cache/wrongext/usr/lib/extension-release.d/extension-release.app0
setfattr -n user.extension-release.strict -v "false" /var/cache/wrongext/usr/lib/extension-release.d/extension-release.app0 setfattr -n user.extension-release.strict -v "false" /var/cache/wrongext/usr/lib/extension-release.d/extension-release.app0
+2 -2
View File
@@ -674,7 +674,7 @@ testcase_ambient_caps() {
TRANSIENTUNIT="capwakealarm$RANDOM.service" TRANSIENTUNIT="capwakealarm$RANDOM.service"
SCRIPT="/tmp/capwakealarm$RANDOM.sh" SCRIPT="/tmp/capwakealarm$RANDOM.sh"
cat > /etc/pam.d/"$PAMSERVICE" <<EOF cat >/etc/pam.d/"$PAMSERVICE" <<EOF
auth sufficient pam_unix.so auth sufficient pam_unix.so
auth required pam_deny.so auth required pam_deny.so
account sufficient pam_unix.so account sufficient pam_unix.so
@@ -725,7 +725,7 @@ testcase_background() {
trap background_at_return RETURN trap background_at_return RETURN
cat > /etc/pam.d/"$PAMSERVICE" <<EOF cat >/etc/pam.d/"$PAMSERVICE" <<EOF
auth sufficient pam_unix.so auth sufficient pam_unix.so
auth required pam_deny.so auth required pam_deny.so
account sufficient pam_unix.so account sufficient pam_unix.so
+1 -1
View File
@@ -916,7 +916,7 @@ systemd-dissect --list /tmp/img >/dev/null
read -r SHA256SUM1 _ < <(systemd-dissect --copy-from /tmp/img etc/os-release | sha256sum) read -r SHA256SUM1 _ < <(systemd-dissect --copy-from /tmp/img etc/os-release | sha256sum)
test "$SHA256SUM1" != "" test "$SHA256SUM1" != ""
echo abc > abc echo abc >abc
systemd-dissect --copy-to /tmp/img abc /abc systemd-dissect --copy-to /tmp/img abc /abc
test -f /tmp/img/abc test -f /tmp/img/abc
+1 -1
View File
@@ -122,7 +122,7 @@ cmp /tmp/unpriv.raw.mtree /tmp/unpriv2.raw.mtree
# Make sure nspawn works unpriv, too (for now do not nest) # Make sure nspawn works unpriv, too (for now do not nest)
if ! systemd-detect-virt -c; then if ! systemd-detect-virt -c; then
systemd-nspawn --pipe -i /var/tmp/unpriv.raw --read-only echo thisisatest > /tmp/unpriv.out systemd-nspawn --pipe -i /var/tmp/unpriv.raw --read-only echo thisisatest >/tmp/unpriv.out
echo thisisatest | cmp /tmp/unpriv.out - echo thisisatest | cmp /tmp/unpriv.out -
# The unpriv user has no rights to lock the image or write to it. Let's # The unpriv user has no rights to lock the image or write to it. Let's
+4 -4
View File
@@ -490,24 +490,24 @@ fi
# Decrypt/encrypt via varlink # Decrypt/encrypt via varlink
DATA="Zm9vYmFyCg==" DATA="Zm9vYmFyCg=="
echo "{\"data\":\"$DATA\"}" > /tmp/vlcredsdata echo "{\"data\":\"$DATA\"}" >/tmp/vlcredsdata
varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "$(cat /tmp/vlcredsdata)" | \ varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "$(cat /tmp/vlcredsdata)" | \
varlinkctl call --json=short /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt > /tmp/vlcredsdata2 varlinkctl call --json=short /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt >/tmp/vlcredsdata2
cmp /tmp/vlcredsdata /tmp/vlcredsdata2 cmp /tmp/vlcredsdata /tmp/vlcredsdata2
rm /tmp/vlcredsdata2 rm /tmp/vlcredsdata2
# Pick a key type explicitly # Pick a key type explicitly
varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "{\"data\":\"$DATA\",\"withKey\":\"host\"}" | \ varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "{\"data\":\"$DATA\",\"withKey\":\"host\"}" | \
varlinkctl call --json=short /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt > /tmp/vlcredsdata2 varlinkctl call --json=short /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt >/tmp/vlcredsdata2
cmp /tmp/vlcredsdata /tmp/vlcredsdata2 cmp /tmp/vlcredsdata /tmp/vlcredsdata2
rm /tmp/vlcredsdata2 rm /tmp/vlcredsdata2
varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "{\"data\":\"$DATA\",\"withKey\":\"null\"}" | \ varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "{\"data\":\"$DATA\",\"withKey\":\"null\"}" | \
jq '.["allowNull"] = true' | jq '.["allowNull"] = true' |
varlinkctl call --json=short /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt > /tmp/vlcredsdata2 varlinkctl call --json=short /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt >/tmp/vlcredsdata2
cmp /tmp/vlcredsdata /tmp/vlcredsdata2 cmp /tmp/vlcredsdata /tmp/vlcredsdata2
rm /tmp/vlcredsdata /tmp/vlcredsdata2 rm /tmp/vlcredsdata /tmp/vlcredsdata2
+2 -2
View File
@@ -110,11 +110,11 @@ assert_in "test63-issue-24577-dep.service" "$output"
systemctl start test63-pr-30768.path systemctl start test63-pr-30768.path
exec {lock}<>/tmp/noexit exec {lock}<>/tmp/noexit
flock -e $lock flock -e $lock
echo test1 > /tmp/copyme echo test1 >/tmp/copyme
# shellcheck disable=SC2016 # shellcheck disable=SC2016
timeout 30 bash -c 'until test "$(systemctl show test63-pr-30768.service -P ActiveState)" = deactivating; do sleep .2; done' timeout 30 bash -c 'until test "$(systemctl show test63-pr-30768.service -P ActiveState)" = deactivating; do sleep .2; done'
diff /tmp/copyme /tmp/copied diff /tmp/copyme /tmp/copied
echo test2 > /tmp/copyme echo test2 >/tmp/copyme
exec {lock}<&- exec {lock}<&-
timeout 30 bash -c 'until diff /tmp/copyme /tmp/copied >/dev/null; do sleep .2; done' timeout 30 bash -c 'until diff /tmp/copyme /tmp/copied >/dev/null; do sleep .2; done'
+1 -1
View File
@@ -6,7 +6,7 @@ set -o pipefail
export SYSTEMD_LOG_LEVEL=debug export SYSTEMD_LOG_LEVEL=debug
# Ensure that sandboxing doesn't stop creds from being accessible # Ensure that sandboxing doesn't stop creds from being accessible
echo "test" > /tmp/testdata echo "test" >/tmp/testdata
systemd-creds encrypt /tmp/testdata /tmp/testdata.encrypted --with-key=tpm2 systemd-creds encrypt /tmp/testdata /tmp/testdata.encrypted --with-key=tpm2
# LoadCredentialEncrypted # LoadCredentialEncrypted
systemd-run -p PrivateDevices=yes -p LoadCredentialEncrypted=testdata.encrypted:/tmp/testdata.encrypted --pipe --wait systemd-creds cat testdata.encrypted | cmp - /tmp/testdata systemd-run -p PrivateDevices=yes -p LoadCredentialEncrypted=testdata.encrypted:/tmp/testdata.encrypted --pipe --wait systemd-creds cat testdata.encrypted | cmp - /tmp/testdata
+2 -2
View File
@@ -135,7 +135,7 @@ if tpm_has_pcr sha256 12; then
tpm2_pcrread -Q -o /tmp/pcr.dat sha256:12 tpm2_pcrread -Q -o /tmp/pcr.dat sha256:12
CURRENT_PCR_VALUE=$(cat /sys/class/tpm/tpm0/pcr-sha256/12) CURRENT_PCR_VALUE=$(cat /sys/class/tpm/tpm0/pcr-sha256/12)
tpm2_readpublic -c 0x81000001 -o /tmp/srk.pub tpm2_readpublic -c 0x81000001 -o /tmp/srk.pub
systemd-analyze srk > /tmp/srk2.pub systemd-analyze srk >/tmp/srk2.pub
cmp /tmp/srk.pub /tmp/srk2.pub cmp /tmp/srk.pub /tmp/srk2.pub
if [ -f /run/systemd/tpm2-srk-public-key.tpm2b_public ] ; then if [ -f /run/systemd/tpm2-srk-public-key.tpm2b_public ] ; then
cmp /tmp/srk.pub /run/systemd/tpm2-srk-public-key.tpm2b_public cmp /tmp/srk.pub /run/systemd/tpm2-srk-public-key.tpm2b_public
@@ -203,7 +203,7 @@ if openssl_supports_kdf SSKDF; then
# Make sure that --tpm2-device-key= also works with systemd-repart # Make sure that --tpm2-device-key= also works with systemd-repart
tpm2_readpublic -c 0x81000001 -o /tmp/srk.pub tpm2_readpublic -c 0x81000001 -o /tmp/srk.pub
mkdir /tmp/dditest mkdir /tmp/dditest
cat > /tmp/dditest/50-root.conf <<EOF cat >/tmp/dditest/50-root.conf <<EOF
[Partition] [Partition]
Type=root Type=root
Format=ext4 Format=ext4
+1 -1
View File
@@ -92,7 +92,7 @@ RECORD_COUNT=$((RECORD_COUNT + 1))
tpm2_pcrread sha256:11 -Q -o /tmp/oldpcr11 tpm2_pcrread sha256:11 -Q -o /tmp/oldpcr11
# Do the equivalent of 'SYSTEMD_FORCE_MEASURE=1 "$SD_PCREXTEND" foobar' via Varlink, just to test the Varlink logic (but first we need to patch out the conditionalization...) # Do the equivalent of 'SYSTEMD_FORCE_MEASURE=1 "$SD_PCREXTEND" foobar' via Varlink, just to test the Varlink logic (but first we need to patch out the conditionalization...)
mkdir -p /run/systemd/system/systemd-pcrextend.socket.d mkdir -p /run/systemd/system/systemd-pcrextend.socket.d
cat > /run/systemd/system/systemd-pcrextend.socket.d/50-no-condition.conf <<EOF cat >/run/systemd/system/systemd-pcrextend.socket.d/50-no-condition.conf <<EOF
[Unit] [Unit]
# Turn off all conditions */ # Turn off all conditions */
ConditionSecurity= ConditionSecurity=
+1 -1
View File
@@ -196,7 +196,7 @@ SYSTEMD_XBOOTLDR_PATH=/tmp/fakexbootldr SYSTEMD_RELAX_XBOOTLDR_CHECKS=1 "$SD_PCR
# Exercise Varlink API a bit (but first turn off condition) # Exercise Varlink API a bit (but first turn off condition)
mkdir -p /run/systemd/system/systemd-pcrlock.socket.d mkdir -p /run/systemd/system/systemd-pcrlock.socket.d
cat > /run/systemd/system/systemd-pcrlock.socket.d/50-no-condition.conf <<EOF cat >/run/systemd/system/systemd-pcrlock.socket.d/50-no-condition.conf <<EOF
[Unit] [Unit]
# Turn off all conditions # Turn off all conditions
ConditionSecurity= ConditionSecurity=
+1 -1
View File
@@ -224,7 +224,7 @@ if [ -d "/usr/share/keymaps/" ] || [ -d "/usr/share/kbd/keymaps/" ] || [ -d "/us
rm "$ROOT/etc/vconsole.conf" rm "$ROOT/etc/vconsole.conf"
# this should be a NOP, given that stdout is connected to /dev/null, and hence not a VT # this should be a NOP, given that stdout is connected to /dev/null, and hence not a VT
systemd-firstboot --root="$ROOT" --prompt-keymap-auto > /dev/null systemd-firstboot --root="$ROOT" --prompt-keymap-auto >/dev/null
fi fi
echo -ne "Europe/Berlin\n" | systemd-firstboot --root="$ROOT" --prompt-timezone echo -ne "Europe/Berlin\n" | systemd-firstboot --root="$ROOT" --prompt-timezone
readlink "$ROOT/etc/localtime" | grep -q "Europe/Berlin$" readlink "$ROOT/etc/localtime" | grep -q "Europe/Berlin$"
+5 -5
View File
@@ -49,20 +49,20 @@ testcase_public() {
verify_pkcs7() { verify_pkcs7() {
# Verify using internal certificate # Verify using internal certificate
openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify > /dev/null openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify >/dev/null
# Verify using external (original) certificate # Verify using external (original) certificate
openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify -certfile /tmp/test.crt -nointern > /dev/null openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify -certfile /tmp/test.crt -nointern >/dev/null
} }
verify_pkcs7_fail() { verify_pkcs7_fail() {
# Verify using internal certificate # Verify using internal certificate
(! openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify > /dev/null) (! openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify >/dev/null)
# Verify using external (original) certificate # Verify using external (original) certificate
(! openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify -certfile /tmp/test.crt -nointern > /dev/null) (! openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify -certfile /tmp/test.crt -nointern >/dev/null)
} }
testcase_pkcs7() { testcase_pkcs7() {
echo -n "test" > /tmp/payload echo -n "test" >/tmp/payload
for hashalg in sha256 sha384 sha512; do for hashalg in sha256 sha384 sha512; do
# shellcheck disable=SC2086 # shellcheck disable=SC2086
@@ -15,12 +15,12 @@ at_exit() {
trap at_exit EXIT trap at_exit EXIT
mkdir -p /run/credstore mkdir -p /run/credstore
cat > /run/credstore/network.conf.50-testme <<EOF cat >/run/credstore/network.conf.50-testme <<EOF
[Network] [Network]
SpeedMeter=yes SpeedMeter=yes
EOF EOF
cat > /run/credstore/network.network.50-testme <<EOF cat >/run/credstore/network.network.50-testme <<EOF
[Match] [Match]
Property=IDONTEXIST Property=IDONTEXIST
EOF EOF
+2 -2
View File
@@ -175,8 +175,8 @@ varlinkctl introspect /run/systemd/io.systemd.Hostname io.systemd.Hostname
varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}' varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}'
# Validate that --exec results in the very same values # Validate that --exec results in the very same values
varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}' | jq > /tmp/describe1.json varlinkctl call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}' | jq >/tmp/describe1.json
varlinkctl --exec call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}' -- jq > /tmp/describe2.json varlinkctl --exec call /run/systemd/io.systemd.Hostname io.systemd.Hostname.Describe '{}' -- jq >/tmp/describe2.json
cmp /tmp/describe1.json /tmp/describe2.json cmp /tmp/describe1.json /tmp/describe2.json
rm /tmp/describe1.json /tmp/describe2.json rm /tmp/describe1.json /tmp/describe2.json
+4 -4
View File
@@ -817,7 +817,7 @@ testcase_09_resolvectl_showcache() {
echo "[NetDev]" echo "[NetDev]"
echo "Name=dns2" echo "Name=dns2"
echo "Kind=dummy" echo "Kind=dummy"
} > /run/systemd/network/10-dns2.netdev } >/run/systemd/network/10-dns2.netdev
{ {
echo "[Match]" echo "[Match]"
echo "Name=dns2" echo "Name=dns2"
@@ -825,7 +825,7 @@ testcase_09_resolvectl_showcache() {
echo "IPv6AcceptRA=no" echo "IPv6AcceptRA=no"
echo "Address=10.123.0.1/24" echo "Address=10.123.0.1/24"
echo "DNS=10.0.0.1" echo "DNS=10.0.0.1"
} > /run/systemd/network/10-dns2.network } >/run/systemd/network/10-dns2.network
networkctl reload networkctl reload
networkctl reconfigure dns2 networkctl reconfigure dns2
@@ -834,7 +834,7 @@ testcase_09_resolvectl_showcache() {
echo "[Resolve]" echo "[Resolve]"
echo "DNSSEC=no" echo "DNSSEC=no"
echo "DNSOverTLS=no" echo "DNSOverTLS=no"
} > /run/systemd/resolved.conf.d/90-resolved.conf } >/run/systemd/resolved.conf.d/90-resolved.conf
systemctl reload systemd-resolved.service systemctl reload systemd-resolved.service
test "$(resolvectl show-cache --json=short | jq -rc '.[] | select(.ifname == "dns2" and .protocol == "dns") | .dnssec')" == 'no' test "$(resolvectl show-cache --json=short | jq -rc '.[] | select(.ifname == "dns2" and .protocol == "dns") | .dnssec')" == 'no'
@@ -844,7 +844,7 @@ testcase_09_resolvectl_showcache() {
echo "[Resolve]" echo "[Resolve]"
echo "DNSSEC=allow-downgrade" echo "DNSSEC=allow-downgrade"
echo "DNSOverTLS=opportunistic" echo "DNSOverTLS=opportunistic"
} > /run/systemd/resolved.conf.d/90-resolved.conf } >/run/systemd/resolved.conf.d/90-resolved.conf
systemctl reload systemd-resolved.service systemctl reload systemd-resolved.service
test "$(resolvectl show-cache --json=short | jq -rc '.[] | select(.ifname == "dns2" and .protocol == "dns") | .dnssec')" == 'allow-downgrade' test "$(resolvectl show-cache --json=short | jq -rc '.[] | select(.ifname == "dns2" and .protocol == "dns") | .dnssec')" == 'allow-downgrade'
+1 -1
View File
@@ -15,7 +15,7 @@ sync_in() {
} }
sync_out() { sync_out() {
echo "$1" > /tmp/syncfifo2 echo "$1" >/tmp/syncfifo2
} }
export SYSTEMD_LOG_LEVEL=debug export SYSTEMD_LOG_LEVEL=debug
@@ -28,14 +28,14 @@ at_exit() {
trap at_exit EXIT trap at_exit EXIT
mkdir /tmp/validatefs-test mkdir /tmp/validatefs-test
cat > /tmp/validatefs-test/validatefs-root.conf <<EOF cat >/tmp/validatefs-test/validatefs-root.conf <<EOF
[Partition] [Partition]
Type=root Type=root
Label=kromm Label=kromm
Format=ext4 Format=ext4
EOF EOF
cat > /tmp/validatefs-test/validatefs-usr.conf <<EOF cat >/tmp/validatefs-test/validatefs-usr.conf <<EOF
[Partition] [Partition]
Type=usr Type=usr
Label=plisch Label=plisch
@@ -44,7 +44,7 @@ Verity=data
VerityMatchKey=mupf VerityMatchKey=mupf
EOF EOF
cat > /tmp/validatefs-test/validatefs-usr-verity.conf <<EOF cat >/tmp/validatefs-test/validatefs-usr-verity.conf <<EOF
[Partition] [Partition]
Type=usr-verity Type=usr-verity
Label=plisch-verity Label=plisch-verity
@@ -52,21 +52,21 @@ Verity=hash
VerityMatchKey=mupf VerityMatchKey=mupf
EOF EOF
cat > /tmp/validatefs-test/validatefs-home.conf <<EOF cat >/tmp/validatefs-test/validatefs-home.conf <<EOF
[Partition] [Partition]
Type=home Type=home
Label=rupft Label=rupft
Format=ext4 Format=ext4
EOF EOF
cat > /tmp/validatefs-test/validatefs-esp.conf <<EOF cat >/tmp/validatefs-test/validatefs-esp.conf <<EOF
[Partition] [Partition]
Type=esp Type=esp
Label=fumm Label=fumm
Format=vfat Format=vfat
EOF EOF
cat > /tmp/validatefs-test/validatefs-generic.conf <<EOF cat >/tmp/validatefs-test/validatefs-generic.conf <<EOF
[Partition] [Partition]
Label=qnurx Label=qnurx
Type=linux-generic Type=linux-generic