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.
This commit is contained in:
Luca Boccassi 2020-12-31 17:29:58 +00:00
parent 51d56d3be0
commit eb3785f367
2 changed files with 7 additions and 0 deletions

View 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)

View 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