2 # SPDX-License-Identifier: LGPL-2.1-or-later
5 # shellcheck source=test/test-functions
6 .
"${TEST_BASE_DIR:?}/test-functions"
8 TEST_DESCRIPTION
="Run unit tests under containers"
9 RUN_IN_UNPRIVILEGED_CONTAINER
=yes
10 # Some tests make collecting coverage impossible (like test-mount-util, which
11 # remounts the whole / as read-only), so let's ignore the gcov errors in such
13 IGNORE_MISSING_COVERAGE
=yes
15 # Embed some newlines in the kernel command line to stress our test suite
16 # Also, pass $TEST_PREFER_NSPAWN to the VM/container if set
18 # shellcheck disable=SC2015
20 $(get_bool "${TEST_PREFER_NSPAWN:-0}" && echo "systemd.setenv
=TEST_PREFER_NSPAWN
=1" || :)
24 systemd.setenv=TEST_CMDLINE_NEWLINE=foo
25 systemd.setenv=TEST_CMDLINE_NEWLINE=bar
29 # Override $TEST_PREFER_NSPAWN if it was set to always run both the QEMU and
30 # the nspawn part of the test
34 if get_bool
"$LOOKS_LIKE_SUSE"; then
35 dinfo
"Install the unit test binaries needed by the TEST-02-UNITTESTS at runtime"
36 inst_recursive
"${SOURCE_DIR}/unit-tests"