From: Yu Watanabe Date: Tue, 19 Mar 2024 21:22:17 +0000 (+0900) Subject: test: add test case for issue #31776 X-Git-Tag: v256-rc1~456^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf995423fd6a1614916036d678b2c49385712cb7;p=thirdparty%2Fsystemd.git test: add test case for issue #31776 --- diff --git a/test/units/testsuite-04.journal.sh b/test/units/testsuite-04.journal.sh index 2c0c50f5b83..40ae39557be 100755 --- a/test/units/testsuite-04.journal.sh +++ b/test/units/testsuite-04.journal.sh @@ -275,3 +275,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"