diff options
Diffstat (limited to '')
-rwxr-xr-x | test/units/testsuite-04.journal.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/units/testsuite-04.journal.sh b/test/units/testsuite-04.journal.sh index c19cd12..3b72aa4 100755 --- a/test/units/testsuite-04.journal.sh +++ b/test/units/testsuite-04.journal.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash # SPDX-License-Identifier: LGPL-2.1-or-later +# shellcheck disable=SC2317 set -eux set -o pipefail -# This fails due to https://github.com/systemd/systemd/issues/30886 -# but it is too complex and risky to backport, so disable the test -exit 0 - # Rotation/flush test, see https://github.com/systemd/systemd/issues/19895 journalctl --relinquish-var [[ "$(systemd-detect-virt -v)" == "qemu" ]] && ITERATIONS=10 || ITERATIONS=50 @@ -246,6 +243,9 @@ diff -u /tmp/lb1 - <<'EOF' EOF rm -rf "$JOURNAL_DIR" /tmp/lb1 +# v255-only: skip the following test case, as it suffers from systemd/systemd#30886 +exit 0 + # Check that using --after-cursor/--cursor-file= together with journal filters doesn't # skip over entries matched by the filter # See: https://github.com/systemd/systemd/issues/30288 @@ -269,3 +269,11 @@ hello world EOF rm -f "$CURSOR_FILE" + +# Check that --until works with --after-cursor and --lines/-n +# See: https://github.com/systemd/systemd/issues/31776 +CURSOR_FILE="$(mktemp)" +journalctl -q -n 0 --cursor-file="$CURSOR_FILE" +TIMESTAMP="$(journalctl -q -n 1 --cursor="$(<"$CURSOR_FILE")" --output=short-unix | cut -d ' ' -f 1 | cut -d '.' -f 1)" +[[ -z "$(journalctl -q -n 10 --after-cursor="$(<"$CURSOR_FILE")" --until "@$((TIMESTAMP - 3))")" ]] +rm -f "$CURSOR_FILE" |