summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordana <dana@dana.is>2019-03-06 19:20:06 -0600
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-19 10:48:26 +0100
commit4890482531a4c36d0f0fa37a3734fd809d95f305 (patch)
treee73910212a84066c94f75299c79c04fb9f05b15f /test
parentb5587fa99490981da68ceab5bc2d376b47400bee (diff)
downloadsystemd-4890482531a4c36d0f0fa37a3734fd809d95f305.tar.gz
journalctl: support `-b all` to negate effect of -b
Also fix an issue where -b without argument didn't always behave as -b0
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-04-JOURNAL/test-journal.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/TEST-04-JOURNAL/test-journal.sh b/test/TEST-04-JOURNAL/test-journal.sh
index 260cae09ab..e198cb6ede 100755
--- a/test/TEST-04-JOURNAL/test-journal.sh
+++ b/test/TEST-04-JOURNAL/test-journal.sh
@@ -63,6 +63,18 @@ grep -q '^PRIORITY=6$' /output
! grep -q '^FOO=' /output
! grep -q '^SYSLOG_FACILITY=' /output
+# `-b all` negates earlier use of -b (-b and -m are otherwise exclusive)
+journalctl -b -1 -b all -m > /dev/null
+
+# -b always behaves like -b0
+journalctl -q -b-1 -b0 | head -1 > /expected
+journalctl -q -b-1 -b | head -1 > /output
+cmp /expected /output
+# ... even when another option follows (both of these should fail due to -m)
+{ journalctl -ball -b0 -m 2>&1 || :; } | head -1 > /expected
+{ journalctl -ball -b -m 2>&1 || :; } | head -1 > /output
+cmp /expected /output
+
# Don't lose streams on restart
systemctl start forever-print-hola
sleep 3