Hi Ricardo,
With this you have sent 2 patches regarding the new way by which ./runltp and pan will behave. Can you kindly document this somewhere in ltp/doc/* file or create a new document?? You can send me a separate patch after adding documentation for the same.
Regards--
Subrata

Ricardo Salveti de Araujo wrote:
Hi all,

This patch create a new option at both 'pan' and 'runltp' (-C file) that creates a file with all failed test cases and it's commands.

For example, you can run './runltp -C /tmp/failcmdfile' and after 'runltp' finish you'll get all failed test cases and it's commands at /tmp/failcmdfile, what let you the possibility to run again only the test cases that failed at your last test (using flag '-f' at runltp).

With the latest patch that I sent (new -w option and other changes), you could just run 'runltp' with -C file to get all failed commands, and export this results at a webserver (like we have at abat + test.kernel.org) and use the option '-w' to get this command file and test only the test cases that you had problem with.

This patch depends of the latest patch that I sent (because I changed the usage message at both patches), if you need a patch without depending of the latest one just let me know.

Thanks,

------------------------------------------------------------------------

Author: Ricardo Salveti de Araujo <[EMAIL PROTECTED]>
Date:   Mon Jul 23 22:05:23 2007 -0300

   Changes:
   - Created a new option at 'pan' and 'runltp' (-C file) that creates a file 
with all failed
   test cases and its commands.

   With this, you can run 'runltp' and pass -C failcmdfile to get all test 
cases and commands
   that failed. To run only the failed test cases, pass the file to 'runltp' 
with flag '-f'.

    Signed-off-by: Ricardo Salveti de Araujo <[EMAIL PROTECTED]>

diff --git a/pan/pan.c b/pan/pan.c
index 78e46e6..c9504fc 100644
--- a/pan/pan.c
+++ b/pan/pan.c
@@ -44,6 +44,10 @@
  *
  *     01/29/03 - Added: Manoj Iyer, [EMAIL PROTECTED]
  *                        - added code supresses test start and test end tags.
+ *
+ *     07/22/07 - Added: Ricardo Salveti de Araujo, [EMAIL PROTECTED]
+ *                        - added option to create a command file with all 
failed tests.
+ *     
  */
 /* $Id: pan.c,v 1.24 2006/12/13 22:55:21 vapier Exp $ */

@@ -99,8 +103,9 @@ static struct collection *get_collection(char *file, int 
optind, int argc,
                                         char **argv);
 static void pids_running(struct tag_pgrp *running, int keep_active);
 static int check_pids(struct tag_pgrp *running, int *num_active,
-                     int keep_active, FILE * logfile, struct orphan_pgrp 
*orphans,
-                         int fmt_print, int *failcnt, int quiet_mode);
+ int keep_active, FILE * logfile, FILE * failcmdfile, + struct orphan_pgrp *orphans, int fmt_print,
+                     int *failcnt, int quiet_mode);
 static void propagate_signal(struct tag_pgrp *running, int keep_active,
                             struct orphan_pgrp *orphans);
 static void dump_coll(struct collection *coll);
@@ -146,12 +151,14 @@ main(int argc, char **argv)
     char *zooname = NULL;      /* name of the zoo file to use */
     char *filename = "/dev/null";    /* filename to read test tags from */
     char *logfilename = NULL;
+    char *failcmdfilename = NULL;
     char *outputfilename = NULL;
     struct collection *coll = NULL;
     struct tag_pgrp *running;
     struct orphan_pgrp *orphans, *orph;
        struct utsname unamebuf;
     FILE *logfile = NULL;
+    FILE *failcmdfile = NULL;
     int keep_active = 1;
     int num_active = 0;
        int failcnt = 0;           /* count of total testcases that failed. */
@@ -171,7 +178,7 @@ main(int argc, char **argv)
     pid_t cpid;
     struct sigaction sa;

-    while ((c = getopt(argc, argv, "AO:Sa:d:ef:hl:n:o:pqr:s:t:x:y")) != -1) {
+    while ((c = getopt(argc, argv, "AO:Sa:C:d:ef:hl:n:o:pqr:s:t:x:y")) != -1) {
        switch (c) {
        case 'A':       /* all-stop flag */
            has_brakes = 1;
@@ -186,6 +193,9 @@ main(int argc, char **argv)
        case 'a':       /* name of the zoo file to use */
            zooname = strdup(optarg);
            break;
+       case 'C':       /* name of the file where all failed commands will be */
+           failcmdfilename = strdup(optarg);
+           break;
        case 'd':       /* debug options */
            sscanf(optarg, "%i", &Debug);
            break;
@@ -199,6 +209,7 @@ main(int argc, char **argv)
            fprintf(stdout, "Usage: pan -n name [ -SyAehp ] [ -s starts ]"
                                 " [-t time[s|m|h|d] [ -x nactive ] [ -l logfile 
]\n\t"
                                 "[ -a active-file ] [ -f command-file ] "
+                                "[ -C fail-command-file ] "
                                 "[ -d debug-level ]\n\t[-o output-file] "
                                 "[-O output-buffer-directory] [cmd]\n");
            exit(0);
@@ -386,6 +397,15 @@ main(int argc, char **argv)
        }
     }

+    if (failcmdfilename) {
+       if (!(failcmdfile = fopen(failcmdfilename, "a+"))) {
+           fprintf(stderr,
+                   "pan(%s): Error %s (%d) opening fail cmd file '%s'\n",
+                   panname, strerror(errno), errno, failcmdfilename);
+           exit(1);
+       }
+    }
+
     if ((zoofile = zoo_open(zooname)) == NULL) {
        fprintf(stderr, "pan(%s): %s\n", panname, zoo_error);
        exit(1);
@@ -503,8 +523,8 @@ main(int argc, char **argv)
            }
        }

-       err = check_pids(running, &num_active, keep_active,
-                        logfile, orphans, fmt_print, &failcnt, quiet_mode);
+       err = check_pids(running, &num_active, keep_active, logfile,
+                        failcmdfile, orphans, fmt_print, &failcnt, quiet_mode);
        if (Debug & Drunning) {
            pids_running(running, keep_active);
            orphans_running(orphans);
@@ -615,8 +635,8 @@ propagate_signal(struct tag_pgrp *running, int keep_active,

 static int
 check_pids(struct tag_pgrp *running, int *num_active, int keep_active,
- FILE * logfile, struct orphan_pgrp *orphans, int fmt_print, - int *failcnt, int quiet_mode)
+          FILE * logfile, FILE * failcmdfile, struct orphan_pgrp *orphans,
+          int fmt_print, int *failcnt, int quiet_mode)
 {
     int w;
     pid_t cpid;
@@ -716,6 +736,9 @@ check_pids(struct tag_pgrp *running, int *num_active, int 
keep_active,
                                fflush(logfile);
                }

+               if ((failcmdfile != NULL) && (w !=0)) {
+                       fprintf(failcmdfile, "%s %s\n", running[i].cmd->name, 
running[i].cmd->cmdline);
+               }

                if (running[i].stopping)
                    status = "driver_interrupt";
diff --git a/runltp b/runltp
index 6f15d11..5c096f5 100755
--- a/runltp
+++ b/runltp
@@ -41,6 +41,11 @@
 #               the command file, and it'll use wget to get it (-w)
 #               - now -s does the grep at the selected command files (default,
 #               -f or -w)
+#
+#               Jul 23 2007 - Modified - Ricardo Salveti de Araujo
+#               - added flag to get the command file that has all failed tests
+
+


 setup()
@@ -80,10 +85,12 @@ usage()
 {
     cat <<-EOF >&2

- usage: ./${0##*/} -c [-d TMPDIR] [-f CMDFILES(,...) ] [-i # (in Mb)] - [ -l LOGFILE ] [ -o OUTPUTFILE ] [ -m # (in Mb)] -N -n -q [ -r LTPROOT ]
-    [ -s PATTERN ] [ -t DURATION ] -v [ -w CMDFILEADDR] [ -x INSTANCES ]
+    usage: ./${0##*/} -c [-C FAILCMDFILE ] [-d TMPDIR] [-f CMDFILES(,...) ]
+    [-i # (in Mb)] [ -l LOGFILE ] [ -o OUTPUTFILE ] [ -m # (in Mb)] -N -n -q
+    [ -r LTPROOT ] [ -s PATTERN ] [ -t DURATION ] -v [ -w CMDFILEADDR]
+    [ -x INSTANCES ]
+ -C FAILCMDFILE Command file with all failed test cases.
     -c NUM_PROCS    Run LTP under additional background CPU load.
     -d TMPDIR       Directory where temporary files will be created.
     -e              Prints the date of the current LTP release
@@ -136,12 +143,14 @@ main()
     local PAN_COMMAND=""
     version_date=`head -n 1 $LTPROOT/ChangeLog`

-    while getopts c:d:f:ehi:l:m:Nno:pqr:s:t:vw:x: arg
+    while getopts c:C:d:f:ehi:l:m:Nno:pqr:s:t:vw:x: arg
     do  case $arg in
c) NUM_PROCS=$(($OPTARG))
             $LTPROOT/testcases/bin/genload --cpu $NUM_PROCS >/dev/null 2>&1 &
             GENLOAD=1 ;;
+
+        C)  FAILCMDFILE="-C $OPTARG" ;;
d) # append $$ to TMP, as it is recursively # removed at end of script.
@@ -389,7 +398,7 @@ main()

     [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; }
     PAN_COMMAND="${LTPROOT}/pan/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a 
$$ \
-    -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE"
+    -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE"
     if [ ! -z "$VERBOSE_MODE" ] ; then
       echo "COMMAND:    $PAN_COMMAND"
       if [ ! -z "$TAG_RESTRICT_STRING" ] ; then
@@ -398,7 +407,7 @@ main()
     fi
     #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only 
"PAN_COMMAND" gets output
     ${LTPROOT}/pan/pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \
-    -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE
+    -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE
if [ $? -eq 0 ]; then
       echo "INFO: pan reported all tests PASS"
------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
------------------------------------------------------------------------

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to