summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2019-03-16 18:01:01 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2019-03-16 18:59:07 +0100
commitb43c2c01e979b8c9b5f2f70e8928a7e9d26ab11f (patch)
tree4393b6cc6f28fc5192845d6bd5b33ec081582988 /test
parentc81a46b90465e087c38bbaf7fc9d91855a057a93 (diff)
downloadsystemd-b43c2c01e979b8c9b5f2f70e8928a7e9d26ab11f.tar.gz
test: allow overriding of the KVM detection using TEST_NO_KVM
By default the run_qemu() function enables KVM automatically if it detects the /dev/kvm char device and if the machine is not already a KVM one. Let's add a TEST_NO_KVM env variable to suppress this detection.
Diffstat (limited to 'test')
-rw-r--r--test/test-functions4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test-functions b/test/test-functions
index 9eafd769cc..7179f70e46 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -60,7 +60,7 @@ function find_qemu_bin() {
# SUSE and Red Hat call the binary qemu-kvm. Debian and Gentoo call it kvm.
# Either way, only use this version if we aren't running in KVM, because
# nested KVM is flaky still.
- if [ `systemd-detect-virt -v` != kvm ] ; then
+ if [[ $(systemd-detect-virt -v) != kvm && -z $TEST_NO_KVM ]] ; then
[ "$QEMU_BIN" ] || QEMU_BIN=$(which -a kvm qemu-kvm 2>/dev/null | grep '^/' -m1)
fi
@@ -192,7 +192,7 @@ $KERNEL_APPEND \
fi
# Let's use KVM if it is available, but let's avoid using nested KVM as that is still flaky
- if [ -c /dev/kvm -a `systemd-detect-virt -v` != kvm ]; then
+ if [[ -c /dev/kvm && $(systemd-detect-virt -v) != kvm && -z $TEST_NO_KVM ]] ; then
QEMU_OPTIONS="$QEMU_OPTIONS -machine accel=kvm -enable-kvm -cpu host"
fi