summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-14 14:42:24 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-14 15:53:53 +0100
commit834747a85d80ce02e9deca32be89199c10cd74fd (patch)
treecf26afa77dbac15f67d010a30c71506f334eca7f
parentaa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb (diff)
downloadlibguestfs-834747a85d80ce02e9deca32be89199c10cd74fd.tar.gz
libguestfs-834747a85d80ce02e9deca32be89199c10cd74fd.tar.xz
libguestfs-834747a85d80ce02e9deca32be89199c10cd74fd.zip
build: Create new 'tmp' directory for tests.
Having a separate directory means: (1) It's easy to clean up orphaned temporary files, the appliance, etc. (2) You can put an SELinux label on this directory so that qemu can write to it when you're using sVirt and SELinux is enforcing: chcon --reference=/tmp tmp
-rw-r--r--.gitignore2
-rw-r--r--Makefile.am1
-rw-r--r--run.in7
-rw-r--r--src/guestfs.pod12
-rw-r--r--tmp/.gitignore2
5 files changed, 21 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index f809379b..3fd4e0a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -147,8 +147,6 @@ Makefile.in
/gobject/Guestfs-1.0.typelib
/gobject/guestfs-gobject*.c
/gobject/guestfs-gobject*.h
-/.guestfs-*
-/guestfs.*
/guestfs-release-notes.1
/guestfsd-in-wine.log
/haskell/Bindtests
diff --git a/Makefile.am b/Makefile.am
index e8fd47e8..fdc4f38c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -151,6 +151,7 @@ EXTRA_DIST = \
libtool-kill-dependency_libs.sh \
logo/fish.svg logo/fish.png \
m4/.gitignore \
+ tmp/.gitignore \
update-bugs.sh
# The website.
diff --git a/run.in b/run.in
index 413d7f7b..6eb0e0b1 100644
--- a/run.in
+++ b/run.in
@@ -45,7 +45,12 @@ b=@abs_builddir@
# Set TMPDIR so the appliance doesn't conflict with globally
# installed libguestfs.
-export TMPDIR="$b"
+#
+# We set it to a subdirectory ('tmp') so that we can label this
+# subdirectory to make libvirt + sVirt + SELinux enforcing work.
+#
+# chcon --reference=/tmp tmp
+export TMPDIR="$b/tmp"
# Set local environment relative to this script.
export LIBGUESTFS_PATH="$b/appliance"
diff --git a/src/guestfs.pod b/src/guestfs.pod
index aee83608..45c81db5 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -3287,6 +3287,18 @@ will work with libguestfs.
Tests.
+=item C<tmp>
+
+Used for temporary files when running the tests (instead of C</tmp>
+etc). The reason is so that you can run multiple parallel tests of
+libguestfs without having one set of tests overwriting the appliance
+created by another.
+
+If you are using libvirt + sVirt with SELinux enforcing, then you have
+to label this directory:
+
+ chcon --reference=/tmp tmp
+
=item C<tools>
Command line tools written in Perl (L<virt-win-reg(1)> and many others).
diff --git a/tmp/.gitignore b/tmp/.gitignore
new file mode 100644
index 00000000..996d0c5d
--- /dev/null
+++ b/tmp/.gitignore
@@ -0,0 +1,2 @@
+/.guestfs-*
+/guestfs.*