]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: add TEST_QEMU_ONLY variable to run only tests where qemu is mandatory
authorLuca Boccassi <bluca@debian.org>
Sat, 26 Dec 2020 20:11:55 +0000 (20:11 +0000)
committerLuca Boccassi <bluca@debian.org>
Fri, 1 Jan 2021 21:33:16 +0000 (21:33 +0000)
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.

test/README.testsuite
test/test-functions

index 5d9e498c51a0fb2b501a6edac65b8eccea15a357..45bd239f34763278ae3ad74305ed82a78fbb842f 100644 (file)
@@ -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
 
index 52331d78456b64e62c2f008199b433a860d6fec4..a88a8d2c042ef714a4b7c4ca4532dfaf9880f6de 100644 (file)
@@ -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