File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 174174 test -n " $found "
175175
176176 journalctl --sync
177- timeout 30 bash -c " until journalctl _PID=1 _COMM=systemd --since $since | grep -q 'foobar: systemd-udevd failed to process the device, ignoring: File exists'; do sleep 1; journalctl --sync; done"
177+ set +o pipefail
178+ 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'
179+ set -o pipefail
178180 # check if the invalid SYSTEMD_ALIAS property for the interface foobar is ignored by PID1
179181 assert_eq " $( systemctl show --property=SysFSPath --value /sys/subsystem/net/devices/hoge) " " /sys/devices/virtual/net/hoge"
180182}
Original file line number Diff line number Diff line change 524524 # become idle again. 'Lock' signal is sent out for each session, we have at
525525 # least one session, so minimum of 2 "Lock" signals must have been sent.
526526 journalctl --sync
527- timeout 35 bash -c " while [[ \"\$ (journalctl -b -u systemd-logind.service --since=$ts | grep -c 'Sent message type=signal .* member=Lock')\" -lt 1 ]]; do sleep 1; journalctl --sync; done"
527+ set +o pipefail
528+ timeout -v 35 journalctl -b -u systemd-logind.service --since=" $ts " -n all --follow | grep -m 1 -q ' Sent message type=signal .* member=Lock'
529+ set -o pipefail
528530
529531 # We need to know that a new message was sent after waking up,
530532 # so we must track how many happened before sleeping to check we have extra.
@@ -535,12 +537,10 @@ EOF
535537
536538 # Wait again
537539 journalctl --sync
538- timeout 35 bash -c " while [[ \"\$ (journalctl -b -u systemd-logind.service --since=$ts | grep -c 'Sent message type=signal .* member=Lock')\" -lt $(( locks + 1 )) ]]; do sleep 1; journalctl --sync; done"
539-
540- if [[ " $( journalctl -b -u systemd-logind.service --since=" $ts " | grep -c ' System idle. Will be locked now.' ) " -lt 2 ]]; then
541- echo >&2 " System haven't entered idle state at least 2 times."
542- exit 1
543- fi
540+ set +o pipefail
541+ 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'
542+ 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.'
543+ set -o pipefail
544544}
545545
546546testcase_session_properties () {
Original file line number Diff line number Diff line change @@ -723,8 +723,9 @@ systemd-sysext merge --no-reload
723723systemd-sysext unmerge --no-reload
724724systemd-sysext merge
725725journalctl --sync
726- # shellcheck disable=SC2016
727- timeout 30s bash -xec ' until [[ $(journalctl -b -u foo.service _TRANSPORT=stdout -o cat) == foo ]]; do sleep 1; journalctl --sync; done'
726+ set +o pipefail
727+ timeout -v 30s journalctl -b -u foo.service _TRANSPORT=stdout -o cat -n all --follow | grep -m 1 -q ' ^foo$'
728+ set -o pipefail
728729systemd-sysext unmerge --no-reload
729730# Grep on the Warning to find the warning helper mentioning the daemon reload.
730731systemctl status foo.service 2>&1 | grep -q -F " Warning"
Original file line number Diff line number Diff line change @@ -294,11 +294,13 @@ done
294294
295295# Figure out if we have entered the rate limit state.
296296# If the infra is slow we might not enter the rate limit state; in that case skip the exit check.
297+ set +o pipefail
297298journalctl --sync
298- if timeout 2m bash -c " until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) entered rate limit'; do sleep 1; journalctl --sync; done " ; then
299+ if timeout 2m journalctl -u init.scope --since=" $TS " -n all --follow | grep -m 1 -q -F ' (mount-monitor-dispatch) entered rate limit' ; then
299300 journalctl --sync
300- timeout 2m bash -c " until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) left rate limit'; do sleep 1; journalctl --sync; done "
301+ timeout 2m journalctl -u init.scope --since=" $TS " -n all --follow | grep -m 1 -q -F ' (mount-monitor-dispatch) left rate limit'
301302fi
303+ set -o pipefail
302304
303305# Verify that the mount units are always cleaned up at the end.
304306# Give some time for units to settle so we don't race between exiting the rate limit state and cleaning up the units.
You can’t perform that action at this time.
0 commit comments