]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add a testcase for issue #19895
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 15 Jun 2021 06:34:41 +0000 (15:34 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 15 Jun 2021 22:18:06 +0000 (23:18 +0100)
test/test-functions
test/units/testsuite-04.sh

index aada33611c50166875e43d0d9ad87661070adb6a..f9f9d6a9e6ad25e392683a4e46408fa420b35e98 100644 (file)
@@ -104,6 +104,7 @@ fi
 
 BASICTOOLS=(
     awk
+    base64
     basename
     bash
     busybox
index 7a17e086114d441bcc79ddac2242b05c396b7595..4f009b4c45617488c75ad2c11e6719e94d0c8713 100755 (executable)
@@ -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