[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: autopkgtest/sbuild environment variables: LC_ALL, HOME, XDG_RUNTIME_DIR etc



On Thu, Apr 28, 2022 at 02:32:49PM +0100, Simon McVittie wrote:
> On Thu, 28 Apr 2022 at 14:02:46 +0100, Julian Gilbey wrote:
> > On Thu, Apr 28, 2022 at 10:16:30AM +0100, Simon McVittie wrote:
> > > According to the autopkgtest spec[1],
> > > 
> > >     Tests can expect that the $HOME environment variable to be set to
> > >     a directory that exists and is writeable by the user running the test.
> > 
> > That's interesting; I don't find any code that sets HOME in
> > autopkgtest.
> 
> The purpose of autopkgtest is to run the tests in a realistic environment
> that resembles a real Debian desktop or server, but it doesn't know much
> about how the testbed system is set up, so it relies on the virtualization
> backend or the testbed itself to set HOME appropriately. Ideally, it
> should be logging into a fully-working Debian system (perhaps under qemu
> or lxc, or even on real hardware via ssh) and running tests there.
> 
> As I said on #986665, this seems like either a bug in
> autopkgtest-virt-schroot, or misconfiguration in how you and Laurent
> are configuring it (the schroot profile that you're telling it to use).
> [...]

I see; this makes more sense now.  So can I suggest that
sbuild-setup(7) explains this a bit more and discusses setting up a
meaningful HOME directory?  And perhaps has the things necessary for a
meaningful XDG_RUNTIME_DIR set up by default as well?

> > (Incidentally, given that
> > typically XDG_RUNTIME_DIR is in the ephemeral /run filesystem, writing
> > to it would not violate policy 4.9.)
> 
> Policy §4.9 says that "Required targets must not attempt to write outside
> of the unpacked source package tree", then makes a few exceptions for
> locations like /tmp. /run is not one of those locations, so writing to
> /run is not allowed.

Ah, I didn't read it carefully enough; you are right.

> > I wonder whether autopkgtest
> > could consider setting up a temporary directory for this purpose like
> > dh_auto_test does, rather than using the heavy machinery of
> > libpam-systemd?
> 
> No, I don't think it should. The purpose of autopkgtest is to run the
> [...]

Understood.

   Julian


Reply to: