From: Luca Boccassi Date: Thu, 31 Dec 2020 17:29:58 +0000 (+0000) Subject: tests: add TEST_PREFER_NSPAWN variable to run as many as possible under nspawn X-Git-Tag: v248-rc1~433^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18088%2Fhead;p=thirdparty%2Fsystemd.git tests: add TEST_PREFER_NSPAWN variable to run as many as possible under nspawn By default the test suite prefers qemu, and uses nspawn only if a test specifically says it doesn't support qemu. Add a variable to allow flipping the default, and run as many tests under nspawn as possible. --- diff --git a/test/README.testsuite b/test/README.testsuite index 45bd239f347..5dd559e3651 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -53,6 +53,9 @@ TEST_QEMU_ONLY=1 TEST_NO_NSPAWN=1 Don't run tests under systemd-nspawn +TEST_PREFER_NSPAWN=1 + Run all tests that do not require qemu under systemd-nspawn + TEST_NO_KVM=1 Disable QEMU KVM auto-detection (may be necessary when you're trying to run the *vanilla* QEMU and have both qemu and qemu-kvm installed) diff --git a/test/test-functions b/test/test-functions index a88a8d2c042..06dea3c7bec 100644 --- a/test/test-functions +++ b/test/test-functions @@ -2117,6 +2117,10 @@ do_test() { exit 0 fi + if [ -n "$TEST_PREFER_NSPAWN" ] && [ -z "$TEST_NO_NSPAWN" ]; then + TEST_NO_QEMU=1 + fi + # Detect lib paths [[ $libdir ]] || for libdir in /lib64 /lib; do [[ -d $libdir ]] && libdirs+=" $libdir" && break