[Fuego] Problem of cant find “useradd” in Functional.glibc

Tim.Bird at sony.com Tim.Bird at sony.com
Mon Jul 23 22:12:21 UTC 2018



> -----Original Message-----
> From: Behalf Of Li, Xiaoming
> Hi all:
>
> I have a question of cant find command “useradd” when working on
> /engine/tests/Functional.glibc/fuego_test.sh.
> 
> Over a preliminary investigation, I found that the default path(or maybe bin
> path)loaded by“ssh non-interactive non-login” does not include “useradd”.

Are you saying that this line is failing:
is_on_target_path useradd PROGRAM_USERADD
?

>  
> Methods below could solve this problem, anyone knows a better one ?
> 
> 1)source /etc/profile;
> 
> 2)    use “useradd” with absolute path, like user/sbin/useradd,        without
> checked  by is_on_target_path;

According to the Linux File System Hierarchy Standard, useradd is supposed
to be located in /usr/sbin.  See https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
So I think it would be acceptable to specify the full path: /usr/sbin/useradd.

A bit more robust is to use the value obtained from is_on_target (or is_on_target_path).

If /usr/sbin is not in the ssh interactive login PATH, then try this:
is_on_target useradd PROGRAM_USERADD /bin:/sbin:/usr/bin:/usr/sbin

In the echo statement that creates run-test.sh, you should be able to
use
    $PROGRAM_USERADD fuego_test_special;
instead of
    useradd fuego_test_special

As an aside, do we want the $(realpath /lib/libBrlkenLocale.so.1) 
variable substitution to happen on the host at run-test.sh creation
time, or on the target at run-test.sh execution time.  It looks to me
like it's getting substituted on host, but should rather be substituted
on target.  To do this, I think the $ would need to be escaped in this
set of echo lines.

I hope this is useful.
 -- Tim


More information about the Fuego mailing list