From d6b379370485b9651f86b628ce980de719299eb4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Jul 2025 18:36:09 +0900 Subject: [PATCH] test: drop unnecessary disablement of pipefail --- test/units/TEST-04-JOURNAL.journal.sh | 2 -- test/units/TEST-17-UDEV.rename-netif.sh | 2 -- test/units/TEST-35-LOGIN.sh | 4 ---- test/units/TEST-50-DISSECT.dissect.sh | 2 -- test/units/TEST-60-MOUNT-RATELIMIT.sh | 2 -- test/units/TEST-75-RESOLVED.sh | 1 - 6 files changed, 13 deletions(-) diff --git a/test/units/TEST-04-JOURNAL.journal.sh b/test/units/TEST-04-JOURNAL.journal.sh index bd9f8a5e820..56b57317881 100755 --- a/test/units/TEST-04-JOURNAL.journal.sh +++ b/test/units/TEST-04-JOURNAL.journal.sh @@ -210,12 +210,10 @@ sleep 3 [[ ! -f "/tmp/i-lose-my-logs" ]] systemctl stop forever-print-hola -set +o pipefail # https://github.com/systemd/systemd/issues/15528 journalctl --follow --file=/var/log/journal/*/* | head -n1 | grep . # https://github.com/systemd/systemd/issues/24565 journalctl --follow --merge | head -n1 | grep . -set -o pipefail # https://github.com/systemd/systemd/issues/26746 rm -f /tmp/issue-26746-log /tmp/issue-26746-cursor diff --git a/test/units/TEST-17-UDEV.rename-netif.sh b/test/units/TEST-17-UDEV.rename-netif.sh index 96430e64ae9..a9fcf28bfb0 100755 --- a/test/units/TEST-17-UDEV.rename-netif.sh +++ b/test/units/TEST-17-UDEV.rename-netif.sh @@ -174,9 +174,7 @@ EOF test -n "$found" journalctl --sync - set +o pipefail timeout -v 30 journalctl _PID=1 _COMM=systemd --since "$since" -n all --follow | grep -m 1 -q -F 'foobar: systemd-udevd failed to process the device, ignoring: File exists' - set -o pipefail # check if the invalid SYSTEMD_ALIAS property for the interface foobar is ignored by PID1 assert_eq "$(systemctl show --property=SysFSPath --value /sys/subsystem/net/devices/hoge)" "/sys/devices/virtual/net/hoge" } diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index a543023ceab..f5b1911edc5 100755 --- a/test/units/TEST-35-LOGIN.sh +++ b/test/units/TEST-35-LOGIN.sh @@ -528,9 +528,7 @@ EOF # become idle again. 'Lock' signal is sent out for each session, we have at # least one session, so minimum of 2 "Lock" signals must have been sent. journalctl --sync - set +o pipefail timeout -v 35 journalctl -b -u systemd-logind.service --since="$ts" -n all --follow | grep -m 1 -q 'Sent message type=signal .* member=Lock' - set -o pipefail # We need to know that a new message was sent after waking up, # so we must track how many happened before sleeping to check we have extra. @@ -541,10 +539,8 @@ EOF # Wait again journalctl --sync - set +o pipefail timeout -v 35 journalctl -b -u systemd-logind.service --since="$ts" -n all --follow | grep -m "$((locks + 1))" -q 'Sent message type=signal .* member=Lock' timeout -v 35 journalctl -b -u systemd-logind.service --since="$ts" -n all --follow | grep -m 2 -q -F 'System idle. Will be locked now.' - set -o pipefail } testcase_session_properties() { diff --git a/test/units/TEST-50-DISSECT.dissect.sh b/test/units/TEST-50-DISSECT.dissect.sh index 8cfeeb66d4c..e9ae17ca279 100755 --- a/test/units/TEST-50-DISSECT.dissect.sh +++ b/test/units/TEST-50-DISSECT.dissect.sh @@ -933,12 +933,10 @@ systemd-sysext merge --no-reload systemd-sysext unmerge --no-reload systemd-sysext merge journalctl --sync -set +o pipefail # "journalctl -u foo.service" may not work as expected, especially entries for _TRANSPORT=stdout, # for short-living services or when the service manager generates debugging logs. # Instead, SYSLOG_IDENTIFIER= should be reliable for stdout. Let's use it. timeout -v 30s journalctl -b SYSLOG_IDENTIFIER=echo _TRANSPORT=stdout -o cat -n all --follow | grep -m 1 -q '^foo$' -set -o pipefail systemd-sysext unmerge --no-reload # Grep on the Warning to find the warning helper mentioning the daemon reload. systemctl status foo.service 2>&1 | grep -q -F "Warning" diff --git a/test/units/TEST-60-MOUNT-RATELIMIT.sh b/test/units/TEST-60-MOUNT-RATELIMIT.sh index 67d44c281a9..fdef5999ef7 100755 --- a/test/units/TEST-60-MOUNT-RATELIMIT.sh +++ b/test/units/TEST-60-MOUNT-RATELIMIT.sh @@ -305,13 +305,11 @@ testcase_mount_ratelimit() { # Figure out if we have entered the rate limit state. # If the infra is slow we might not enter the rate limit state; in that case skip the exit check. - set +o pipefail journalctl --sync if timeout 2m journalctl -u init.scope --since="$ts" -n all --follow | grep -m 1 -q -F '(mount-monitor-dispatch) entered rate limit'; then journalctl --sync timeout 2m journalctl -u init.scope --since="$ts" -n all --follow | grep -m 1 -q -F '(mount-monitor-dispatch) left rate limit' fi - set -o pipefail # Verify that the mount units are always cleaned up at the end. # Give some time for units to settle so we don't race between exiting the rate limit state and cleaning up the units. diff --git a/test/units/TEST-75-RESOLVED.sh b/test/units/TEST-75-RESOLVED.sh index c4ed53ec6ca..1bde5f3b76d 100755 --- a/test/units/TEST-75-RESOLVED.sh +++ b/test/units/TEST-75-RESOLVED.sh @@ -53,7 +53,6 @@ enable_ipv6() { monitor_check_rr() ( set +x - set +o pipefail local since="${1:?}" local match="${2:?}" -- 2.47.3