]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: Rework TEST-02-UNITTESTS
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 20 Apr 2024 19:13:18 +0000 (21:13 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 22 Apr 2024 17:37:13 +0000 (19:37 +0200)
commit741d59b326ea25053097fcbf004864ea6b3c6299
tree78a90c24e2241e45b53b8fa42bb65a9fbe2edb2c
parente660fee2d0a76c6ae63e6a5853f40744f3015284
test: Rework TEST-02-UNITTESTS

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.
test/units/end.sh
test/units/testsuite-02.sh