[Fuego] [PATCH 1/2] pppd: use command with absolute path

Tim.Bird at sony.com Tim.Bird at sony.com
Mon Oct 29 22:41:39 UTC 2018



> -----Original Message-----
> From: Liu, Gang
> 
> Hi Tim
> 
> Sorry for late reply.
> 
> > -----Original Message-----
>> From: Tim Bird
> > Sent: Friday, October 12, 2018 7:49 AM
> > > -----Original Message-----
> > > From: Liu Gang
> > >
> > > Use absolute path to fix the problem of can not find the commands when
> > > working on /engine/tests/Functional.pppd/fuego_test.sh.
> > > command:pppd,chat,ifconfig
> > >
> > > Signed-off-by: Liu Gang <liug.fnst at cn.fujitsu.com>
> > > ---
> > >  engine/tests/Functional.pppd/fuego_test.sh | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/engine/tests/Functional.pppd/fuego_test.sh
> > > b/engine/tests/Functional.pppd/fuego_test.sh
> > > index d080871..11c0ebc 100755
> > > --- a/engine/tests/Functional.pppd/fuego_test.sh
> > > +++ b/engine/tests/Functional.pppd/fuego_test.sh
> > > @@ -9,10 +9,10 @@ function test_build {
> > >      pwd; ls
> > >      ./ppp_response \$(cat slave1) &
> > >      sleep 1
> > > -    pppd connect 'chat -v \"\" AT OK ATDT5551212 CONNECT' \$(cat
> slave2)
> > > 38400 debug defaultroute nocrtscts idle 60 &
> > > +    /usr/sbin/pppd connect '/usr/sbin/chat -v \"\" AT OK ATDT5551212
> > > CONNECT' \$(cat slave2) 38400 debug defaultroute nocrtscts idle 60 &
> > >      sleep 5
> > > -    ifconfig -a
> > > -    if ifconfig ppp0 ; then
> > > +    /sbin/ifconfig -a
> > > +    if /sbin/ifconfig ppp0 ; then
> > >      echo 'TEST-1 OK'
> > >      else
> > >      echo 'TEST-1 FAILED'
> > > --
> > > 2.7.4
> >
> > Why are these commands not being found?  Is there a problem with the
> PATH
> > on the target board?  I'm OK with this patch, but it sounds like you might
> > be covering up another issue (missing directories in the PATH for the test
> > user), which will continue to cause problems.
> >
> > I'm going to apply this, but I'd like to know why it's needed.
> >  -- Tim
> >
> >
> 
> When I run this case with fuego, these commands not being found.
> I find the PATH was changed from
> "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" to
> "PATH=/usr/bin:/bin".
> I think when use non-interactive non-login mode to run scripts with fuego,
> sbin(/usr/sbin) is not added to the PATH in my board.

OK - this sounds like a board-specific, or distribution-specific problem.
Maybe you need to adjust the .profile for non-interactive sessions on
the board under test, to use the standard PATH.

I will leave the patch as is, because the full path matches that used by the
Filesystem Hierarchy Standard, version 3.0.  See https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
section 3.16 on system binaries.
So, a Linux system should always have 'ifconfig' in the /sbin directory.
The FHS doesn't mention pppd, but I'm guessing that it's standard location
is /usr/sbin.  If we get a bug report about /usr/sbin/pppd not found, however, I may
back this patch out, and request that you fix your board to include /usr/sbin in
the non-interactive shell PATH.

Thanks for following up with the information.
 -- Tim




More information about the Fuego mailing list