[Toybox] [PATCH] Specify owner when testing tar with /dev/null
Colin Cross
ccross at google.com
Thu Dec 7 09:44:53 PST 2023
On Thu, Dec 7, 2023 at 8:26 AM enh <enh at google.com> wrote:
>
> On Wed, Dec 6, 2023 at 6:44 PM Rob Landley <rob at landley.net> wrote:
> >
> > On 12/6/23 18:15, Colin Cross wrote:
> > >> Who _does_ own /dev/null in your test environment?
> > >
> > > "nobody":
> > >
> > > FAIL: tar pass /dev/null
> > > echo -ne '' | tar c --mtime @0 --group sys /dev/null 2>/dev/null | LST
> > > --- expected 2023-12-07 00:03:55.797797713 +0000
> > > +++ actual 2023-12-07 00:03:55.805797762 +0000
> > > @@ -1 +1 @@
> > > -crw-rw-rw- root/sys 1,3 1970-01-01 00:00 dev/null
> > > +crw-rw-rw- nobody/sys 1,3 1970-01-01 00:00 dev/null
> > > external/toybox/toybox-gtests.cpp:168: Failure
> > > Expected equality of these values:
> > > exit_status
> > > Which is: 1
> > > 0
> >
> > Does bionic still have getuid() stubbed out? (I.E. does toybox's "stat -c %U/%G
> > /dev/null" work?)
>
> you mean getpwuid(), i assume? but i don't think that's relevant,
> because i think ccross is talking about host testing. that's in an
> nsjail set up by build/soong/ui/build/sandbox_linux.go.
This isn't the Soong nsjail sandbox, this is a sandbox created by some
combination of a python script (atest), which calls a java tool
(tradefed), which runs bazel, which runs the test. My guess is that
the sandboxing is all happening in bazel's test runner.
More information about the Toybox
mailing list