diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-08 00:09:55 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-08 20:21:50 +0200 |
commit | 0ee994836cac6684b5d2e3aae5f8b44f1758e0f5 (patch) | |
tree | cfd7898553f2583748342469866865d50e454614 | |
parent | 4e20fe27950e14e8a082a74515f347546a9371d0 (diff) | |
download | systemd-0ee994836cac6684b5d2e3aae5f8b44f1758e0f5.tar.gz |
TEST-*: use spacing before redirection operator, but not after
<< EOF → <<EOF
> foo < bar → >foo <bar
46 files changed, 143 insertions, 143 deletions
diff --git a/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh b/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh index a0848ef672..28b97fadb0 100755 --- a/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/test.sh @@ -16,4 +16,4 @@ NSPAWN_TIMEOUT=20 # only found from the console during the poweroff. rm -f /tmp/honorfirstshutdown.log >/dev/null -do_test "$@" 52 > /tmp/honorfirstshutdown.log +do_test "$@" 52 >/tmp/honorfirstshutdown.log diff --git a/test/test-execute/exec-standardoutput-append.service b/test/test-execute/exec-standardoutput-append.service index 8983bb056b..2118bfc2a6 100644 --- a/test/test-execute/exec-standardoutput-append.service +++ b/test/test-execute/exec-standardoutput-append.service @@ -2,8 +2,8 @@ Description=Test for StandardOutput=append: [Service] -ExecStartPre=sh -c 'printf "hello\n" > /tmp/test-exec-standardoutput-output' -ExecStartPre=sh -c 'printf "hello\nhello\n" > /tmp/test-exec-standardoutput-expected' +ExecStartPre=sh -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output' +ExecStartPre=sh -c 'printf "hello\nhello\n" >/tmp/test-exec-standardoutput-expected' StandardInput=data StandardInputText=hello StandardOutput=append:/tmp/test-exec-standardoutput-output diff --git a/test/test-execute/exec-standardoutput-file.service b/test/test-execute/exec-standardoutput-file.service index 71e2604b94..8d484a456e 100644 --- a/test/test-execute/exec-standardoutput-file.service +++ b/test/test-execute/exec-standardoutput-file.service @@ -2,8 +2,8 @@ Description=Test for StandardOutput=file: [Service] -ExecStartPre=sh -c 'printf "nooo\nhello\n" > /tmp/test-exec-standardoutput-output' -ExecStartPre=sh -c 'printf "hello\nello\n" > /tmp/test-exec-standardoutput-expected' +ExecStartPre=sh -c 'printf "nooo\nhello\n" >/tmp/test-exec-standardoutput-output' +ExecStartPre=sh -c 'printf "hello\nello\n" >/tmp/test-exec-standardoutput-expected' StandardInput=data StandardInputText=hello StandardOutput=file:/tmp/test-exec-standardoutput-output diff --git a/test/test-execute/exec-standardoutput-truncate.service b/test/test-execute/exec-standardoutput-truncate.service index 4b4bb87b75..8d6ea2769f 100644 --- a/test/test-execute/exec-standardoutput-truncate.service +++ b/test/test-execute/exec-standardoutput-truncate.service @@ -2,8 +2,8 @@ Description=Test for StandardOutput=truncate: [Service] -ExecStartPre=sh -c 'printf "hello\n" > /tmp/test-exec-standardoutput-output' -ExecStartPre=sh -c 'printf "hi\n" > /tmp/test-exec-standardoutput-expected' +ExecStartPre=sh -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output' +ExecStartPre=sh -c 'printf "hi\n" >/tmp/test-exec-standardoutput-expected' StandardInput=data StandardInputText=hi StandardOutput=truncate:/tmp/test-exec-standardoutput-output diff --git a/test/test-functions b/test/test-functions index 6b94058fd3..063a6096fd 100644 --- a/test/test-functions +++ b/test/test-functions @@ -503,13 +503,13 @@ install_verity_minimal() { ln -s ../usr/lib/os-release $initdir/etc/os-release touch $initdir/etc/machine-id $initdir/etc/resolv.conf touch $initdir/opt/some_file - echo MARKER=1 >> $initdir/usr/lib/os-release - echo -e "[Service]\nExecStartPre=cat /usr/lib/os-release\nExecStart=sleep 120" > $initdir/usr/lib/systemd/system/app0.service + echo MARKER=1 >>$initdir/usr/lib/os-release + echo -e "[Service]\nExecStartPre=cat /usr/lib/os-release\nExecStart=sleep 120" >$initdir/usr/lib/systemd/system/app0.service cp $initdir/usr/lib/systemd/system/app0.service $initdir/usr/lib/systemd/system/app0-foo.service mksquashfs $initdir $oldinitdir/usr/share/minimal_0.raw veritysetup format $oldinitdir/usr/share/minimal_0.raw $oldinitdir/usr/share/minimal_0.verity | \ - grep '^Root hash:' | cut -f2 | tr -d '\n' > $oldinitdir/usr/share/minimal_0.roothash + grep '^Root hash:' | cut -f2 | tr -d '\n' >$oldinitdir/usr/share/minimal_0.roothash sed -i "s/MARKER=1/MARKER=2/g" $initdir/usr/lib/os-release rm $initdir/usr/lib/systemd/system/app0-foo.service @@ -517,7 +517,7 @@ install_verity_minimal() { mksquashfs $initdir $oldinitdir/usr/share/minimal_1.raw veritysetup format $oldinitdir/usr/share/minimal_1.raw $oldinitdir/usr/share/minimal_1.verity | \ - grep '^Root hash:' | cut -f2 | tr -d '\n' > $oldinitdir/usr/share/minimal_1.roothash + grep '^Root hash:' | cut -f2 | tr -d '\n' >$oldinitdir/usr/share/minimal_1.roothash # Rolling distros like Arch do not set VERSION_ID local version_id="" @@ -527,42 +527,42 @@ install_verity_minimal() { export initdir=$TESTDIR/app0 mkdir -p $initdir/usr/lib/extension-release.d $initdir/usr/lib/systemd/system $initdir/opt - grep "^ID=" $os_release > $initdir/usr/lib/extension-release.d/extension-release.app0 - echo "${version_id}" >> $initdir/usr/lib/extension-release.d/extension-release.app0 - cat <<EOF > $initdir/usr/lib/systemd/system/app0.service + grep "^ID=" $os_release >$initdir/usr/lib/extension-release.d/extension-release.app0 + echo "${version_id}" >>$initdir/usr/lib/extension-release.d/extension-release.app0 + cat <<EOF >$initdir/usr/lib/systemd/system/app0.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/opt/script0.sh EOF - cat <<EOF > $initdir/opt/script0.sh + cat <<EOF >$initdir/opt/script0.sh #!/bin/bash set -e test -e /usr/lib/os-release cat /usr/lib/extension-release.d/extension-release.app0 EOF chmod +x $initdir/opt/script0.sh - echo MARKER=1 > $initdir/usr/lib/systemd/system/some_file + echo MARKER=1 >$initdir/usr/lib/systemd/system/some_file mksquashfs $initdir $oldinitdir/usr/share/app0.raw export initdir=$TESTDIR/app1 mkdir -p $initdir/usr/lib/extension-release.d $initdir/usr/lib/systemd/system $initdir/opt - grep "^ID=" $os_release > $initdir/usr/lib/extension-release.d/extension-release.app1 - echo "${version_id}" >> $initdir/usr/lib/extension-release.d/extension-release.app1 - cat <<EOF > $initdir/usr/lib/systemd/system/app1.service + grep "^ID=" $os_release >$initdir/usr/lib/extension-release.d/extension-release.app1 + echo "${version_id}" >>$initdir/usr/lib/extension-release.d/extension-release.app1 + cat <<EOF >$initdir/usr/lib/systemd/system/app1.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/opt/script1.sh EOF - cat <<EOF > $initdir/opt/script1.sh + cat <<EOF >$initdir/opt/script1.sh #!/bin/bash set -e test -e /usr/lib/os-release cat /usr/lib/extension-release.d/extension-release.app1 EOF chmod +x $initdir/opt/script1.sh - echo MARKER=1 > $initdir/usr/lib/systemd/system/other_file + echo MARKER=1 >$initdir/usr/lib/systemd/system/other_file mksquashfs $initdir $oldinitdir/usr/share/app1.raw ) } @@ -700,7 +700,7 @@ if [[ "$ASAN_COMPILER" == "clang" ]]; then # Let's add the ASan DSO's path to the dynamic linker's cache. This is pretty # unnecessary for gcc & libasan, however, for clang this is crucial, as its # runtime ASan DSO is in a non-standard (library) path. - echo "${ASAN_RT_PATH%/*}" > /etc/ld.so.conf.d/asan-path-override.conf + echo "${ASAN_RT_PATH%/*}" >/etc/ld.so.conf.d/asan-path-override.conf ldconfig fi echo DefaultEnvironment=\$DEFAULT_ENVIRONMENT >>/etc/systemd/system.conf @@ -741,7 +741,7 @@ printf "[Service]\nEnvironment=ASAN_OPTIONS=leak_check_at_exit=false\n" >/etc/sy # they're uninstrumented (like dmsetup). Let's add a simple rule which sets # LD_PRELOAD to the ASan RT library to fix this. mkdir -p /etc/udev/rules.d -cat > /etc/udev/rules.d/00-set-LD_PRELOAD.rules << INNER_EOF +cat >/etc/udev/rules.d/00-set-LD_PRELOAD.rules <<INNER_EOF SUBSYSTEM=="block", ENV{LD_PRELOAD}="$ASAN_RT_PATH" INNER_EOF chmod 0644 /etc/udev/rules.d/00-set-LD_PRELOAD.rules @@ -856,9 +856,9 @@ install_systemd() { [[ "$LOOKS_LIKE_SUSE" ]] && setup_suse # enable debug logging in PID1 - echo LogLevel=debug >> $initdir/etc/systemd/system.conf + echo LogLevel=debug >>$initdir/etc/systemd/system.conf # store coredumps in journal - echo Storage=journal >> $initdir/etc/systemd/coredump.conf + echo Storage=journal >>$initdir/etc/systemd/coredump.conf } get_ldpath() { @@ -1174,12 +1174,12 @@ install_config_files() { inst_any /etc/os-release /usr/lib/os-release inst /etc/localtime # we want an empty environment - > $initdir/etc/environment - > $initdir/etc/machine-id - > $initdir/etc/resolv.conf + >$initdir/etc/environment + >$initdir/etc/machine-id + >$initdir/etc/resolv.conf # set the hostname - echo systemd-testsuite > $initdir/etc/hostname + echo systemd-testsuite >$initdir/etc/hostname # let's set up just one image with the traditional verbose output if [ ${IMAGE_NAME} != "basic" ]; then @@ -1202,9 +1202,9 @@ install_debug_tools() { # Set default TERM from vt220 to linux, so at least basic key shortcuts work local _getty_override="$initdir/etc/systemd/system/serial-getty@.service.d" mkdir -p "$_getty_override" - echo -e "[Service]\nEnvironment=TERM=linux" > "$_getty_override/default-TERM.conf" + echo -e "[Service]\nEnvironment=TERM=linux" >"$_getty_override/default-TERM.conf" - cat > "$initdir/etc/motd" << EOF + cat >"$initdir/etc/motd" <<EOF To adjust the terminal size use: export COLUMNS=xx export LINES=yy @@ -1246,7 +1246,7 @@ install_dbus() { # setup policy for Type=dbus test mkdir -p $initdir/etc/dbus-1/system.d - cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF + cat >$initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF <?xml version="1.0"?> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> @@ -1987,7 +1987,7 @@ install_kmod_with_fw() { fi [ -d "$initdir/.kernelmodseen" ] && \ - > "$initdir/.kernelmodseen/${1##*/}" + >"$initdir/.kernelmodseen/${1##*/}" inst_simple "$1" "/lib/modules/$KERNEL_VER/${1##*/lib/modules/$KERNEL_VER/}" \ || return $? @@ -2059,11 +2059,11 @@ filter_kernel_modules_by_path () ( for _modname in $(eval $_filtercmd); do case $_modname in *.ko) "$2" "$_modname" && echo "$_modname";; - *.ko.gz) gzip -dc "$_modname" > $initdir/$$.ko + *.ko.gz) gzip -dc "$_modname" >$initdir/$$.ko $2 $initdir/$$.ko && echo "$_modname" rm -f $initdir/$$.ko ;; - *.ko.xz) xz -dc "$_modname" > $initdir/$$.ko + *.ko.xz) xz -dc "$_modname" >$initdir/$$.ko $2 $initdir/$$.ko && echo "$_modname" rm -f $initdir/$$.ko ;; @@ -2276,7 +2276,7 @@ test_setup() { fi local hook_defined=1 - if declare -f -F test_append_files > /dev/null; then + if declare -f -F test_append_files >/dev/null; then hook_defined=$? fi diff --git a/test/testsuite-28.units/specifier-j-wants.service b/test/testsuite-28.units/specifier-j-wants.service index facf5577be..766a454d6a 100644 --- a/test/testsuite-28.units/specifier-j-wants.service +++ b/test/testsuite-28.units/specifier-j-wants.service @@ -7,4 +7,4 @@ After=testsuite-28-pre.service [Service] Type=oneshot ExecStart=test -f /tmp/test-specifier-j-%j -ExecStart=sh -c 'echo OK > /testok' +ExecStart=sh -c 'echo OK >/testok' diff --git a/test/testsuite-52.units/testsuite-52.sh b/test/testsuite-52.units/testsuite-52.sh index 9cccf1b6c1..e10bf56110 100755 --- a/test/testsuite-52.units/testsuite-52.sh +++ b/test/testsuite-52.units/testsuite-52.sh @@ -3,7 +3,7 @@ set -ex set -o pipefail if ! test -x /usr/lib/systemd/tests/testdata/units/test-honor-first-shutdown.sh ; then - echo "honor-first-shutdown script not found - FAIL" > /testok + echo "honor-first-shutdown script not found - FAIL" >/testok exit 0 fi @@ -13,6 +13,6 @@ systemd-analyze log-target console systemctl enable test-honor-first-shutdown.service systemctl start test-honor-first-shutdown.service -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-03.sh b/test/units/testsuite-03.sh index ec731aa11b..5a2dadd6b8 100755 --- a/test/units/testsuite-03.sh +++ b/test/units/testsuite-03.sh @@ -6,9 +6,9 @@ set -ex systemctl start --no-block hello-after-sleep.target -systemctl list-jobs > /root/list-jobs.txt +systemctl list-jobs >/root/list-jobs.txt while ! grep 'sleep\.service.*running' /root/list-jobs.txt; do - systemctl list-jobs > /root/list-jobs.txt + systemctl list-jobs >/root/list-jobs.txt done grep 'hello\.service.*waiting' /root/list-jobs.txt @@ -22,7 +22,7 @@ ELAPSED=$(($END_SEC-$START_SEC)) test "$ELAPSED" -lt 3 # sleep should still be running, hello not. -systemctl list-jobs > /root/list-jobs.txt +systemctl list-jobs >/root/list-jobs.txt grep 'sleep\.service.*running' /root/list-jobs.txt grep 'hello\.service' /root/list-jobs.txt && exit 1 systemctl stop sleep.service hello-after-sleep.target @@ -58,13 +58,13 @@ systemctl stop --job-mode=replace-irreversibly unstoppable.service systemctl start unstoppable.service # Test waiting for a started unit(s) to terminate again -cat <<EOF > /run/systemd/system/wait2.service +cat <<EOF >/run/systemd/system/wait2.service [Unit] Description=Wait for 2 seconds [Service] ExecStart=/bin/sh -ec 'sleep 2' EOF -cat <<EOF > /run/systemd/system/wait5fail.service +cat <<EOF >/run/systemd/system/wait5fail.service [Unit] Description=Wait for 5 seconds and fail [Service] diff --git a/test/units/testsuite-04.sh b/test/units/testsuite-04.sh index f464f61a36..a2a1292380 100755 --- a/test/units/testsuite-04.sh +++ b/test/units/testsuite-04.sh @@ -63,15 +63,15 @@ grep '^FOO=' /output && { echo 'unexpected success'; exit 1; } grep '^SYSLOG_FACILITY=' /output && { echo 'unexpected success'; exit 1; } # `-b all` negates earlier use of -b (-b and -m are otherwise exclusive) -journalctl -b -1 -b all -m > /dev/null +journalctl -b -1 -b all -m >/dev/null # -b always behaves like -b0 -journalctl -q -b-1 -b0 | head -1 > /expected -journalctl -q -b-1 -b | head -1 > /output +journalctl -q -b-1 -b0 | head -1 >/expected +journalctl -q -b-1 -b | head -1 >/output cmp /expected /output # ... even when another option follows (both of these should fail due to -m) -{ journalctl -ball -b0 -m 2>&1 || :; } | head -1 > /expected -{ journalctl -ball -b -m 2>&1 || :; } | head -1 > /output +{ journalctl -ball -b0 -m 2>&1 || :; } | head -1 >/expected +{ journalctl -ball -b -m 2>&1 || :; } | head -1 >/output cmp /expected /output # https://github.com/systemd/systemd/issues/13708 diff --git a/test/units/testsuite-12.sh b/test/units/testsuite-12.sh index b5888a255b..7e7b0ec25a 100755 --- a/test/units/testsuite-12.sh +++ b/test/units/testsuite-12.sh @@ -14,7 +14,7 @@ SocketGroup=adm SocketMode=0660 EOF -cat <<'EOF' > /run/systemd/system/test12@.service +cat <<'EOF' >/run/systemd/system/test12@.service [Unit] Description=Test service [Service] diff --git a/test/units/testsuite-13.sh b/test/units/testsuite-13.sh index 1844323d2f..3e66aa9d54 100755 --- a/test/units/testsuite-13.sh +++ b/test/units/testsuite-13.sh @@ -51,9 +51,9 @@ function check_norbind { local _root="/var/lib/machines/testsuite-13.norbind-path" rm -rf "$_root" mkdir -p /tmp/binddir/subdir - echo -n "outer" > /tmp/binddir/subdir/file + echo -n "outer" >/tmp/binddir/subdir/file mount -t tmpfs tmpfs /tmp/binddir/subdir - echo -n "inner" > /tmp/binddir/subdir/file + echo -n "inner" >/tmp/binddir/subdir/file /usr/lib/systemd/tests/testdata/create-busybox-container "$_root" systemd-nspawn $SUSE_OPTS--register=no -D "$_root" --bind=/tmp/binddir:/mnt:norbind /bin/sh -c 'CONTENT=$(cat /mnt/subdir/file); if [[ $CONTENT != "outer" ]]; then echo "*** unexpected content: $CONTENT"; return 1; fi' } @@ -73,7 +73,7 @@ if [ -n "${VERSION_ID:+set}" ] && [ "${VERSION_ID}" != "${container_host_version if [ -n "${BUILD_ID:+set}" ] && [ "${BUILD_ID}" != "${container_host_build_id}" ]; then exit 1; fi if [ -n "${VARIANT_ID:+set}" ] && [ "${VARIANT_ID}" != "${container_host_variant_id}" ]; then exit 1; fi cd /tmp; (cd /run/host; md5sum os-release) | md5sum -c -if echo test >> /run/host/os-release; then exit 1; fi +if echo test >>/run/host/os-release; then exit 1; fi ' local _os_release_source="/etc/os-release" @@ -82,7 +82,7 @@ if echo test >> /run/host/os-release; then exit 1; fi elif [ -L "${_os_release_source}" ] && rm /etc/os-release; then # Ensure that /etc always wins if available cp /usr/lib/os-release /etc - echo MARKER=1 >> /etc/os-release + echo MARKER=1 >>/etc/os-release fi systemd-nspawn $SUSE_OPTS--register=no -D /testsuite-13.nc-container --bind="${_os_release_source}":/tmp/os-release /bin/sh -x -e -c "$_cmd" @@ -96,7 +96,7 @@ if echo test >> /run/host/os-release; then exit 1; fi function check_machinectl_bind { local _cmd='for i in $(seq 1 20); do if test -f /tmp/marker; then exit 0; fi; sleep 0.5; done; exit 1;' - cat <<EOF > /run/systemd/system/nspawn_machinectl_bind.service + cat <<EOF >/run/systemd/system/nspawn_machinectl_bind.service [Service] Type=notify ExecStart=systemd-nspawn $SUSE_OPTS -D /testsuite-13.nc-container --notify-ready=no /bin/sh -x -e -c "$_cmd" diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh index 23a39bf090..fc392c584d 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/testsuite-15.sh @@ -165,7 +165,7 @@ test_hierarchical_dropins () { echo " [Service] ExecCondition=/bin/echo $dropin - " > /usr/lib/systemd/system/$dropin/override.conf + " >/usr/lib/systemd/system/$dropin/override.conf systemctl daemon-reload check_ok a-b-c ExecCondition "/bin/echo $dropin" done diff --git a/test/units/testsuite-17.01.sh b/test/units/testsuite-17.01.sh index 573ad41079..8be27d9507 100755 --- a/test/units/testsuite-17.01.sh +++ b/test/units/testsuite-17.01.sh @@ -19,7 +19,7 @@ while : ; do sleep .5 done -cat > /run/udev/rules.d/50-testsuite.rules <<EOF +cat >/run/udev/rules.d/50-testsuite.rules <<EOF ACTION!="remove", SUBSYSTEM=="block", KERNEL=="sda", ENV{SYSTEMD_WANTS}="foobar.service" EOF udevadm control --reload @@ -36,7 +36,7 @@ while : ; do sleep .5 done -cat > /run/udev/rules.d/50-testsuite.rules <<EOF +cat >/run/udev/rules.d/50-testsuite.rules <<EOF ACTION!="remove", SUBSYSTEM=="block", KERNEL=="sda", ENV{SYSTEMD_WANTS}="waldo.service" EOF udevadm control --reload diff --git a/test/units/testsuite-17.02.sh b/test/units/testsuite-17.02.sh index c21fcc781b..5c77ab4b6a 100755 --- a/test/units/testsuite-17.02.sh +++ b/test/units/testsuite-17.02.sh @@ -4,7 +4,7 @@ set -o pipefail mkdir -p /run/udev/rules.d/ -cat > /run/udev/rules.d/50-testsuite.rules <<EOF +cat >/run/udev/rules.d/50-testsuite.rules <<EOF ACTION=="remove", GOTO="lo_end" SUBSYSTEM=="net", KERNEL=="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/lo" diff --git a/test/units/testsuite-17.03.sh b/test/units/testsuite-17.03.sh index 02ac2176b5..e5178ce554 100755 --- a/test/units/testsuite-17.03.sh +++ b/test/units/testsuite-17.03.sh @@ -7,9 +7,9 @@ test_rule="/run/udev/rules.d/49-test.rules" setup() { mkdir -p "${test_rule%/*}" cp -f /etc/udev/udev.conf /etc/udev/udev.conf.bckp - echo 'KERNEL=="lo", SUBSYSTEM=="net", PROGRAM=="/bin/sleep 60"' > "${test_rule}" - echo "event_timeout=30" >> /etc/udev/udev.conf - echo "timeout_signal=SIGABRT" >> /etc/udev/udev.conf + echo 'KERNEL=="lo", SUBSYSTEM=="net", PROGRAM=="/bin/sleep 60"' >"${test_rule}" + echo "event_timeout=30" >>/etc/udev/udev.conf + echo "timeout_signal=SIGABRT" >>/etc/udev/udev.conf systemctl restart systemd-udevd.service } @@ -25,7 +25,7 @@ teardown() { run_test() { since="$(date +%T)" - echo add > /sys/class/net/lo/uevent + echo add >/sys/class/net/lo/uevent for n in {1..20}; do sleep 5 diff --git a/test/units/testsuite-17.04.sh b/test/units/testsuite-17.04.sh index c799936c0a..428aa81332 100755 --- a/test/units/testsuite-17.04.sh +++ b/test/units/testsuite-17.04.sh @@ -11,7 +11,7 @@ mkdir -p /run/udev/rules.d/ udevadm info /dev/null | grep -q -v 'E: TAGS=.*:changed:.*' && udevadm info /dev/null | grep -q -v 'E: CURRENT_TAGS=.*:changed:.*' -cat > /run/udev/rules.d/50-testsuite.rules <<EOF +cat >/run/udev/rules.d/50-testsuite.rules <<EOF ACTION=="add", SUBSYSTEM=="mem", KERNEL=="null", TAG+="added" ACTION=="change", SUBSYSTEM=="mem", KERNEL=="null", TAG+="changed" EOF diff --git a/test/units/testsuite-17.05.sh b/test/units/testsuite-17.05.sh index 0991ec9d59..1e7f7f41b0 100755 --- a/test/units/testsuite-17.05.sh +++ b/test/units/testsuite-17.05.sh @@ -4,7 +4,7 @@ set -o pipefail mkdir -p /run/udev/rules.d/ -cat > /run/udev/rules.d/50-testsuite.rules <<EOF +cat >/run/udev/rules.d/50-testsuite.rules <<EOF SUBSYSTEM=="mem", KERNEL=="null", OPTIONS="log_level=debug" ACTION=="add", SUBSYSTEM=="mem", KERNEL=="null", IMPORT{program}="/bin/echo -e HOGE=aa\\\\x20\\\\x20\\\\x20bb\nFOO=\\\\x20aaa\\\\x20\n\n\n" EOF diff --git a/test/units/testsuite-18.sh b/test/units/testsuite-18.sh index d3c2df8101..c4e3ca2110 100755 --- a/test/units/testsuite-18.sh +++ b/test/units/testsuite-18.sh @@ -6,10 +6,10 @@ systemd-run --wait -p FailureAction=poweroff true systemd-run --wait -p SuccessAction=poweroff false && { echo 'unexpected success'; exit 1; } if ! test -f /firstphase ; then - echo OK > /firstphase + echo OK >/firstphase systemd-run --wait -p SuccessAction=reboot true else - echo OK > /testok + echo OK >/testok systemd-run --wait -p FailureAction=poweroff false fi diff --git a/test/units/testsuite-19.sh b/test/units/testsuite-19.sh index 57831c267f..dea2f4ba1f 100755 --- a/test/units/testsuite-19.sh +++ b/test/units/testsuite-19.sh @@ -34,6 +34,6 @@ else echo "Skipping TEST-19-DELEGATE, as the kernel doesn't actually support cgroup v2" >&2 fi -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-20.sh b/test/units/testsuite-20.sh index 0e0feded39..6003e4f181 100755 --- a/test/units/testsuite-20.sh +++ b/test/units/testsuite-20.sh @@ -71,7 +71,7 @@ disown sleep infinity & disown -echo \$MAINPID > /run/mainpidsh/pid +echo \$MAINPID >/run/mainpidsh/pid EOF chmod +x /tmp/test20-mainpid.sh @@ -95,7 +95,7 @@ disown sleep infinity & disown -echo \$MAINPID > /run/mainpidsh2/pid +echo \$MAINPID >/run/mainpidsh2/pid chown 1001:1001 /run/mainpidsh2/pid EOF chmod +x /tmp/test20-mainpid2.sh @@ -140,10 +140,10 @@ systemd-run --unit=test20-mainpidsh3.service \ && { echo 'unexpected success'; exit 1; } # Test that this failed due to timeout, and not some other error -test `systemctl show -P Result test20-mainpidsh3.service` = timeout +test $(systemctl show -P Result test20-mainpidsh3.service) = timeout systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-23.sh b/test/units/testsuite-23.sh index ebee20a65a..a215237562 100755 --- a/test/units/testsuite-23.sh +++ b/test/units/testsuite-23.sh @@ -29,6 +29,6 @@ systemctl stop seven.service systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-25.sh b/test/units/testsuite-25.sh index ef27e2dfbf..d4d2e0f953 100755 --- a/test/units/testsuite-25.sh +++ b/test/units/testsuite-25.sh @@ -67,7 +67,7 @@ mkdir /var/tmp/scratch mv /var/tmp/testimage.raw /var/tmp/scratch/ touch /var/tmp/scratch/anotherfile mkdir /var/tmp/scratch/adirectory -echo "piep" > /var/tmp/scratch/adirectory/athirdfile +echo "piep" >/var/tmp/scratch/adirectory/athirdfile # Test import-fs machinectl import-fs /var/tmp/scratch/ @@ -138,6 +138,6 @@ machinectl remove scratch5 test ! -f /var/lib/machines/scratch5 machinectl image-status scratch5 && { echo 'unexpected success'; exit 1; } -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-26.sh b/test/units/testsuite-26.sh index 22bd22c2b0..9c1abc5916 100755 --- a/test/units/testsuite-26.sh +++ b/test/units/testsuite-26.sh @@ -26,6 +26,6 @@ systemctl show-environment | grep '^FOO=$' && exit 1 systemctl show-environment | grep '^PATH=.*testaddition$' && exit 1 systemctl show-environment | grep -q '^PATH=' -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-29.sh b/test/units/testsuite-29.sh index 2e55c275bf..4e91aa7336 100755 --- a/test/units/testsuite-29.sh +++ b/test/units/testsuite-29.sh @@ -93,6 +93,6 @@ umount /tmp/overlay umount /tmp/rootdir umount /tmp/app1 -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-30.sh b/test/units/testsuite-30.sh index 425f153c3b..cb3b46d2cb 100755 --- a/test/units/testsuite-30.sh +++ b/test/units/testsuite-30.sh @@ -26,6 +26,6 @@ while test ! -f /tmp/clock-changed ; do sleep .5 ; done systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-31.sh b/test/units/testsuite-31.sh index fcff82d804..42873bfd83 100755 --- a/test/units/testsuite-31.sh +++ b/test/units/testsuite-31.sh @@ -6,5 +6,5 @@ if journalctl -b -t systemd --grep '\.device: Changed plugged -> dead'; then exit 1 fi -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-33.sh b/test/units/testsuite-33.sh index d79d054fcd..929c76062b 100755 --- a/test/units/testsuite-33.sh +++ b/test/units/testsuite-33.sh @@ -4,7 +4,7 @@ set -ex set -o pipefail -cat > /etc/systemd/system/testservice.service <<EOF +cat >/etc/systemd/system/testservice.service <<EOF [Service] ConfigurationDirectory=testservice RuntimeDirectory=testservice @@ -74,7 +74,7 @@ test ! -e /var/lib/testservice test ! -e /var/cache/testservice test ! -e /var/log/testservice -cat > /etc/systemd/system/testservice.service <<EOF +cat >/etc/systemd/system/testservice.service <<EOF [Service] DynamicUser=yes ConfigurationDirectory=testservice @@ -169,7 +169,7 @@ test ! -L /var/lib/testservice test ! -L /var/cache/testservice test ! -L /var/log/testservice -cat > /etc/systemd/system/tmp-hoge.mount <<EOF +cat >/etc/systemd/system/tmp-hoge.mount <<EOF [Mount] What=tmpfs Type=tmpfs @@ -244,7 +244,7 @@ test ! -d /var/lib/hoge test ! -d /var/cache/hoge test ! -d /var/log/hoge -cat > /etc/systemd/system/testservice.socket <<EOF +cat >/etc/systemd/system/testservice.socket <<EOF [Socket] ListenSequentialPacket=/run/testservice.socket RemoveOnStop=yes @@ -314,6 +314,6 @@ test ! -e /var/lib/testsocket test ! -e /var/cache/testsocket test ! -e /var/log/testsocket -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-34.sh b/test/units/testsuite-34.sh index 827eafc433..ca54a01f40 100755 --- a/test/units/testsuite-34.sh +++ b/test/units/testsuite-34.sh @@ -44,6 +44,6 @@ test ! -f /var/lib/zzz/test-missing systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-36.sh b/test/units/testsuite-36.sh index f5579ce825..3decf4b3f3 100755 --- a/test/units/testsuite-36.sh +++ b/test/units/testsuite-36.sh @@ -55,7 +55,7 @@ stopJournalctl() { # the --sync wait until the synchronization is complete echo "Force journald to write all queued messages" journalctl --sync - journalctl -u $unit --cursor-file="$journalCursorFile" > "$journalLog" + journalctl -u $unit --cursor-file="$journalCursorFile" >"$journalLog" } checkNUMA() { @@ -64,21 +64,21 @@ checkNUMA() { } writePID1NUMAPolicy() { - echo [Manager] > $confDir/numa.conf - echo NUMAPolicy=$1 >> $confDir/numa.conf - echo NUMAMask=$2>> $confDir/numa.conf + echo [Manager] >$confDir/numa.conf + echo NUMAPolicy=$1 >>$confDir/numa.conf + echo NUMAMask=$2 >>$confDir/numa.conf } writeTestUnit() { mkdir -p $testUnitFile.d/ - echo [Service] > $testUnitFile - echo ExecStart=/bin/sleep 3600 >> $testUnitFile + echo [Service] >$testUnitFile + echo ExecStart=/bin/sleep 3600 >>$testUnitFile } writeTestUnitNUMAPolicy() { - echo [Service] > $testUnitNUMAConf - echo NUMAPolicy=$1 >> $testUnitNUMAConf - echo NUMAMask=$2>> $testUnitNUMAConf + echo [Service] >$testUnitNUMAConf + echo NUMAPolicy=$1 >>$testUnitNUMAConf + echo NUMAMask=$2 >>$testUnitNUMAConf systemctl daemon-reload } @@ -115,13 +115,13 @@ pid1StopUnit() { systemctlCheckNUMAProperties() { local LOGFILE="$(mktemp)" - systemctl show -p NUMAPolicy $1 > "$LOGFILE" + systemctl show -p NUMAPolicy $1 >"$LOGFILE" grep "NUMAPolicy=$2" "$LOGFILE" - > "$LOGFILE" + >"$LOGFILE" if [ -n "$3" ]; then - systemctl show -p NUMAMask $1 > "$LOGFILE" + systemctl show -p NUMAMask $1 >"$LOGFILE" grep "NUMAMask=$3" "$LOGFILE" fi } @@ -281,7 +281,7 @@ else echo "Unit file CPUAffinity=NUMA support" writeTestUnitNUMAPolicy "bind" "0" - echo "CPUAffinity=numa" >> $testUnitNUMAConf + echo "CPUAffinity=numa" >>$testUnitNUMAConf systemctl daemon-reload systemctl start $testUnit systemctlCheckNUMAProperties $testUnit "bind" "0" @@ -336,6 +336,6 @@ systemctl daemon-reload systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-37.sh b/test/units/testsuite-37.sh index 696b8cdeef..3ae0cb32fe 100755 --- a/test/units/testsuite-37.sh +++ b/test/units/testsuite-37.sh @@ -14,6 +14,6 @@ systemctl restart tmp-aaa.mount test -e /run/hoge/foo test ! -e /tmp/aaa/bbb -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-38.sh b/test/units/testsuite-38.sh index 18b7bd6dce..707fd8a864 100755 --- a/test/units/testsuite-38.sh +++ b/test/units/testsuite-38.sh @@ -245,7 +245,7 @@ test_preserve_state() { echo "Test that freezer state is preserved when recursive freezing is initiated from outside (e.g. by manager up the tree):" echo -n " - freeze from outside: " - echo 1 > /sys/fs/cgroup/"${slice}"/cgroup.freeze + echo 1 >/sys/fs/cgroup/"${slice}"/cgroup.freeze # Give kernel some time to freeze the slice sleep 1 @@ -259,7 +259,7 @@ test_preserve_state() { echo "[ OK ]" echo -n " - thaw from outside: " - echo 0 > /sys/fs/cgroup/"${slice}"/cgroup.freeze + echo 0 >/sys/fs/cgroup/"${slice}"/cgroup.freeze sleep 1 check_freezer_state "${unit}" "running" @@ -271,8 +271,8 @@ test_preserve_state() { echo -n " - thaw from outside while inner service is frozen: " systemctl freeze "$unit" check_freezer_state "${unit}" "frozen" - echo 1 > /sys/fs/cgroup/"${slice}"/cgroup.freeze - echo 0 > /sys/fs/cgroup/"${slice}"/cgroup.freeze + echo 1 >/sys/fs/cgroup/"${slice}"/cgroup.freeze + echo 0 >/sys/fs/cgroup/"${slice}"/cgroup.freeze check_freezer_state "${slice}" "running" check_freezer_state "${unit}" "frozen" echo "[ OK ]" @@ -293,5 +293,5 @@ test -e /sys/fs/cgroup/system.slice/cgroup.freeze && { test_preserve_state } -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-39.sh b/test/units/testsuite-39.sh index 0b0cfc5aa5..5c0680878f 100755 --- a/test/units/testsuite-39.sh +++ b/test/units/testsuite-39.sh @@ -11,7 +11,7 @@ SERVICE_PATH="$(mktemp /etc/systemd/system/execreloadXXX.service)" SERVICE_NAME="${SERVICE_PATH##*/}" echo "[#1] Failing ExecReload= should not kill the service" -cat > "$SERVICE_PATH" << EOF +cat >"$SERVICE_PATH" <<EOF [Service] ExecStart=/bin/sleep infinity ExecReload=/bin/false @@ -27,7 +27,7 @@ systemctl stop $SERVICE_NAME echo "[#2] Failing ExecReload= should not kill the service (multiple ExecReload=)" -cat > "$SERVICE_PATH" << EOF +cat >"$SERVICE_PATH" <<EOF [Service] ExecStart=/bin/sleep infinity ExecReload=/bin/true @@ -44,7 +44,7 @@ systemctl status $SERVICE_NAME systemctl stop $SERVICE_NAME echo "[#3] Failing ExecReload=- should not affect reload's exit code" -cat > "$SERVICE_PATH" << EOF +cat >"$SERVICE_PATH" <<EOF [Service] ExecStart=/bin/sleep infinity ExecReload=-/bin/false @@ -59,6 +59,6 @@ systemctl stop $SERVICE_NAME systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-40.sh b/test/units/testsuite-40.sh index 957d22031a..7593401369 100755 --- a/test/units/testsuite-40.sh +++ b/test/units/testsuite-40.sh @@ -41,6 +41,6 @@ done systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-41.sh b/test/units/testsuite-41.sh index 7caf99be24..0a43f8ba57 100755 --- a/test/units/testsuite-41.sh +++ b/test/units/testsuite-41.sh @@ -51,6 +51,6 @@ fi systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-42.sh b/test/units/testsuite-42.sh index 155c3c7384..ca13c5dec5 100755 --- a/test/units/testsuite-42.sh +++ b/test/units/testsuite-42.sh @@ -17,7 +17,7 @@ systemd-run --unit=exec2.service --wait -p StandardOutput=tty -p StandardError=t && { echo 'unexpected success'; exit 1; } test -f /run/exec2 -cat > /tmp/forking1.sh <<EOF +cat >/tmp/forking1.sh <<EOF #!/usr/bin/env bash set -eux @@ -33,7 +33,7 @@ chmod +x /tmp/forking1.sh systemd-run --unit=forking1.service --wait -p StandardOutput=tty -p StandardError=tty -p Type=forking -p NotifyAccess=exec -p ExecStopPost='/bin/touch /run/forking1' /tmp/forking1.sh test -f /run/forking1 -cat > /tmp/forking2.sh <<EOF +cat >/tmp/forking2.sh <<EOF #!/usr/bin/env bash set -eux @@ -65,7 +65,7 @@ test -f /run/dbus1 systemd-run --unit=dbus2.service --wait -p StandardOutput=tty -p StandardError=tty -p Type=dbus -p BusName=systemd.test.ExecStopPost -p ExecStopPost='/bin/touch /run/dbus2' true test -f /run/dbus2 -cat > /tmp/notify1.sh <<EOF +cat >/tmp/notify1.sh <<EOF #!/usr/bin/env bash set -eux @@ -90,6 +90,6 @@ test -f /run/idle2 systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-43.sh b/test/units/testsuite-43.sh index ec84868a21..d9453e81a1 100755 --- a/test/units/testsuite-43.sh +++ b/test/units/testsuite-43.sh @@ -63,6 +63,6 @@ runas testuser systemd-run --wait --user --unit=test-protect-home-yes \ systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-44.sh b/test/units/testsuite-44.sh index 97541634d0..78022cb545 100755 --- a/test/units/testsuite-44.sh +++ b/test/units/testsuite-44.sh @@ -6,14 +6,14 @@ systemd-analyze log-level debug systemd-run -p LogNamespace=foobar echo "hello world" journalctl --namespace=foobar --sync -journalctl --namespace=foobar > /tmp/hello-world -journalctl > /tmp/no-hello-world +journalctl --namespace=foobar >/tmp/hello-world +journalctl >/tmp/no-hello-world grep "hello world" /tmp/hello-world ! grep "hello world" /tmp/no-hello-world systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index 00bbdf507e..5390acabf3 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -4,7 +4,7 @@ set -o pipefail # Check if homectl is installed, and if it isn't bail out early instead of failing if ! test -x /usr/bin/homectl ; then - echo OK > /testok + echo OK >/testok exit 0 fi @@ -76,6 +76,6 @@ homectl remove test-user systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-47-repro.sh b/test/units/testsuite-47-repro.sh index 8c34289c52..b008f52e95 100755 --- a/test/units/testsuite-47-repro.sh +++ b/test/units/testsuite-47-repro.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash sleep infinity & -echo $! > /leakedtestpid +echo $! >/leakedtestpid wait $! diff --git a/test/units/testsuite-47.sh b/test/units/testsuite-47.sh index 50034cf3d9..f8529083a2 100755 --- a/test/units/testsuite-47.sh +++ b/test/units/testsuite-47.sh @@ -20,6 +20,6 @@ ps -p "$leaked_pid" && exit 42 systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-48.sh b/test/units/testsuite-48.sh index 03231e71b1..ea84b1d723 100755 --- a/test/units/testsuite-48.sh +++ b/test/units/testsuite-48.sh @@ -3,7 +3,7 @@ # ex: ts=8 sw=4 sts=4 et filetype=sh set -ex -cat > /run/systemd/system/testservice-48.target <<EOF +cat >/run/systemd/system/testservice-48.target <<EOF [Unit] Wants=testservice-48.service EOF @@ -23,7 +23,7 @@ systemctl start testservice-48.target # May 07 23:12:20 systemd-testsuite testsuite-48.sh[53]: ef53 sleep 3.1 -cat > /run/systemd/system/testservice-48.service <<EOF +cat >/run/systemd/system/testservice-48.service <<EOF [Service] ExecStart=/bin/sleep infinity EOF @@ -39,7 +39,7 @@ systemctl daemon-reload sleep 3.1 -cat > /run/systemd/system/testservice-48.service <<EOF +cat >/run/systemd/system/testservice-48.service <<EOF [Service] ExecStart=/bin/sleep infinity EOF @@ -61,7 +61,7 @@ systemctl daemon-reload sleep 3.1 -cat > /run/systemd/system/testservice-48.target <<EOF +cat >/run/systemd/system/testservice-48.target <<EOF [Unit] Conflicts=shutdown.target Wants=testservice-48.service @@ -71,7 +71,7 @@ systemctl daemon-reload systemctl start testservice-48.target -cat > /run/systemd/system/testservice-48.service <<EOF +cat >/run/systemd/system/testservice-48.service <<EOF [Service] ExecStart=/bin/sleep infinity EOF @@ -80,6 +80,6 @@ systemctl restart testservice-48.target systemctl is-active testservice-48.service -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-49.sh b/test/units/testsuite-49.sh index 07bb20d99c..f92280f884 100755 --- a/test/units/testsuite-49.sh +++ b/test/units/testsuite-49.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -ex -echo "MARKER_FIXED" > /run/testservice-49-fixed +echo "MARKER_FIXED" >/run/testservice-49-fixed mkdir -p /run/inaccessible systemctl start testsuite-49-namespaced.service @@ -11,7 +11,7 @@ set +e systemctl bind --mkdir testsuite-49-namespaced.service /run/testservice-49-fixed /run/inaccessible/testfile_fixed && exit 1 set -e -echo "MARKER_RUNTIME" > /run/testservice-49-runtime +echo "MARKER_RUNTIME" >/run/testservice-49-runtime systemctl bind --mkdir testsuite-49-namespaced.service /run/testservice-49-runtime /tmp/testfile_runtime @@ -38,6 +38,6 @@ set +e systemctl is-active testsuite-49-non-namespaced.service && exit 1 set -e -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index e2d8ef6da2..c3e7b4f04e 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -207,7 +207,7 @@ grep -F "squashfs" ${image_dir}/result/c | grep -q -F -v "nosuid" # Adding a new mounts at runtime works if the unit is in the active state, # so use Type=notify to make sure there's no race condition in the test -cat > /run/systemd/system/testservice-50d.service <<EOF +cat >/run/systemd/system/testservice-50d.service <<EOF [Service] RuntimeMaxSec=300 Type=notify diff --git a/test/units/testsuite-54.sh b/test/units/testsuite-54.sh index b8f5c0cb39..d145d7e33e 100755 --- a/test/units/testsuite-54.sh +++ b/test/units/testsuite-54.sh @@ -10,7 +10,7 @@ systemd-run -p LoadCredential=passwd:/etc/passwd \ -p DynamicUser=1 \ --wait \ --pipe \ - cat '${CREDENTIALS_DIRECTORY}/passwd' '${CREDENTIALS_DIRECTORY}/shadow' '${CREDENTIALS_DIRECTORY}/dog' > /tmp/ts54-concat + cat '${CREDENTIALS_DIRECTORY}/passwd' '${CREDENTIALS_DIRECTORY}/shadow' '${CREDENTIALS_DIRECTORY}/dog' >/tmp/ts54-concat ( cat /etc/passwd /etc/shadow && echo -n wuff ) | cmp /tmp/ts54-concat rm /tmp/ts54-concat @@ -28,6 +28,6 @@ systemd-run -p LoadCredential=passwd:/etc/passwd \ systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-55.sh b/test/units/testsuite-55.sh index f7896ada42..d73f4b1e7a 100755 --- a/test/units/testsuite-55.sh +++ b/test/units/testsuite-55.sh @@ -6,19 +6,19 @@ systemd-analyze log-level debug systemd-analyze log-target console # Loose checks to ensure the environment has the necessary features for systemd-oomd -[[ -e /proc/pressure ]] || echo "no PSI" >> /skipped +[[ -e /proc/pressure ]] || echo "no PSI" >>/skipped cgroup_type=$(stat -fc %T /sys/fs/cgroup/) if [[ "$cgroup_type" != *"cgroup2"* ]] && [[ "$cgroup_type" != *"0x63677270"* ]]; then - echo "no cgroup2" >> /skipped + echo "no cgroup2" >>/skipped fi if [ ! -f /usr/lib/systemd/systemd-oomd ] && [ ! -f /lib/systemd/systemd-oomd ]; then - echo "no oomd" >> /skipped + echo "no oomd" >>/skipped fi [[ -e /skipped ]] && exit 0 || true rm -rf /etc/systemd/system/testsuite-55-testbloat.service.d -echo "DefaultMemoryPressureDurationSec=5s" >> /etc/systemd/oomd.conf +echo "DefaultMemoryPressureDurationSec=5s" >>/etc/systemd/oomd.conf systemctl start testsuite-55-testchill.service systemctl start testsuite-55-testbloat.service @@ -47,8 +47,8 @@ if setfattr -n user.xattr_test -v 1 /sys/fs/cgroup/; then sleep 120 # wait for systemd-oomd kill cool down and elevated memory pressure to come down mkdir -p /etc/systemd/system/testsuite-55-testbloat.service.d/ - echo "[Service]" > /etc/systemd/system/testsuite-55-testbloat.service.d/override.conf - echo "ManagedOOMPreference=avoid" >> /etc/systemd/system/testsuite-55-testbloat.service.d/override.conf + echo "[Service]" >/etc/systemd/system/testsuite-55-testbloat.service.d/override.conf + echo "ManagedOOMPreference=avoid" >>/etc/systemd/system/testsuite-55-testbloat.service.d/override.conf systemctl daemon-reload systemctl start testsuite-55-testchill.service @@ -71,6 +71,6 @@ fi systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 diff --git a/test/units/testsuite-56.sh b/test/units/testsuite-56.sh index 0b5010b9f9..079da07201 100755 --- a/test/units/testsuite-56.sh +++ b/test/units/testsuite-56.sh @@ -93,6 +93,6 @@ systemd-run --wait --unit=eight -p ExitType=cgroup /tmp/test56-exit-cgroup-uncle systemd-analyze log-level info -echo OK > /testok +echo OK >/testok exit 0 |