]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop unnecessary disablement of pipefail
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Jul 2025 09:36:09 +0000 (18:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Jul 2025 23:45:46 +0000 (08:45 +0900)
test/units/TEST-04-JOURNAL.journal.sh
test/units/TEST-17-UDEV.rename-netif.sh
test/units/TEST-35-LOGIN.sh
test/units/TEST-50-DISSECT.dissect.sh
test/units/TEST-60-MOUNT-RATELIMIT.sh
test/units/TEST-75-RESOLVED.sh

index bd9f8a5e820b2de3d7656e0e2cd62a7a6c0a7cb7..56b573178819025fe0b965b057d1c900cbbd9b74 100755 (executable)
@@ -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
index 96430e64ae97d46447dc60d616e787f3274b5af9..a9fcf28bfb05815bb0a87a08fa472c00d60d3855 100755 (executable)
@@ -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"
 }
index a543023ceab4d36d3d60c5f776b9b83bd96d6e39..f5b1911edc51196cc054e49646164da6202a98ca 100755 (executable)
@@ -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() {
index 8cfeeb66d4c34061d329f53678248ea3ba7d0e13..e9ae17ca279ade742ebe45bd2f47185e739db38f 100755 (executable)
@@ -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"
index 67d44c281a938433f5a0dd408a27ce4220c6739f..fdef5999ef7626fe046d9b963caf1ef2c5100fa9 100755 (executable)
@@ -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.
index c4ed53ec6ca50d989541601c44f6dc0ff50715e6..1bde5f3b76d61cbd1f91675c146b57e342bd7203 100755 (executable)
@@ -53,7 +53,6 @@ enable_ipv6() {
 
 monitor_check_rr() (
     set +x
-    set +o pipefail
     local since="${1:?}"
     local match="${2:?}"