4 TEST_DESCRIPTION
="Run unit tests under containers"
5 RUN_IN_UNPRIVILEGED_CONTAINER
=yes
7 # embed some newlines in the kernel command line to stress our test suite
15 # shellcheck source=test/test-functions
16 .
"${TEST_BASE_DIR:?}/test-functions"
18 check_result_nspawn
() {
19 local workspace
="${1:?}"
22 [[ -e "$workspace/testok" ]] && ret
=0
24 if [[ -s "$workspace/failed" ]]; then
26 echo "=== Failed test log ==="
27 cat "$workspace/failed"
29 if [[ -s "$workspace/skipped" ]]; then
30 echo "=== Skipped test log =="
31 cat "$workspace/skipped"
33 if [[ -s "$workspace/testok" ]]; then
34 echo "=== Passed tests ==="
35 cat "$workspace/testok"
39 save_journal
"$workspace/var/log/journal"
40 _umount_dir
"${initdir:?}"
42 [[ -n "${TIMED_OUT:=}" ]] && ret
=1
50 [[ -e "${initdir:?}/testok" ]] && ret
=0
52 if [[ -s "$initdir/failed" ]]; then
54 echo "=== Failed test log ==="
57 if [[ -s "$initdir/skipped" ]]; then
58 echo "=== Skipped test log =="
59 cat "$initdir/skipped"
61 if [[ -s "$initdir/testok" ]]; then
62 echo "=== Passed tests ==="
67 save_journal
"$initdir/var/log/journal"
68 _umount_dir
"$initdir"
70 [[ -n "${TIMED_OUT:=}" ]] && ret
=1