[LTP] [PATCH 2/2] execltp: add rstrip to runtest_file
Cyril Hrubis
chrubis@suse.cz
Thu Jan 4 16:45:27 CET 2018
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()
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list