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-07 16:19:55 +0100 |
commit | e6dec159488f589df62c9f59477281f8264a19c8 (patch) | |
tree | 8847b8ae4338506cc2f2616cd4ab155a66d277d6 /tests | |
parent | 6e5a85bb9b6557bc337625a339728e23f5f2dd94 (diff) | |
download | libguestfs-e6dec159488f589df62c9f59477281f8264a19c8.tar.gz libguestfs-e6dec159488f589df62c9f59477281f8264a19c8.tar.xz libguestfs-e6dec159488f589df62c9f59477281f8264a19c8.zip |
extra-tests: Add a test using upstream qemu.
Diffstat (limited to 'tests')
-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 4e56aedc..bd34d9a1 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. # @@ -88,7 +89,8 @@ extra-tests: \ test-sysprep-real \ test-ocaml \ test-resize \ - test-sparsify + test-sparsify \ + test-upstream-qemu test-guests: $(MAKE) -C ../guests check @@ -184,3 +186,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 |