[LTP] [RFC PATCH 8/9] testcases: test.sh: Check if "getconf" is available

Mylène Josserand mylene.josserand@bootlin.com
Fri Apr 27 11:39:38 CEST 2018


Hello,

On Mon, 23 Apr 2018 12:17:53 +0200
Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > In case TST_NEEDS_CHECKPOINTS is set to 1, the "getconf"
> > binary is used. This binary may not be installed in the system
> > and it will return a FAIL. Instead, add a check on this binary
> > to return "TCONF" in that case.
> > 
> > Signed-off-by: Myl??ne Josserand <mylene.josserand@bootlin.com>
> > ---
> >  testcases/lib/test.sh | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
> > index bce9893a9..b27dbf4ab 100644
> > --- a/testcases/lib/test.sh
> > +++ b/testcases/lib/test.sh
> > @@ -421,6 +421,8 @@ fi
> >  if [ "$TST_NEEDS_CHECKPOINTS" = "1" ]; then
> >  	LTP_IPC_PATH="/dev/shm/ltp_${TCID}_$$"
> >  
> > +	tst_check_cmds "getconf"
> > +
> >  	LTP_IPC_SIZE=$(getconf PAGESIZE)
> >  	if [ $? -ne 0 ]; then
> >  		tst_brkm TBROK "getconf PAGESIZE failed"  
> 
> This would be better fixed by creating a binary helper in testcases/lib/
> same as we did for example for sub-second sleep with tst_sleep.c. We can
> create tst_pagesize.c that would just print the result of getpagesize().
> 

Okay, thank you for the hint. I will have a look.

Best regards,

-- 
Mylène Josserand, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com


More information about the ltp mailing list