summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/extra/Makefile.am19
-rwxr-xr-xtests/extra/test-upstream-qemu-wrapper.sh18
-rwxr-xr-xtests/extra/test-upstream-qemu.sh39
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