This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Chroot testsuite
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ryan Arnold <ryan dot arnold at linaro dot org>
- Cc: Carlos O'Donell <carlos at redhat dot com>, OndÅej BÃlka <neleai at seznam dot cz>, Will Newton <will dot newton at linaro dot org>, GNU C Library <libc-alpha at sourceware dot org>, Robert Savoye <rob dot savoye at linaro dot org>, Matthew Gretton-Dann <matthew dot gretton-dann at linaro dot org>
- Date: Sat, 11 Jan 2014 01:32:24 +0000
- Subject: Re: Chroot testsuite
- Authentication-results: sourceware.org; auth=none
- References: <52A6732E dot 4030905 at redhat dot com> <CANu=DmgWNhyxq9vE37bvvD=PrDrfi0Y+eAMv0i2KZPxaEnEOxw at mail dot gmail dot com> <20131210111201 dot GA5309 at domone dot podge> <52A764F3 dot 60501 at redhat dot com> <CAJE4xBMs-Qz4J01Z7M4ebwA11MZ_Uf6vdbSJ-GyCuZHbWNCFjw at mail dot gmail dot com> <52B3C775 dot 4070503 at redhat dot com> <CAJE4xBOBfyPsXpW9JMmDd7D2uS-BkJ019+Lsrsxu0Ydg+XvVvw at mail dot gmail dot com>
On Fri, 10 Jan 2014, Ryan Arnold wrote:
> Creating the chroot is out-of-scope for glibc since the methodology
> for doing so will vary based on operating system distribution (for
> example, Ubuntu might use schroot and debootstrap while for Fedora
> might use systemd-nspawn and yum --installroot). A wiki how-to would
> be helpful in any case. I imagine an OS distribution could also
> provide a package which does this for their specific src package
> manager.
> Is there any coverage that's lost by not performing builddir tests
> remotely if they're all repurposed as install/host tests?
glibc testing should not assume any particular packages on the host; it
should work even if what you get from ssh is just a busybox shell (with no
privileges to run chroot). It should also not require that any OS
binaries are available that are compatible with the newly built glibc
rather than being linked with some other incompatible libc (consider, for
example, testing an x32 glibc when nothing other than the kernel supports
x32, or testing an ABI-changed glibc as part of bringing up a port).
So, except where testing something inherently requires chroot, I don't
think tests for that thing should be limited to environments where chroot
is a possibility - although it's useful to be able to run the same test
both ways. And where chroot is a possibility, being able to test in a
chroot directory that is exactly what you get from install_root - no other
software at all - would be desirable.
I do want to be able to run tests against installed glibc without the
builddir from the original build (in support of a model of building a
complete cross toolchain, then testing the final complete toolchain) and
without needing to chroot, but the way I'm thinking of implementing that
is using appropriate makefile variables that can be overridden for
installed testing, so that e.g. tests link with $(ld.so-tests) which could
be an installed file rather than a build tree file, so the dependencies
don't force most of the library to be built. That also requires
distinguishing those tests that inherently examine properties of the build
tree rather than just installed files, and should have a separate makefile
target to run them at build time. It also requires a mechanism to save
any non-installed build-tree files that really are needed by tests. I'm
not planning on working on this until my changes to generate PASS / FAIL
results are in.
I would not be adverse to the normal glibc testsuite moving to installing
files in a staging directory within the build tree using install_root,
then running tests the same way they would be run with a previously built
and installed glibc, provided this does not require any extra software or
privileges for chroot.
I've previously suggested a GLIBC_SYSROOT environment variable for use in
testing, that would allow more of the effects of chroot to be emulated
without needing any privileges or extra installed software, but there were
some concerns about having such a variable.
--
Joseph S. Myers
joseph@codesourcery.com