summaryrefslogtreecommitdiff
path: root/test/TEST-04-JOURNAL/test-journal.sh
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-11-17 11:21:23 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-11-17 23:46:31 +0000
commit1c36b4a73b876258fbe01fbe9bc9b750b7dcc9ce (patch)
tree25d938e834ce198d3ae9fdf043ea98421bee2b95 /test/TEST-04-JOURNAL/test-journal.sh
parent92939fc4c0261dccd4b755186aba84a9b1412bed (diff)
tests: add basic journal test
Diffstat (limited to 'test/TEST-04-JOURNAL/test-journal.sh')
-rwxr-xr-xtest/TEST-04-JOURNAL/test-journal.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/TEST-04-JOURNAL/test-journal.sh b/test/TEST-04-JOURNAL/test-journal.sh
new file mode 100755
index 0000000000..e5a3a71528
--- /dev/null
+++ b/test/TEST-04-JOURNAL/test-journal.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -x
+set -e
+set -o pipefail
+
+# Test stdout stream
+
+# Skip empty lines
+ID=$(journalctl --new-id128 | sed -n 2p)
+>/expected
+printf $'\n\n\n' | systemd-cat -t "$ID" --level-prefix false
+journalctl --flush
+journalctl -b -o cat -t "$ID" >/output
+cmp /expected /output
+
+ID=$(journalctl --new-id128 | sed -n 2p)
+>/expected
+printf $'<5>\n<6>\n<7>\n' | systemd-cat -t "$ID" --level-prefix true
+journalctl --flush
+journalctl -b -o cat -t "$ID" >/output
+cmp /expected /output
+
+touch /testok
+exit 0