From: Frantisek Sumsal Date: Tue, 15 Jun 2021 06:34:41 +0000 (+0900) Subject: test: add a testcase for issue #19895 X-Git-Tag: v249-rc1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7848266dae240abe64aba1b1086ba8025ae50ad;p=thirdparty%2Fsystemd.git test: add a testcase for issue #19895 --- diff --git a/test/test-functions b/test/test-functions index aada33611c5..f9f9d6a9e6a 100644 --- a/test/test-functions +++ b/test/test-functions @@ -104,6 +104,7 @@ fi BASICTOOLS=( awk + base64 basename bash busybox diff --git a/test/units/testsuite-04.sh b/test/units/testsuite-04.sh index 7a17e086114..4f009b4c456 100755 --- a/test/units/testsuite-04.sh +++ b/test/units/testsuite-04.sh @@ -2,6 +2,21 @@ set -eux set -o pipefail +# Limit the maximum journal size +trap "journalctl --rotate --vacuum-size=16M" EXIT + +# Rotation/flush test, see https://github.com/systemd/systemd/issues/19895 +journalctl --relinquish-var +for i in {0..50}; do + dd if=/dev/urandom bs=1M count=1 | base64 | systemd-cat +done +journalctl --rotate +journalctl --flush +journalctl --sync + +# Reset the ratelimit buckets for the subsequent tests below. +systemctl restart systemd-journald + # Test stdout stream # Skip empty lines