This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix testing with read-only source directory
- From: Jonathan Nieder <jrnieder at gmail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 15 Dec 2017 14:35:25 -0800
- Subject: Re: Fix testing with read-only source directory
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1712152051170.860@digraph.polyomino.org.uk>
Joseph Myers wrote:
> Three tests fail with a read-only source directory because they try to
> write into the source directory. None of these write into it in a way
> that should actually be problematic for concurrent builds sharing the
> same writable source directory, but avoiding any writing into the
> source directory (from testing, or from building glibc if the source
> timestamps are properly ordered) is still a good idea, as being able
> to build with read-only sources helps make sure there isn't anything
> that could cause problems for concurrent builds.
>
> This patch changes the tests in question to use either /tmp or the
> build directory to write their temporary files (or to test O_TMPFILE,
> as applicable).
>
> Tested for x86_64.
>
> 2017-12-15 Joseph Myers <joseph@codesourcery.com>
>
> * io/Makefile (tst-open-tmpfile-ARGS): New variable.
> * posix/tst-mmap-offset.c (fname): Use /tmp.
> * stdlib/tst-setcontext3.sh (tempfile): Use ${objpfx}.
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks for fixing it.
[...]
> --- a/posix/tst-mmap-offset.c
> +++ b/posix/tst-mmap-offset.c
> @@ -29,7 +29,7 @@
>
> static int fd;
> static long int page_shift;
> -static char fname[] = "tst-mmap-offset-XXXXXX";
> +static char fname[] = "/tmp/tst-mmap-offset-XXXXXX";
It would be nice if this kind of test respected $TMPDIR, but that's an
orthogonal problem --- what this patch does is consistent with the
other tests in this dir.