]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add test case for issue #31776 31861/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Mar 2024 21:22:17 +0000 (06:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Mar 2024 19:44:39 +0000 (04:44 +0900)
test/units/testsuite-04.journal.sh

index 2c0c50f5b83efbc7d33e1e8ad5506cb5804afb33..40ae39557beb4a6a0bbe3e05bf2d5cb67e0ec9cf 100755 (executable)
@@ -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"