[libvirt] [PATCH] tests: Make pci config files writable

As of 21685c955 the 'distcheck' is broken. The problem is, by default it copies all the necessary files and make them read only. However, pci device detach test doesn't work that way. The PCI device configs are stored within our tests/ directory and need to be writable (detaching and resetting means writing into the config file). Hence, we must make those files writable again. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index e46d5f7..29dbf76 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -921,3 +921,8 @@ endif ! WITH_CIL CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \ object-locking-files.txt + +# Some tests tend to write into files. Notably, the virpcitest, which detach +# and reset a pci device (achieved byt writing into a pci config file). +check-local: + chmod -R u+w $(srcdir)/virpcitestdata/ -- 1.8.4.4

On Mon, Nov 25, 2013 at 03:22:38PM +0100, Michal Privoznik wrote:
As of 21685c955 the 'distcheck' is broken. The problem is, by default it copies all the necessary files and make them read only. However, pci device detach test doesn't work that way. The PCI device configs are stored within our tests/ directory and need to be writable (detaching and resetting means writing into the config file). Hence, we must make those files writable again.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am index e46d5f7..29dbf76 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -921,3 +921,8 @@ endif ! WITH_CIL
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \ object-locking-files.txt + +# Some tests tend to write into files. Notably, the virpcitest, which detach +# and reset a pci device (achieved byt writing into a pci config file). +check-local: + chmod -R u+w $(srcdir)/virpcitestdata/
I seem to recall eric saying on IRC that we shouldn't do this, and that any files the test suite writes to should be located in $(builddir) not $(srcdir). Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 11/25/2013 07:24 AM, Daniel P. Berrange wrote:
object-locking-files.txt + +# Some tests tend to write into files. Notably, the virpcitest, which detach +# and reset a pci device (achieved byt writing into a pci config file). +check-local: + chmod -R u+w $(srcdir)/virpcitestdata/
NACK. This will fail if $(srcdir) is on a read-only mount point (such as a CDROM).
I seem to recall eric saying on IRC that we shouldn't do this, and that any files the test suite writes to should be located in $(builddir) not $(srcdir).
Indeed. The correct way is to move these files to $(builddir) (which is always writable) and quit trying to ship them in the tarball - they only need to exist for the duration of the test, so the tarball only needs rules on how to generate the files into $(builddir) at the start of the test. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 11/25/2013 08:20 AM, Eric Blake wrote:
On 11/25/2013 07:24 AM, Daniel P. Berrange wrote:
object-locking-files.txt + +# Some tests tend to write into files. Notably, the virpcitest, which detach +# and reset a pci device (achieved byt writing into a pci config file). +check-local: + chmod -R u+w $(srcdir)/virpcitestdata/
NACK. This will fail if $(srcdir) is on a read-only mount point (such as a CDROM).
I seem to recall eric saying on IRC that we shouldn't do this, and that any files the test suite writes to should be located in $(builddir) not $(srcdir).
Indeed. The correct way is to move these files to $(builddir) (which is always writable) and quit trying to ship them in the tarball - they only need to exist for the duration of the test, so the tarball only needs rules on how to generate the files into $(builddir) at the start of the test.
Now fixed: https://www.redhat.com/archives/libvir-list/2013-November/msg01267.html -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Michal Privoznik