]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make the stress test slightly less stressful on slower machines
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 19 May 2023 08:48:15 +0000 (10:48 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 19 May 2023 08:48:15 +0000 (10:48 +0200)
Without acceleration this part of the test takes over 10 minutes (!),
which feels quite unnecessary. Let's cut down the number of stuff we
dump to the journal in such case, but keep the original value if we run
with acceleration (since in that case it takes less than 10 seconds).

test/units/testsuite-04.sh

index 7c1565bf15b9c3e40c6dfa9bfcca169a6940d6bd..3c4c8afd53888bd9f51bdace2f4450d9b63b77d1 100755 (executable)
@@ -8,7 +8,8 @@ trap "journalctl --rotate --vacuum-size=16M" EXIT
 
 # Rotation/flush test, see https://github.com/systemd/systemd/issues/19895
 journalctl --relinquish-var
-for _ in {0..50}; do
+[[ "$(systemd-detect-virt -v)" == "qemu" ]] && ITERATIONS=10 || ITERATIONS=50
+for ((i = 0; i < ITERATIONS; i++)); do
     dd if=/dev/urandom bs=1M count=1 | base64 | systemd-cat
 done
 journalctl --rotate