]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: add TEST_PREFER_NSPAWN variable to run as many as possible under nspawn 18088/head
authorLuca Boccassi <bluca@debian.org>
Thu, 31 Dec 2020 17:29:58 +0000 (17:29 +0000)
committerLuca Boccassi <bluca@debian.org>
Fri, 1 Jan 2021 21:33:16 +0000 (21:33 +0000)
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.

test/README.testsuite
test/test-functions

index 45bd239f34763278ae3ad74305ed82a78fbb842f..5dd559e365126c8f8a49090c3b147d036f8e073d 100644 (file)
@@ -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)
index a88a8d2c042ef714a4b7c4ca4532dfaf9880f6de..06dea3c7beca68cccfa64208b9f322c1faa046b2 100644 (file)
@@ -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