build: Set TMPDIR for local testing.
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 8 Aug 2011 11:41:54 +0000 (12:41 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 8 Aug 2011 11:41:54 +0000 (12:41 +0100)
This avoids conflicts with the globally installed libguestfs
appliance, or lets us build in multiple local directories at the same
time without conflicts.

18 files changed:
.gitignore
capitests/Makefile.am
cat/Makefile.am
caution/Makefile.am
df/Makefile.am
edit/Makefile.am
fuse/test-fuse.sh
haskell/Makefile.am
images/Makefile.am
java/Makefile.am
ocaml/Makefile.am
perl/Makefile.am
python/Makefile.am
regressions/Makefile.am
resize/Makefile.am
ruby/Makefile.am
run
tools/Makefile.am

index ab12867..fb04086 100644 (file)
@@ -338,3 +338,4 @@ tools/virt-*.pl
 /build-aux
 /gnulib
 .git-module-status
+.guestfs-*
index 7e35872..9802a06 100644 (file)
@@ -57,6 +57,7 @@ TESTS_ENVIRONMENT = \
        SKIP_TEST_COMMAND=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
        SKIP_TEST_COMMAND_LINES=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir) \
        $(VG)
 
 #SKIP_TEST_CHECKSUM_8=$(shell if test `find ../initramfs -name squashfs.ko | wc -l` -eq 0; then echo 1; fi)
index bf1d57c..6022cd6 100644 (file)
@@ -133,6 +133,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
 TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 TESTS = test-virt-cat.sh test-virt-filesystems.sh test-virt-ls.sh
index f87884f..5b31d80 100644 (file)
@@ -30,7 +30,8 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
 TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 EXTRA_DIST = \
        $(TESTS)
index 1711798..88e32af 100644 (file)
@@ -79,6 +79,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
 TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 TESTS = test-virt-df.sh
index 62b5376..e33b33c 100644 (file)
@@ -71,6 +71,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
 TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 TESTS = test-virt-edit.sh
index 0a429f7..cfa277a 100755 (executable)
@@ -31,6 +31,10 @@ nr_stages=$(grep "^stage " $0 | wc -l)
 # and move to that directory for the initial phase of the script.
 top_builddir=$(cd "$top_builddir" > /dev/null; pwd)
 
+# Set TMPDIR so the appliance doesn't conflict with globally
+# installed libguestfs.
+export TMPDIR=$top_builddir
+
 # Set libguestfs up for running locally.
 export LIBGUESTFS_PATH="$top_builddir/appliance"
 
index 4406712..d8a06f3 100644 (file)
@@ -30,6 +30,7 @@ if HAVE_HASKELL
 TESTS_ENVIRONMENT = \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir) \
        $(VG)
 
 TESTS = run-bindtests Guestfs005Load Guestfs010Basic
index 622d288..68eb550 100644 (file)
@@ -173,8 +173,9 @@ $(builddir)/test-grep.txt.gz: test-grep.txt
 fedora.img: guest-aux/make-fedora-img.sh \
                guest-aux/fedora-name.db \
                guest-aux/fedora-packages.db
-       LIBGUESTFS_PATH=../appliance \
-       LD_LIBRARY_PATH=../src/.libs \
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+       TMPDIR=$(top_builddir) \
        bash $<
 
 guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
@@ -189,21 +190,24 @@ guest-aux/fedora-packages.db: guest-aux/fedora-packages.db.txt
 
 # Make a (dummy) Debian image.
 debian.img: guest-aux/make-debian-img.sh
-       LIBGUESTFS_PATH=../appliance \
-       LD_LIBRARY_PATH=../src/.libs \
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+       TMPDIR=$(top_builddir) \
        bash $<
 
 # Make a (dummy) Ubuntu image.
 ubuntu.img: guest-aux/make-ubuntu-img.sh
-       LIBGUESTFS_PATH=../appliance \
-       LD_LIBRARY_PATH=../src/.libs \
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+       TMPDIR=$(top_builddir) \
        bash $<
 
 # Make a (dummy) Windows image.
 windows.img: guest-aux/make-windows-img.sh \
             guest-aux/windows-software guest-aux/windows-system
-       LIBGUESTFS_PATH=../appliance \
-       LD_LIBRARY_PATH=../src/.libs \
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+       TMPDIR=$(top_builddir) \
        bash $<
 
 # Since users might not have the tools needed to create this, we
index fe55ec2..6f2af11 100644 (file)
@@ -106,7 +106,8 @@ TESTS = run-bindtests run-java-tests
 TESTS_ENVIRONMENT = \
        JAVA=$(JAVA) \
        CLASSPATH=.:t:libguestfs-$(VERSION).jar \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 noinst_DATA = Bindtests.class $(java_tests:.java=.class)
 
index 252a337..5813f84 100644 (file)
@@ -70,6 +70,7 @@ endif
 TESTS_ENVIRONMENT = \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir) \
        $(VG)
 
 TESTS = run-bindtests \
index c192290..d8167d1 100644 (file)
@@ -54,7 +54,8 @@ $(TESTS): src_deps all appliance test_images
 
 TESTS_ENVIRONMENT = \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 INSTALLDIRS = site
 
index e995927..5884762 100644 (file)
@@ -47,7 +47,8 @@ libguestfsmod_la_LDFLAGS = -avoid-version
 
 TESTS_ENVIRONMENT = \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
-       PYTHONPATH=$(builddir):$(builddir)/.libs
+       PYTHONPATH=$(builddir):$(builddir)/.libs \
+       TMPDIR=$(top_builddir)
 
 TESTS = run-bindtests run-python-tests
 
index 726fb76..c00a615 100644 (file)
@@ -72,6 +72,7 @@ TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir) \
        PERL5LIB=$(top_builddir)/perl/blib/lib:$(top_builddir)/perl/blib/arch \
        NOEXEC_CHECK="$(top_builddir)/src/.libs/libguestfs.so $(top_builddir)/daemon/guestfsd"
 
index 8418cb4..fd7f71a 100644 (file)
@@ -83,7 +83,8 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
 TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 TESTS = test-virt-resize.sh
 
index 7ef27eb..a2e962d 100644 (file)
@@ -48,7 +48,8 @@ TESTS = run-bindtests run-ruby-tests
 
 TESTS_ENVIRONMENT = \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
-       LIBGUESTFS_PATH=$(top_builddir)/appliance
+       LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir)
 
 all: $(generator_built)
        rake build
diff --git a/run b/run
index 7e18edc..2945315 100755 (executable)
--- a/run
+++ b/run
 run=$(readlink -f "$0")
 b=$(dirname "$run")
 
+# Set TMPDIR so the appliance doesn't conflict with globally
+# installed libguestfs.
+export TMPDIR=$b
+
 # Set local environment relative to this script.
 export LD_LIBRARY_PATH="$b/src/.libs"
 export LIBGUESTFS_PATH="$b/appliance"
index 7904f1c..6059d35 100644 (file)
@@ -61,6 +61,7 @@ TESTS_ENVIRONMENT = \
        MALLOC_PERTURB_=$(random_val) \
        LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
+       TMPDIR=$(top_builddir) \
        PERL5LIB=$(top_builddir)/perl/blib/lib:$(top_builddir)/perl/blib/arch
 
 TESTS = test-virt-list-filesystems.sh \