Skip to contentSkip to conversation

execltp: fix two minor issues

LTP New Daniel Sangorrin 2 participants 7 messages Dec 25, 2017 – Jan 15, 2018

lore
Share & tools
lore
#0 lore raw

Hi,

Please consider the following 2 patches that fix two issues that I found when I tried to run execltp.

[PATCH 1/2] execltp: fix scenario_group naming
[PATCH 2/2] execltp: add rstrip to runtest_file

Thanks,
Daniel

#1 lore raw

PATCH 1/2 execltp: fix scenario_group naming

Commit 9d5dac6 modified the folder name "scenario-groups" to "scenario_groups" but it seems it missed changing it on the execltp script as well.

---
 execltp.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
execltp.in +1 -1
index 470a2dc..6d13ad1 100755
@@ -307,7 +307,7 @@ def main():
 
     if len(args) == 0:
         # Default to scenarios also used by runltp.
-        fd = open(os.path.join(ltpdir, 'scenario-groups/default'), 'r')
+        fd = open(os.path.join(ltpdir, 'scenario_groups/default'), 'r')
         try:
             args = fd.readlines()
         finally:
Signature · 1 line
2.1.4
#3 lore raw

PATCH 2/2 execltp: add rstrip to runtest_file

In reply to Daniel Sangorrin

Without an rstrip I was getting errors saying that the runtest file syscalls didn't exist.

---
 execltp.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
execltp.in +1 -1
index 6d13ad1..2dcdf10 100755
@@ -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()
 
             if not opts.postprocess_only:
 
Signature · 1 line
2.1.4
#4 lore raw

PATCH 2/2 execltp: add rstrip to runtest_file

Hi!

Quoted 13 lines

Without an rstrip I was getting errors saying that the runtest file syscalls didn't exist.

---
 execltp.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
execltp.in +0 -0
index 6d13ad1..2dcdf10 100755

execltp.in def main(): · line 364

Quoted 5 lines
execltp.in +1 -1
@@ -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:

execltp.in +1 -1
index 6d13ad1d7..10b1f53f3 100755
@@ -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()
 
Signature · 2 lines
Cyril Hrubis
[email protected]
#5 lore raw

PATCH 2/2 execltp: add rstrip to runtest_file

Hi Cyril,

Quoted 38 lines

-----Original Message-----
From: Cyril Hrubis [mailto:[email protected]]
Sent: Friday, January 05, 2018 12:45 AM
To: Daniel Sangorrin
Cc: [email protected]
Subject: Re: [LTP] [PATCH 2/2] execltp: add rstrip to runtest_file

Hi!

Quoted 13 lines

Without an rstrip I was getting errors saying that the runtest file syscalls didn't exist.

---
 execltp.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
execltp.in +0 -0
index 6d13ad1..2dcdf10 100755

execltp.in def main(): · line 364

Quoted 5 lines
execltp.in +1 -1
@@ -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:

execltp.in +0 -0
index 6d13ad1d7..10b1f53f3 100755

execltp.in def main(): · line 315

Quoted 8 lines
execltp.in +1 -1
@@ -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

#6 lore raw

PATCH 2/2 execltp: add rstrip to runtest_file

Hi!

Quoted 2 lines

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

Pushed, thanks for the report and testing.

Signature · 2 lines
Cyril Hrubis
[email protected]