From bf995423fd6a1614916036d678b2c49385712cb7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 20 Mar 2024 06:22:17 +0900 Subject: [PATCH] test: add test case for issue #31776 --- test/units/testsuite-04.journal.sh | 8 ++++++++ 1 file changed, 8 insertions(+) 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" -- 2.47.3