]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-44: fix test
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Apr 2021 07:47:04 +0000 (09:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Apr 2021 18:21:50 +0000 (20:21 +0200)
We were grepping for 'hello world', and in the namespace we would
match on 'hello world', and outside, on 'echo "hello world"'. When
the condition check was fixed, the test gave a false positive.

test/units/testsuite-44.sh

index 78022cb545b419b506e9114b25c3715b93a5f6b3..0badb7112591ec322c92349280fce5814e3df789 100755 (executable)
@@ -6,11 +6,11 @@ systemd-analyze log-level debug
 systemd-run -p LogNamespace=foobar echo "hello world"
 
 journalctl --namespace=foobar --sync
-journalctl --namespace=foobar >/tmp/hello-world
-journalctl >/tmp/no-hello-world
+journalctl -o cat --namespace=foobar >/tmp/hello-world
+journalctl -o cat >/tmp/no-hello-world
 
-grep "hello world" /tmp/hello-world
-! grep "hello world" /tmp/no-hello-world
+grep "^hello world$" /tmp/hello-world
+grep "^hello world$" /tmp/no-hello-world && { echo 'unexpected success'; exit 1; }
 
 systemd-analyze log-level info