[LTP] [PATCH 2/2] execltp: add rstrip to runtest_file

Daniel Sangorrin daniel.sangorrin@toshiba.co.jp
Mon Jan 15 02:49:21 CET 2018


Hi Cyril,

> -----Original Message-----
> From: Cyril Hrubis [mailto:chrubis@suse.cz]
> Sent: Friday, January 05, 2018 12:45 AM
> To: Daniel Sangorrin
> Cc: ltp@lists.linux.it
> Subject: Re: [LTP] [PATCH 2/2] execltp: add rstrip to runtest_file
> 
> Hi!
> > Without an rstrip I was getting errors saying that the
> > runtest file syscalls didn't exist.
> >
> > Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> > ---
> >  execltp.in | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/execltp.in b/execltp.in
> > index 6d13ad1..2dcdf10 100755
> > --- a/execltp.in
> > +++ b/execltp.in
> > @@ -361,7 +361,7 @@ def main():
> >
> >              failed_subset = {}
> >
> > -            runtest_file = os.path.join(opts.ltp_dir, 'runtest', testsuite)
> > +            runtest_file = os.path.join(opts.ltp_dir, 'runtest', testsuite).rstrip()
> 
> I suppose that the problem here is that the fd.readlines() does include
> newlines at the end of the lines. But stripping it at the point we
> construct the paths seems to be a bit confusing to me.
> 
> What about something as:
> 
> diff --git a/execltp.in b/execltp.in
> index 6d13ad1d7..10b1f53f3 100755
> --- a/execltp.in
> +++ b/execltp.in
> @@ -309,7 +309,7 @@ def main():
>          # Default to scenarios also used by runltp.
>          fd = open(os.path.join(ltpdir, 'scenario_groups/default'), 'r')
>          try:
> -            args = fd.readlines()
> +            args = [l.strip() for l in fd.readlines()]
>          finally:
>              fd.close()
> 

Sorry for the late reply.
I tested your suggestion and it worked great.

Thanks,
Daniel







More information about the ltp mailing list