mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
tests: add regression test for systemctl restart systemd-journald
See https://github.com/systemd/systemd/issues/2236
This commit is contained in:
parent
7f0c9af918
commit
3889613ec6
|
@ -51,5 +51,13 @@ journalctl --sync
|
||||||
journalctl -b -o cat -t "$ID" >/output
|
journalctl -b -o cat -t "$ID" >/output
|
||||||
cmp /expected /output
|
cmp /expected /output
|
||||||
|
|
||||||
|
# Don't lose streams on restart
|
||||||
|
systemctl start forever-print-hola
|
||||||
|
sleep 3
|
||||||
|
systemctl restart systemd-journald
|
||||||
|
sleep 3
|
||||||
|
systemctl stop forever-print-hola
|
||||||
|
[[ ! -f "/i-lose-my-logs" ]]
|
||||||
|
|
||||||
touch /testok
|
touch /testok
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -55,6 +55,15 @@ After=multi-user.target
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/test-journal.sh
|
ExecStart=/test-journal.sh
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >$initdir/etc/systemd/system/forever-print-hola.service <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=ForeverPrintHola service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/bin/sh -x -c 'while :; do printf "Hola\n" || touch /i-lose-my-logs; sleep 1; done'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cp test-journal.sh $initdir/
|
cp test-journal.sh $initdir/
|
||||||
|
|
Loading…
Reference in a new issue