# Pastebin kg4wlBTJ commit 42f821b3e8250e1a0b3206fbebc8a464e0abd15b (HEAD -> tweak/journal) Author: Zygmunt Krynicki Date: Fri Aug 9 09:20:14 2019 +0200 tests: don't repeat checks diff --git a/tests/lib/journalctl.sh b/tests/lib/journalctl.sh index 363d6c288..df590a05d 100644 --- a/tests/lib/journalctl.sh +++ b/tests/lib/journalctl.sh @@ -33,23 +33,15 @@ check_journalctl_ready(){ } check_journalctl_log(){ - expression=$1 + expression="$1" shift - for _ in $(seq 10); do - log=$(get_journalctl_log "$@") - if echo "$log" | grep -q -E "$expression"; then - return 0 - fi - echo "Match for \"$expression\" failed, retrying" - sleep 1 - done - return 1 + get_journalctl_log "$@" | grep -q -E "$expression" } get_journalctl_log(){ cursor="" if [ -f "$JOURNALCTL_CURSOR_FILE" ]; then - cursor=$(tail -n1 "$JOURNALCTL_CURSOR_FILE") + cursor="$(tail -n1 "$JOURNALCTL_CURSOR_FILE")" fi journalctl --flush || true journalctl --sync || true