[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-cvs
Subject:    [Ltp-cvs] ltp runltp,1.17,1.18
From:       Subrata <subrata_modak () users ! sourceforge ! net>
Date:       2007-11-28 11:02:53
Message-ID: E1IxKgw-00072V-9R () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/ltp/ltp
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17886/ltp

Modified Files:
	runltp 
Log Message:
Added an Option to mail-back LTP reports, by Subrata Modak \
<subrata@linux.vnet.ibm.com>


Index: runltp
===================================================================
RCS file: /cvsroot/ltp/ltp/runltp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** runltp	25 Nov 2007 17:03:49 -0000	1.17
--- runltp	28 Nov 2007 11:02:51 -0000	1.18
***************
*** 108,111 ****
--- 108,112 ----
      -v [ -w CMDFILEADDR ] [ -x INSTANCES ]
                  
+     -a EMAIL_TO     EMAIL all your Reports to this E-mail Address
      -c NUM_PROCS    Run LTP under additional background CPU load
                      [NUM_PROCS = no. of processes creating the CPU Load by spinning \
                over sqrt()
***************
*** 162,165 ****
--- 163,167 ----
      local ALT_DIR_RES=0
      local ALT_HTML_OUT=0
+     local ALT_EMAIL_OUT=0
      local RUN_NETEST=0
      local QUIET_MODE=""
***************
*** 176,179 ****
--- 178,182 ----
      local HTMLFILE_NAME=""
      local HTMLFILE=""
+     local EMAIL_TO=""
      local SCENFILES=""
      local TAG_RESTRICT_STRING=""
***************
*** 181,186 ****
      version_date=`head -n 1 $LTPROOT/ChangeLog`
  
!     while getopts c:C:d:D:f:ehi:g:l:m:Nno:pqr:s:t:vw:x: arg
      do  case $arg in
          c)       
              NUM_PROCS=$(($OPTARG))
--- 184,191 ----
      version_date=`head -n 1 $LTPROOT/ChangeLog`
  
!     while getopts a:c:C:d:D:f:ehi:g:l:m:Nno:pqr:s:t:vw:x: arg
      do  case $arg in
+         a)  EMAIL_TO=$OPTARG
+             ALT_EMAIL_OUT=1;;
          c)       
              NUM_PROCS=$(($OPTARG))
***************
*** 388,392 ****
            OUTPUTFILE_NAME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"`
            OUTPUTFILE="-o $LTPROOT/output/LTP_RUN_ON-$OUTPUTFILE_NAME.output"
! 
            if [ ! "$HTMLFILE" ] ; then                        ## User has not \
mentioned HTML File name, We need to create one  HTMLFILE_NAME=`basename \
                $OUTPUTFILE_NAME`
--- 393,397 ----
            OUTPUTFILE_NAME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"`
            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`
***************
*** 622,625 ****
--- 627,704 ----
      fi
   
+     if [ "$ALT_EMAIL_OUT" -eq 1 ] ; then                      ## User wants reports \
to be e-mailed +        if [ [ ! "$HTMLFILE_NAME" ] -o [ ! "$OUTPUTFILE_NAME" ] -o [ \
! "$LOGFILE_NAME" ] ] ; then   +           ##User does not have \
output/logs/html-output, nothing to be mailed in this situation +           echo \
"Nothing to be mailed here...." +        else
+            TAR_FILE_NAME=LTP_RUN_$version_date`date +"%Y_%b_%d-%Hh_%Mm_%Ss"`.tar
+            if [ "$HTMLFILE_NAME" ] ; then                          ## HTML file \
Exists +               if [ "$ALT_HTML_OUT" -ne 1 ] ; then                  ## The \
HTML file path is absolute and not $LTPROOT/output +                  mkdir -p \
$LTPROOT/output                          ## We need to create this Directory +        \
cp $HTMLFILE_NAME $LTPROOT/output/ +               fi
+            fi
+            if [ "$OUTPUTFILE_NAME" ] ; then                        ## Output file \
exists +               if [ "$ALT_DIR_OUT" -ne 1 ] ; then                   ## The \
Output file path is absolute and not $LTPROOT/output +                  mkdir -p \
$LTPROOT/output                          ## We need to create this Directory +        \
cp $OUTPUTFILE_NAME $LTPROOT/output/ +               fi
+            fi
+            if [ "$LOGFILE_NAME" ] ; then                           ## Log file \
exists +               if [ "$ALT_DIR_RES" -ne 1 ] ; then                   ## The \
Log file path is absolute and not $LTPROOT/results +                  mkdir -p \
$LTPROOT/results                         ## We need to create this Directory +        \
cp $LOGFILE_NAME $LTPROOT/results/ +               fi
+            fi
+            if [ -d $LTPROOT/output ] ; then
+               tar -cf  ./$TAR_FILE_NAME $LTPROOT/output
+               if [ $? -eq 0 ]; then
+                  echo "Created TAR File: ./$TAR_FILE_NAME successfully, added \
$LTPROOT/output" +               else
+                  echo "Cannot Create TAR File: ./$TAR_FILE_NAME for adding \
$LTPROOT/output" +               fi
+            fi
+            if [ -d $LTPROOT/results ] ; then
+               tar -uf ./$TAR_FILE_NAME $LTPROOT/results
+               if [ $? -eq 0 ]; then
+                  echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added \
$LTPROOT/results" +               else
+                  echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding \
$LTPROOT/results" +               fi
+            fi
+            if [ -e $LTPROOT/nohup.out ] ; then                     ## If User would \
have Chosen nohup to do ltprun +               tar -uf ./$TAR_FILE_NAME \
$LTPROOT/nohup.out +               if [ $? -eq 0 ]; then
+                  echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added \
$LTPROOT/nohup.out" +               else
+                  echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding \
$LTPROOT/nohup.out" +               fi
+            fi
+            gzip ./$TAR_FILE_NAME                                     ## gzip this \
guy +            if [ $? -eq 0 ]; then
+               echo "Gunzipped TAR File: ./$TAR_FILE_NAME"
+            else
+               echo "Cannot Gunzip TAR File: ./$TAR_FILE_NAME"
+            fi
+            if [ -e /usr/bin/mutt ] ; then                          ## This is a \
better mail client than others +               echo "Starting mailing reports to: \
$EMAIL_TO, file: ./$TAR_FILE_NAME.gz" +               mutt -a ./$TAR_FILE_NAME.gz -s \
"LTP Reports on $test_start_time" $EMAIL_TO < /dev/null +               if [ $? -eq 0 \
]; then +                  echo "Reports Successfully mailed to: $EMAIL_TO"
+               else
+                  echo "Reports cannot be mailed to: $EMAIL_TO"
+               fi
+            else ## Use our Ageold mail program
+               echo "Starting mailing reports to: $EMAIL_TO, file: \
./$TAR_FILE_NAME.gz" +               uuencode ./$TAR_FILE_NAME.gz $TAR_FILE_NAME.gz | \
mail  $EMAIL_TO -s "LTP Reports on $test_start_time" +               if [ $? -eq 0 ]; \
then +                  echo "Reports Successfully mailed to: $EMAIL_TO"
+               else
+                  echo "Reports cannot be mailed to: $EMAIL_TO"
+               fi
+            fi 
+        fi
+     fi
+    
      [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test end time: $(date)" ; }
      


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Ltp-cvs mailing list
Ltp-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic