[OE-core] bash ptests: use runuser? also remaining errors.

Randy MacLeod randy.macleod at windriver.com
Wed Jun 12 02:11:17 UTC 2019


On 6/11/19 8:05 PM, richard.purdie at linuxfoundation.org wrote:
> On Tue, 2019-06-11 at 15:00 -0400, Randy MacLeod wrote:
>> Richard, et. al.
>>
>> I have two patches (ptest-runner, bash) that enable all but two [*]
>> of the bash-ptests to pass. A potential problem is that when started
>> by
>> ptest-runner, 'su' (both busybox and util-linux versions), results in
>> a few of bash's tests failing whereas they work if started by
>> 'runuser'.
>> The test failure is due to a warning:
>>       bash: cannot set terminal process group (16036): \
>>             Inappropriate ioctl for device
>> that contaminates the test logs and makes a diff with the expected
>> results fail. I can easily redirect that warning to /dev/null but
>> that seems wrong and would be a patch that we'd have to carry in
>> oe-core.
>>
>> To get 'runuser' from util-linux into an image, it seems that you
>> need:
>>    - the RDEPENDS for ptest,
>>    - REQUIRED_DISTRO_FEATURES = "pam" in bash.inc, and
>>    - to set the 'pam' DISTRO_FEATURE in your local.conf.
> 
> The requirement for pam is a problem as we can't require that for
> ptests.

Ugh, I was expecting that you might say that. :-/

> 
>> Is that something you are willing to do for all ptests or perhaps
>> just for bash's ptests?  If so, I'll clean-up my ptest-runner patch
>> and send this to the list.
>>
>>
>> I also considered using util-linux's 'setpriv' but enabling that
>> has turned into a mess of dependency loops and other build problems.
>> man runuser:
>>      If the PAM session is not required then recommended solution
>>      is to use setpriv(1) command.
> 
> What kind of dependency loops? Can we just enable it for target builds,
> would that help?

The loops are due to adding libcap-ng to the DEPENDS for
util-linux so that 'setpriv' can be built. With that
change we have:
    util-linux -> libcap-ng -> python3 -> util-linux

libcap-ng provides both a low-level library and
a python wrapper. If I split that up quickly by just commenting
out the python parts and util-linux builds fine so that's
promising.

>> Other solutions to properly starting user tests from root are
>> welcome!
> 
> Not sure but I think we're going to need to find some. Enabling setpriv
> sounds like the easiest first option but it depends on the errors.

Okay, I'll work on that next, err now... and it mostly works!
Now there are 4 ptest failures rather than 2 with runuser.
A newer version of util-linux/sys-utils/setpriv.c has a
   --reset-env
option that I suspect will help with that.

Chen,
Do you happen to have a util-linux update underway?
I need 2.33.2 or newer.


It's possible that there's also still a bug in ptest-runner that
should be fixed or some shell hackery that might work-around
the problems seen with 'su'.

Thanks for the quick reply,

../Randy

> Cheers,
> 
> Richard
> 


-- 
# Randy MacLeod
# Wind River Linux


More information about the Openembedded-core mailing list