Browse Source

tests: Fix VM tests for Fedora

Binaries aren't always in /usr/bin/, plus kvm is sometimes 'qemu-kvm'.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Dan Williams 9 years ago
parent
commit
d7273180c6
2 changed files with 11 additions and 1 deletions
  1. 2 0
      tests/hwsim/vm/inside.sh
  2. 9 1
      tests/hwsim/vm/vm-run.sh

+ 2 - 0
tests/hwsim/vm/inside.sh

@@ -12,6 +12,8 @@ mount sysfs -t sysfs /sys
 # needed for tracing
 mount debugfs -t debugfs /sys/kernel/debug
 
+export PATH=/usr/sbin:$PATH
+
 # reboot on any sort of crash
 sysctl kernel.panic_on_oops=1
 sysctl kernel.panic=1

+ 9 - 1
tests/hwsim/vm/vm-run.sh

@@ -101,7 +101,15 @@ fi
 
 echo "Starting test run in a virtual machine"
 
-kvm \
+KVM=kvm
+for kvmprog in kvm qemu-kvm; do
+    if $kvmprog --version &> /dev/null; then
+	KVM=$kvmprog
+	break
+    fi
+done
+
+$KVM \
 	-kernel $KERNEL -smp 4 \
 	$KVMARGS -m $MEMORY -nographic \
 	-fsdev local,security_model=none,id=fsdev-root,path=/$ROTAG \