runltp: skipfile: skipped test cases should be visible as TCONF in results
PATCH 1/1 runltp: skipfile: skipped test cases should be visible as TCONF in results
When we skip tests in LTP by using "./runltp -S SKIPFILE", they get removed from the test list completely, leaving no trace in the results.
This patch will add SKIPFILE listed test cases names to results as TCONF. when testcase_name listed in SKIPFILE the main alltests will get that testcase_name followed by exit 32;
Example:
SKIPFILE the user defined content
$ cat SKIPFILE testcase_name
$ ./runltp -f syscalls -S SKIPFILE
The runtime generated alltests file gets as
$ cat alltests testcase_name exit 32;
The final results file shows as
$ cat results testcase_name TCONF
The good practise with SKIPFILE is,
tests listed in a SKIPFILE should be a single testcase_name per line. However, test script takes only first column by using awk {print $1}
We can add comments inside SKIPFILE starting with # The script will ignore line starting with #
--- runltp | 14 +++++++++----- runltplite.sh | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-)
runltp +9 -5
@@ -692,11 +692,15 @@ main() fi # Blacklist or skip tests if a SKIPFILE was specified with -S - if [ -n "$SKIPFILE" ] - then - for file in $( cat $SKIPFILE ); do - sed -i "/^$file[ \t]/d" ${TMP}/alltests - done + if [ -n "${SKIPFILE}" ]; then + while read -r test_line; do + case "${test_line}" in \#*) continue ;; esac + if [ -n "${test_line}" ]; then + # test_name is first column of each line in SKIPFILE + test_name=$(echo ${test_line} | awk '{print $1}') + sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests + fi + done < ${SKIPFILE} fi # check for required users and groups
runltplite.sh +9 -5
@@ -316,11 +316,15 @@ main() } # Blacklist or skip tests if a SKIPFILE was specified with -S - if [ -n "$SKIPFILE" ] - then - for file in $( cat $SKIPFILE ); do - sed -i "/^$file[ \t]/d" ${TMP}/alltests - done + if [ -n "${SKIPFILE}" ]; then + while read -r test_line; do + case "${test_line}" in \#*) continue ;; esac + if [ -n "${test_line}" ]; then + # test_name is first column of each line in SKIPFILE + test_name=$(echo ${test_line} | awk '{print $1}') + sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests + fi + done < ${SKIPFILE} fi # display versions of installed software
Signature · 1 line
2.7.4
PATCH 1/1 runltp: skipfile: skipped test cases should be visible as TCONF in results
Hi!
runltp main() · line 703
Quoted 9 lines
runltp +9
-0+ if [ -n "${SKIPFILE}" ]; then + while read -r test_line; do + case "${test_line}" in \#*) continue ;; esac + if [ -n "${test_line}" ]; then + # test_name is first column of each line in SKIPFILE + test_name=$(echo ${test_line} | awk '{print $1}') + sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests + fi + done < ${SKIPFILE}
This could be written in a simpler form:
for test_name in $(awk '{print $1}' "$SKIPFILE"); do
case "${test_name}" in \#*) continue;; esac
sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests
doneOther than that it looks fine.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 runltp: skipfile: skipped test cases should be visible as TCONF in results
Cyril,
Quoted 11 lines · Cyril Hrubis
Hi!
runltp main() · line 703
Quoted 9 lines
runltp +9
-0+ if [ -n "${SKIPFILE}" ]; then + while read -r test_line; do + case "${test_line}" in \#*) continue ;; esac + if [ -n "${test_line}" ]; then + # test_name is first column of each line in SKIPFILE + test_name=$(echo ${test_line} | awk '{print $1}') + sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests + fi + done < ${SKIPFILE}
Quoted 6 lines
This could be written in a simpler form:
for test_name in $(awk '{print $1}' "$SKIPFILE"); do case "${test_name}" in \#*) continue;; esac sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests done
I have tested this piece of script and this also works. Shall i re-send the patch with this modification ?
Quoted 3 lines
Other than that it looks fine.
- Naresh
Quoted 4 lines
--
Cyril Hrubis
[email protected]
PATCH 1/1 runltp: skipfile: skipped test cases should be visible as TCONF in results
Hi!
Quoted 9 lines
Quoted 6 lines
This could be written in a simpler form:
for test_name in $(awk '{print $1}' "$SKIPFILE"); do case "${test_name}" in \#*) continue;; esac sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests doneI have tested this piece of script and this also works. Shall i re-send the patch with this modification ?
Yes please.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 runltp: skipfile: skipped test cases should be visible as TCONF in results
Quoted 8 lines · Cyril Hrubis
Hi!
Quoted 7 lines
Quoted 6 lines
This could be written in a simpler form:
for test_name in $(awk '{print $1}' "$SKIPFILE"); do case "${test_name}" in \#*) continue;; esac sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests done
Quoted 4 lines
Quoted 2 lines
I have tested this piece of script and this also works. Shall i re-send the patch with this modification ?
Yes please.
Sending updated patch with above comments.
- Naresh
Quoted 4 lines
--
Cyril Hrubis
[email protected]