forked from fengguang/lkp-tests
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Philip Li <[email protected]>
- Loading branch information
Showing
6 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
short_description: > | ||
The kvm-unit-tests are a set of tests which can be used to verify virtualized CPUs | ||
(like KVM and others), emulated CPUs (like TCG from QEMU) or even real CPU behavior. | ||
This test suite with -qemu suffix won't use the qemu binary provided in | ||
distribution, but will clone official qemu git tree and build qemu from | ||
source code. | ||
homepage: https://gitlab.com/kvm-unit-tests/kvm-unit-tests | ||
|
||
parameters: | ||
qemu_branch: qemu/master | ||
qemu_commit: | ||
qemu_config: x86_64-softmmu | ||
|
||
results: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../kvm-unit-tests/parse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../kvm-unit-tests/pkg/PKGBUILD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../kvm-unit-tests/pkg/addon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
acpica-tools | ||
build-essential | ||
git | ||
info2man | ||
libaio-dev | ||
libasound2-dev | ||
libcap-dev | ||
libcap-ng-dev | ||
libfdt-dev | ||
libfdt1 | ||
libglib2.0-0 | ||
libglib2.0-dev | ||
libnfs-dev | ||
libpipewire-0.3-dev | ||
libpixman-1-0 | ||
libpixman-1-dev | ||
libpulse-dev | ||
libsdl1.2debian | ||
libsdl2-dev | ||
libseccomp-dev | ||
libslirp-dev | ||
libspice-protocol-dev | ||
libspice-server-dev | ||
liburing-dev | ||
libvdeplug-dev | ||
libxen-dev | ||
libxkbcommon-dev | ||
ninja-build | ||
pkg-config | ||
psmisc | ||
python-csvkit | ||
python-pip | ||
python-tomli | ||
python-venv | ||
virt-what | ||
zlib1g-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
. $LKP_SRC/lib/mount.sh | ||
. $LKP_SRC/lib/debug.sh | ||
. $LKP_SRC/lib/upload.sh | ||
. $LKP_SRC/lib/tests/kvm-unit-tests.sh | ||
. $LKP_SRC/lib/git.sh | ||
. $LKP_SRC/lib/misc-base.sh | ||
. $LKP_SRC/lib/reproduce-log.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. | ||
|
||
build_qemu() | ||
{ | ||
[ -n "$qemu_config" ] || die "can not find qemu_config" | ||
[ -n "$qemu_commit" ] || die "can not find qemu_commit" | ||
[ -n "$qemu_branch" ] || die "can not find qemu_branch" | ||
|
||
qemu_remote=${qemu_branch%%/*} | ||
|
||
git_clone_update --recursive https://gitlab.com/qemu-project/$qemu_remote.git "$QEMU_REPO_ROOT" 2>&1 || die "failed clone qemu tree $qemu_remote" | ||
|
||
cd "$QEMU_REPO_ROOT" || die "fail to enter $QEMU_REPO_ROOT" | ||
log_cmd git checkout -q $qemu_commit || die "failed to checkout qemu commit $qemu_commit" | ||
|
||
log_cmd ./configure --target-list="$qemu_config" --disable-docs || die "failed to run ./configure" | ||
|
||
unset LDFLAGS | ||
log_cmd make -j $nr_cpu 2>&1 || die "failed to make" | ||
|
||
$QEMU --help >/dev/null || die "QEMU Emulator can not work normally." | ||
} | ||
|
||
QEMU_REPO_ROOT="$BENCHMARK_ROOT/qemu" | ||
QEMU="$QEMU_REPO_ROOT/build/qemu-system-x86_64" | ||
|
||
build_qemu | ||
$QEMU --version | ||
|
||
cd $BENCHMARK_ROOT/kvm-unit-tests || die "no $BENCHMARK_ROOT/kvm-unit-tests" | ||
|
||
export QEMU | ||
|
||
fixup_tests | ||
setup_test_environment || die "failed to setup test environment" | ||
|
||
run_tests | ||
exit_code=$? | ||
|
||
upload_test_results | ||
|
||
[ $exit_code -ne 0 ] && dump_qemu | ||
|
||
exit $exit_code |