mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
cf9844ffab
The test appears to be occasionally failing. It uses systemd-run to echo 'hello world' into a namespaced journal and then uses journalctl to look for it, but it doesn't wait. In the failed runs it can't find it, but the automated journal dump shows the message at the end. Use --wait to avoid races.
20 lines
436 B
Bash
Executable File
20 lines
436 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eux
|
|
|
|
systemd-analyze log-level debug
|
|
|
|
systemd-run --wait -p LogNamespace=foobar echo "hello world"
|
|
|
|
journalctl --namespace=foobar --sync
|
|
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 && { echo 'unexpected success'; exit 1; }
|
|
|
|
systemd-analyze log-level info
|
|
|
|
echo OK >/testok
|
|
|
|
exit 0
|