mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-21 14:50:12 +03:00
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. (cherry picked from commit cf9844ffabd7fd51f22e729692b79d55cd7bdd76) (cherry picked from commit 2c17e13ae48b94a0fd02c7746d723b26a0f3dc65) (cherry picked from commit bed66a8d19566adf94386482fe5ee0216b66f848)
20 lines
380 B
Bash
Executable File
20 lines
380 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
|
|
systemd-analyze log-level debug
|
|
|
|
systemd-run --wait -p LogNamespace=foobar echo "hello world"
|
|
|
|
journalctl --namespace=foobar --sync
|
|
journalctl --namespace=foobar > /tmp/hello-world
|
|
journalctl > /tmp/no-hello-world
|
|
|
|
grep "hello world" /tmp/hello-world
|
|
! grep "hello world" /tmp/no-hello-world
|
|
|
|
systemd-analyze log-level info
|
|
|
|
echo OK > /testok
|
|
|
|
exit 0
|