From: Benjamin Robin Date: Sat, 9 May 2020 10:01:07 +0000 (+0200) Subject: test: Stricter test case for #15654 (Add more checks) X-Git-Tag: v246-rc1~375^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d38b3b74dbde2d65b23e5963354c3db96acd3420;p=thirdparty%2Fsystemd.git test: Stricter test case for #15654 (Add more checks) Check: - There is only 3 messages logged with type stdout - Check all messages logged does not have new line: LINE_BREAK=eof - Check that the 3 messages are logged from a different PID - Check the 3 MESSAGE= content --- diff --git a/test/units/testsuite-04.sh b/test/units/testsuite-04.sh index df216a06a3f..3dce73b7782 100755 --- a/test/units/testsuite-04.sh +++ b/test/units/testsuite-04.sh @@ -94,6 +94,10 @@ systemd-cat -t "$ID" /bin/sh -c 'env echo -n "This will";echo;env echo -n "usual journalctl --sync journalctl -b -o cat -t "$ID" >/output cmp /expected /output +[[ $(journalctl -b -o cat -t "$ID" --output-fields=_TRANSPORT | grep -Pc "^stdout$") -eq 3 ]] +[[ $(journalctl -b -o cat -t "$ID" --output-fields=_LINE_BREAK | grep -Pc "^pid-change$") -eq 3 ]] +[[ $(journalctl -b -o cat -t "$ID" --output-fields=_PID | sort -u | grep -c "^.*$") -eq 3 ]] +[[ $(journalctl -b -o cat -t "$ID" --output-fields=MESSAGE | grep -Pc "^(This will|usually fail|and be truncated)$") -eq 3 ]] # Add new tests before here, the journald restarts below # may make tests flappy.