diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-07-07 16:19:55 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-07-09 22:25:53 +0100 |
commit | 7a02adeee653eacbca92bc11e94b685cc1e33a62 (patch) | |
tree | 1efbff2db1cd3ea78acfeed1de6906e5c8c0e930 | |
parent | 9c2a534a000d662889980f686dcb7fd49ad78ecc (diff) | |
download | libguestfs-7a02adeee653eacbca92bc11e94b685cc1e33a62.tar.gz libguestfs-7a02adeee653eacbca92bc11e94b685cc1e33a62.tar.xz libguestfs-7a02adeee653eacbca92bc11e94b685cc1e33a62.zip |
extra-tests: Add a test using upstream qemu.
(cherry picked from commit e6dec159488f589df62c9f59477281f8264a19c8)
-rw-r--r-- | tests/extra/Makefile.am | 19 | ||||
-rwxr-xr-x | tests/extra/test-upstream-qemu-wrapper.sh | 18 | ||||
-rwxr-xr-x | tests/extra/test-upstream-qemu.sh | 39 |
3 files changed, 75 insertions, 1 deletions
diff --git a/tests/extra/Makefile.am b/tests/extra/Makefile.am index c8ffd20e..0ccda105 100644 --- a/tests/extra/Makefile.am +++ b/tests/extra/Makefile.am @@ -23,6 +23,7 @@ # (tip: add yourself to the 'disk' group) # - valgrind # - libtool +# - qemu in $QEMUDIR # # These tests may fail for reasons which aren't necessarily real problems. # @@ -90,7 +91,8 @@ extra-tests: \ test-inspector-real \ test-ocaml \ test-resize \ - test-sparsify + test-sparsify \ + test-upstream-qemu test-guests: $(MAKE) -C ../guests check @@ -173,3 +175,18 @@ test-c-api: # Test OCaml bindings under valgrind. test-ocaml: $(MAKE) -C ../../ocaml VG="$(VG)" check + +# When running the extra tests, if directory $HOME/d/qemu exists then +# we will try to run the basic tests using the version of qemu from +# that directory. eg. That might be qemu from git. +# +# The directory name can be overridden using: +# make extra-tests QEMUDIR=/path/to/other/qemu + +QEMUDIR = $(HOME)/d/qemu +export QEMUDIR +export abs_srcdir +export MAKE + +test-upstream-qemu: + ./test-upstream-qemu.sh diff --git a/tests/extra/test-upstream-qemu-wrapper.sh b/tests/extra/test-upstream-qemu-wrapper.sh new file mode 100755 index 00000000..ab9787e1 --- /dev/null +++ b/tests/extra/test-upstream-qemu-wrapper.sh @@ -0,0 +1,18 @@ +#!/bin/sh - +# Copyright (C) 2012 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +exec "$QEMU" -L "$QEMUDIR/pc-bios" "$@" diff --git a/tests/extra/test-upstream-qemu.sh b/tests/extra/test-upstream-qemu.sh new file mode 100755 index 00000000..eb226805 --- /dev/null +++ b/tests/extra/test-upstream-qemu.sh @@ -0,0 +1,39 @@ +#!/bin/sh - +# Copyright (C) 2012 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +set -e +#set -x + +if [ ! -d "$QEMUDIR" ]; then + echo "$0: \$QEMUDIR not a directory, tests against upstream qemu skipped" + exit 0 +fi + +QEMU="$QEMUDIR/x86_64-softmmu/qemu-system-x86_64" +if ! "$QEMU" --help >/dev/null 2>&1; then + echo "$0: $QEMU not executable, tests against upstream qemu skipped" + exit 0 +fi + +"$QEMU" --version + +LIBGUESTFS_QEMU=$abs_srcdir/test-upstream-qemu-wrapper.sh +export LIBGUESTFS_QEMU +export QEMU + +$MAKE -C ../.. quickcheck +$MAKE -C ../c-api check |