summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-11-17 21:41:05 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2015-11-17 23:47:23 +0000
commit45d39b4f81c6c92bfd9dd45c9d6ac0c68a477633 (patch)
tree956836e0b19072154bf7ed8644bad2e2433f2295
parent6f526243e6a638c2ea7bbdd07b963f57e110d120 (diff)
tests: journal-stdout-stream: add cases for leading and trailing spaces
-rwxr-xr-xtest/TEST-04-JOURNAL/test-journal.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/TEST-04-JOURNAL/test-journal.sh b/test/TEST-04-JOURNAL/test-journal.sh
index e5a3a71528..956e377100 100755
--- a/test/TEST-04-JOURNAL/test-journal.sh
+++ b/test/TEST-04-JOURNAL/test-journal.sh
@@ -21,5 +21,35 @@ journalctl --flush
journalctl -b -o cat -t "$ID" >/output
cmp /expected /output
+# Remove trailing spaces
+ID=$(journalctl --new-id128 | sed -n 2p)
+printf "Trailing spaces\n">/expected
+printf $'<5>Trailing spaces \t \n' | systemd-cat -t "$ID" --level-prefix true
+journalctl --flush
+journalctl -b -o cat -t "$ID" >/output
+cmp /expected /output
+
+ID=$(journalctl --new-id128 | sed -n 2p)
+printf "Trailing spaces\n">/expected
+printf $'Trailing spaces \t \n' | systemd-cat -t "$ID" --level-prefix false
+journalctl --flush
+journalctl -b -o cat -t "$ID" >/output
+cmp /expected /output
+
+# Don't remove leading spaces
+ID=$(journalctl --new-id128 | sed -n 2p)
+printf $' \t Leading spaces\n'>/expected
+printf $'<5> \t Leading spaces\n' | systemd-cat -t "$ID" --level-prefix true
+journalctl --flush
+journalctl -b -o cat -t "$ID" >/output
+cmp /expected /output
+
+ID=$(journalctl --new-id128 | sed -n 2p)
+printf $' \t Leading spaces\n'>/expected
+printf $' \t Leading spaces\n' | systemd-cat -t "$ID" --level-prefix false
+journalctl --flush
+journalctl -b -o cat -t "$ID" >/output
+cmp /expected /output
+
touch /testok
exit 0