Skip to contentSkip to conversation

runltp: Miscellaneous cleanups

PATCH New Cao jin 3 participants 4 messages May 11, 2021 – Jun 7, 2021

lore
Share & tools
lore

Cao jin

author
#0 lore raw

PATCH 1/1 runltp: Miscellaneous cleanups

1. typofix: then --> than
2. Drop useless HTML file name creating code, as g: mandatorily requires argument.
3. Make direcotry create symmetrical. There is no need to always see:

INFO: creating $LTPROOT/results directory

except the real creation of it. Also indent the code.

4. fix a variable misnomer

---
 runltp | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
runltp +9 -12
index 7cd0c159f..29779b853 100755
@@ -300,7 +300,7 @@ main()
             version_of_ltp
 	    ;;
         f)  # Execute user defined set of testcases.
-            # Can be more then one file, just separate it with ',', like:
+            # Can be more than one file, just separate it with ',', like:
             # -f nfs,commands,/tmp/testfile
             CMDFILES=$OPTARG;;
 	F)	INJECT_KERNEL_FAULT=1
@@ -502,10 +502,6 @@ main()
           OUTPUTFILE_NAME="$DEFAULT_FILE_NAME_GENERATION_TIME"
           OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output"
           ALT_DIR_OUT=1
-          if [ ! "$HTMLFILE" ] ; then                        ## User has not mentioned HTML File name, We need to create one
-             HTMLFILE_NAME=`basename $OUTPUTFILE_NAME`
-             HTMLFILE="$LTPROOT/output/$HTMLFILE_NAME.html"
-          fi
        fi
     fi
 
@@ -522,16 +518,17 @@ main()
             }
         }
     }
+
     # If we need, create the results directory
     [ "$ALT_DIR_RES" -eq 1 ] && \
     {
-        echo "INFO: creating $LTPROOT/results directory"
         [ ! -d $LTPROOT/results ] && \
         {
-           mkdir -p $LTPROOT/results || \
-           {
-               echo "ERROR: failed to create $LTPROOT/results"
-               exit 1
+            echo "INFO: creating $LTPROOT/results directory"
+            mkdir -p $LTPROOT/results || \
+            {
+                echo "ERROR: failed to create $LTPROOT/results"
+                exit 1
             }
         }
     }
@@ -840,12 +837,12 @@ EOF
        export LTP_VERSION=$version_date
        export TEST_START_TIME="$test_start_time"
        export TEST_END_TIME="$(date)"
-       OUTPUT_DIRECTORY=`echo $OUTPUTFILE | cut -c4-`
+       OUTPUT_FILE=`echo $OUTPUTFILE | cut -c4-`
        LOGS_DIRECTORY="$LTPROOT/results"
        export TEST_OUTPUT_DIRECTORY="$LTPROOT/output"
        export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY
        echo "Generating HTML Output.....!!"
-       ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/bin/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY  > $HTMLFILE; )
+       ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/bin/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_FILE  > $HTMLFILE; )
        echo "Generated HTML Output.....!!"
        echo "Location: $HTMLFILE";
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 runltp: Miscellaneous cleanups

Hi!
The changes looks good to me but at the moment we are fairly late in the release process so this will have to wait for about two weeks before it could be applied.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 runltp: Miscellaneous cleanups

Quoted 5 lines · Cyril Hrubis

Hi!
The changes looks good to me but at the moment we are fairly late in the release process so this will have to wait for about two weeks before it could be applied.

I am fine with that. Thanks, Cyril.

--
Cao jin

#3 lore raw

PATCH 1/1 runltp: Miscellaneous cleanups

Hi Cao jin, Cyril,

Quoted 8 lines · Cyril Hrubis
Quoted 4 lines

Hi!
The changes looks good to me but at the moment we are fairly late in the release process so this will have to wait for about two weeks before it could be applied.

I am fine with that. Thanks, Cyril.

I added one more typo fix (seperate => separate) and merged.

FYI: runltp is very outdated we recommend to use runltp-ng [1]. It's not upstreamed yet, properly propagating timeout issue is the latest issue we need to solve before upstreaming it into LTP and deprecating runltp. We hope to make it in this release.

Kind regards,
Petr

[1] https://github.com/metan-ucw/runltp-ng/
[2] https://github.com/metan-ucw/runltp-ng/issues/31