blob: 0baed317d95f96e4de5eac881d3b749973b2afb4 [file]
#!/bin/sh
## Tests for x86 architecture are run as kernel images for qemu
## that supports multiboot format. Tests uses an infrastructure
## called from the bios code. The infrastructure initialize the
## system/cpu's, switch to long-mode and calls the 'main' function
## of the individual test. Tests uses a qemu's virtual test device,
## named testdev, for services like printing, exiting, query memory size etc.
. $LKP_SRC/lib/debug.sh
. $LKP_SRC/lib/upload.sh
. $LKP_SRC/lib/tests/kvm-unit-tests.sh
cd $BENCHMARK_ROOT/kvm-unit-tests || exit
# Debian/Fedora/Ubuntu use /usr/bin/qemu-system-x86_64 as QEMU Emulator.
# RHEL use /usr/libexec/qemu-kvm as QEMU Emulator.
if qemu-system-x86_64 --help >/dev/null 2>&1; then
export QEMU="$(which qemu-system-x86_64)"
else
if [ -f "/usr/libexec/qemu-kvm" ]; then
export QEMU="/usr/libexec/qemu-kvm"
else
echo "Can not find QEMU Emulator" >&2
exit 1
fi
fi
setup_test_environment || die "failed to setup test environment"
check_ignored_cases
run_tests
exit_code=$?
upload_test_results
[ $exit_code -ne 0 ] && dump_qemu
exit $exit_code