summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xtests/extra/qemu-wrapper.sh18
-rwxr-xr-xtests/extra/test-with-upstream-qemu.sh21
3 files changed, 14 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index 3fd4e0a8..6e1480aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -397,6 +397,7 @@ Makefile.in
/tests/data/initrd-x86_64.img.gz
/tests/data/test-grep.txt.gz
/tests/data/test.iso
+/tests/extra/qemu-wrapper.sh
/tests/extra/valgrind.log
/tests/guests/debian.img
/tests/guests/fedora.img
diff --git a/tests/extra/qemu-wrapper.sh b/tests/extra/qemu-wrapper.sh
deleted file mode 100755
index bec2bc0b..00000000
--- a/tests/extra/qemu-wrapper.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/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 "$upstream_qemu" -L "$QEMUDIR/pc-bios" "$@"
diff --git a/tests/extra/test-with-upstream-qemu.sh b/tests/extra/test-with-upstream-qemu.sh
index 58036332..7c883288 100755
--- a/tests/extra/test-with-upstream-qemu.sh
+++ b/tests/extra/test-with-upstream-qemu.sh
@@ -23,7 +23,6 @@ if [ ! -d "$QEMUDIR" ]; then
exit 77
fi
-# Note that Makefile sets 'QEMU', so we cannot use that variable.
upstream_qemu="$QEMUDIR/x86_64-softmmu/qemu-system-x86_64"
if ! "$upstream_qemu" --help >/dev/null 2>&1; then
echo "$0: $upstream_qemu not executable, tests against upstream qemu skipped"
@@ -32,14 +31,20 @@ fi
"$upstream_qemu" --version
-LIBGUESTFS_QEMU=$abs_srcdir/qemu-wrapper.sh
-
-if [ ! -f "$LIBGUESTFS_QEMU" ]; then
- echo "$0: internal error: \$LIBGUESTFS_QEMU not a file"
- exit 1
-fi
+# Write a custom wrapper script for this invocation. (Since multiple
+# parallel 'make extra-tests' should not be running in the same
+# libguestfs directory, this should be safe).
+LIBGUESTFS_QEMU="$abs_srcdir/qemu-wrapper.sh"
+rm -f "$LIBGUESTFS_QEMU" "$LIBGUESTFS_QEMU"-t
+cat > "$LIBGUESTFS_QEMU"-t <<EOF
+#!/bin/sh -
+# Wrapper generated by '$0'.
+# Do not edit this file directly.
+exec "$upstream_qemu" -L "$QEMUDIR/pc-bios" "\$@"
+EOF
+chmod +x "$LIBGUESTFS_QEMU"-t
+mv "$LIBGUESTFS_QEMU"-t "$LIBGUESTFS_QEMU"
export LIBGUESTFS_QEMU
-export upstream_qemu
exec $MAKE extra-tests-non-recursive