mirror of
https://github.com/systemd/systemd.git
synced 2025-01-23 02:04:32 +03:00
741d59b326
Currently, A large amount of unit test output is logged directly to the console instead of to the per test log file as any subprocesses executed by a test manager will detect that stderr is not connected to the journal and log directly to /dev/console instead. To solve this issue, let's make sure all tests are connected directly to the journal by running them with systemd-run. We also simplify the entire test script by getting rid of the custom queue and replicating it with xargs instead. By using bash's function export feature, we can make our run_test() function available to the bash subprocess spawned by xargs. Once a test is finished, we read its logs from the journal and put them in the appropriate file if needed.
18 lines
716 B
Bash
Executable File
18 lines
716 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
set -eux
|
|
set -o pipefail
|
|
|
|
(! journalctl -q -o short-monotonic --grep "didn't pass validation" | grep -v "test-varlink-idl" >>/failed)
|
|
|
|
# Here, the redundant '[ ]' in the pattern is required in order not to match the logged command itself.
|
|
(! journalctl -q -o short-monotonic --grep 'Warning: cannot close sd-bus connection[ ].*after fork' >>/failed)
|
|
|
|
# Check if sd-executor doesn't complain about not being able to (de)serialize stuff
|
|
(! journalctl -q -o short-monotonic --grep "[F]ailed to parse serialized line" >>/failed)
|
|
(! journalctl -q -o short-monotonic --grep "[F]ailed to (de)?serialize \w+" >>/failed)
|
|
|
|
systemctl poweroff --no-block
|
|
exit 0
|