diff options
| author | Richard W.M. Jones <rjones@redhat.com> | 2012-09-14 14:42:24 +0100 |
|---|---|---|
| committer | Richard W.M. Jones <rjones@redhat.com> | 2012-09-14 15:53:53 +0100 |
| commit | 834747a85d80ce02e9deca32be89199c10cd74fd (patch) | |
| tree | cf26afa77dbac15f67d010a30c71506f334eca7f | |
| parent | aa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb (diff) | |
| download | libguestfs-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-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile.am | 1 | ||||
| -rw-r--r-- | run.in | 7 | ||||
| -rw-r--r-- | src/guestfs.pod | 12 | ||||
| -rw-r--r-- | tmp/.gitignore | 2 |
5 files changed, 21 insertions, 3 deletions
@@ -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. @@ -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.* |
