mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
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
This commit is contained in:
parent
c11d8fd1da
commit
d38b3b74db
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user