From: Luca Boccassi Date: Sat, 26 Dec 2020 20:11:55 +0000 (+0000) Subject: tests: add TEST_QEMU_ONLY variable to run only tests where qemu is mandatory X-Git-Tag: v248-rc1~433^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51d56d3be07953d0cf090f3311a81f1d3ada1dcf;p=thirdparty%2Fsystemd.git tests: add TEST_QEMU_ONLY variable to run only tests where qemu is mandatory Allows to split the test run in two parts. Most tests can run under nspawn which is much faster, and they can be ran in one chunk with TEST_NO_QEMU=1. The qemu-only tests, which are just a handful, can be ran in another chunk with TEST_QEMU_ONLY=1. Allows autopkgtest to be split in two parts. --- diff --git a/test/README.testsuite b/test/README.testsuite index 5d9e498c51a..45bd239f347 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -47,6 +47,9 @@ Configuration variables TEST_NO_QEMU=1 Don't run tests under QEMU +TEST_QEMU_ONLY=1 + Run only tests that require QEMU + TEST_NO_NSPAWN=1 Don't run tests under systemd-nspawn diff --git a/test/test-functions b/test/test-functions index 52331d78456..a88a8d2c042 100644 --- a/test/test-functions +++ b/test/test-functions @@ -2112,6 +2112,11 @@ do_test() { exit 0 fi + if [ -n "$TEST_QEMU_ONLY" ] && [ -z "$TEST_NO_NSPAWN" ]; then + echo "TEST: $TEST_DESCRIPTION [SKIPPED]: QEMU-only tests requested" >&2 + exit 0 + fi + # Detect lib paths [[ $libdir ]] || for libdir in /lib64 /lib; do [[ -d $libdir ]] && libdirs+=" $libdir" && break