summaryrefslogtreecommitdiff
path: root/test/TEST-04-JOURNAL
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-12-30 03:33:43 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-12-30 05:00:14 +0000
commit3889613ec6bc54b9e02955f62b9d5c5b571c3d4b (patch)
treeec529a3659fa618257f7dc2ecbe62e8cca12c3bd /test/TEST-04-JOURNAL
parent7f0c9af9188fdb53cbf963344d3c92aa7f8864ca (diff)
tests: add regression test for `systemctl restart systemd-journald`
See https://github.com/systemd/systemd/issues/2236
Diffstat (limited to 'test/TEST-04-JOURNAL')
-rwxr-xr-xtest/TEST-04-JOURNAL/test-journal.sh8
-rwxr-xr-xtest/TEST-04-JOURNAL/test.sh9
2 files changed, 17 insertions, 0 deletions
diff --git a/test/TEST-04-JOURNAL/test-journal.sh b/test/TEST-04-JOURNAL/test-journal.sh
index 1ee39df432..3a05619ad5 100755
--- a/test/TEST-04-JOURNAL/test-journal.sh
+++ b/test/TEST-04-JOURNAL/test-journal.sh
@@ -51,5 +51,13 @@ journalctl --sync
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
diff --git a/test/TEST-04-JOURNAL/test.sh b/test/TEST-04-JOURNAL/test.sh
index 6c5b5cf34e..1a14f76060 100755
--- a/test/TEST-04-JOURNAL/test.sh
+++ b/test/TEST-04-JOURNAL/test.sh
@@ -57,6 +57,15 @@ 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/
setup_testsuite