From 51fac37bb20c9440a9a4e0a20846c139364d6d13 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 25 Apr 2024 04:54:52 +0200 Subject: Adding upstream version 255.5. Signed-off-by: Daniel Baumann --- test/units/testsuite-04.journal.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'test/units/testsuite-04.journal.sh') 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" -- cgit v1.2.3