[OE-core] [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root.

richard.purdie at linuxfoundation.org richard.purdie at linuxfoundation.org
Wed May 29 13:12:42 UTC 2019


On Wed, 2019-05-29 at 09:08 -0400, Randy MacLeod wrote:
> On 5/29/19 8:35 AM, Richard Purdie wrote:
> > On Tue, 2019-05-28 at 10:31 -0400, Sakib Sajal wrote:
> > > The ptest was failing as it was expecting non-root user.
> > > Ptests are only run as root.
> > > 
> > > Signed-off-by: Sakib Sajal <sakib.sajal at windriver.com>
> > > Signed-off-by: Randy Macleod <randy.macleod at windriver.com>
> > 
> > Rather than patching the code with a patch which we can never
> > upstream,
> > can we run the ptest under a non-root user?
> 
> We considered that but when I looked for an example of oe-core doing
> that but didn't see one. Did I miss it/them?
> 
> I suppose the /usr/lib/bash/ptest/run-ptest script could:
>   - create a user: say 'bashptest'
>   - run the tests
>   - delete the user.
> Of course we'd need to add dependencies for the user mgmt tools.
> 
> Is that what you were thinking?

Yes, there is prior art:

$ cat recipes-core/glib-2.0/glib-2.0/run-ptest
#! /bin/sh

set -eux
useradd glib2-test
su glib2-test -c gnome-desktop-testing-runner glib
userdel glib2-test

(openssh also adds a test user)

Cheers,

Richard




More information about the Openembedded-core mailing list