All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] runltp: Miscellaneous cleanups
@ 2021-05-11  9:29 Cao jin
  2021-05-11 11:37 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Cao jin @ 2021-05-11  9:29 UTC (permalink / raw)
  To: ltp

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

Signed-off-by: Cao jin <caojin@uniontech.com>
---
 runltp | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/runltp b/runltp
index 7cd0c159f..29779b853 100755
--- a/runltp
+++ b/runltp
@@ -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";
 
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] runltp: Miscellaneous cleanups
  2021-05-11  9:29 [LTP] [PATCH] runltp: Miscellaneous cleanups Cao jin
@ 2021-05-11 11:37 ` Cyril Hrubis
  2021-05-12  1:32   ` Cao jin
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2021-05-11 11:37 UTC (permalink / raw)
  To: ltp

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.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] runltp: Miscellaneous cleanups
  2021-05-11 11:37 ` Cyril Hrubis
@ 2021-05-12  1:32   ` Cao jin
  2021-06-07  9:17     ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Cao jin @ 2021-05-12  1:32 UTC (permalink / raw)
  To: ltp

On 5/11/21 7:37 PM, Cyril Hrubis wrote:
> 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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] runltp: Miscellaneous cleanups
  2021-05-12  1:32   ` Cao jin
@ 2021-06-07  9:17     ` Petr Vorel
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2021-06-07  9:17 UTC (permalink / raw)
  To: ltp

Hi Cao jin, Cyril,

> On 5/11/21 7:37 PM, Cyril Hrubis wrote:
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] runltp: Miscellaneous cleanups
@ 2021-05-08  6:15 Cao jin
  0 siblings, 0 replies; 5+ messages in thread
From: Cao jin @ 2021-05-08  6:15 UTC (permalink / raw)
  To: ltp

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

Signed-off-by: Cao jin <caojin@uniontech.com>
---
 runltp | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/runltp b/runltp
index 7cd0c159f..29779b853 100755
--- a/runltp
+++ b/runltp
@@ -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";
 
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-07  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11  9:29 [LTP] [PATCH] runltp: Miscellaneous cleanups Cao jin
2021-05-11 11:37 ` Cyril Hrubis
2021-05-12  1:32   ` Cao jin
2021-06-07  9:17     ` Petr Vorel
  -- strict thread matches above, loose matches on Subject: below --
2021-05-08  6:15 Cao jin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.