Skip to content

Commit

Permalink
tests: add regression test for systemctl restart systemd-journald
Browse files Browse the repository at this point in the history
See systemd/systemd#2236

(cherry picked from commit 3889613)
(cherry picked from commit 4dc893c)
(cherry picked from commit 5c1904d)
Related: #1798161
  • Loading branch information
evverx authored and Jan Synacek committed Feb 11, 2020
1 parent f38d68f commit 973c579
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/TEST-04-JOURNAL/test-journal.sh
Expand Up @@ -14,5 +14,13 @@ journalctl --flush
journalctl -b -o cat -t "$ID" >/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
exit 0
9 changes: 9 additions & 0 deletions test/TEST-04-JOURNAL/test.sh
Expand Up @@ -55,6 +55,15 @@ After=multi-user.target
[Service]
ExecStart=/test-journal.sh
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

cp test-journal.sh $initdir/
Expand Down

0 comments on commit 973c579

Please sign in to comment.