michael@0: #! /bin/sh michael@0: ######################################################################## michael@0: # michael@0: # /u/sonmi/bin/qa_stat - /u/svbld/bin/init/nss/qa_stat michael@0: # michael@0: # this script is supposed to automatically run QA for NSS on all required michael@0: # Unix platforms michael@0: # michael@0: # parameters michael@0: # ---------- michael@0: # nssversion (supported: 30b, 31, tip) michael@0: # builddate (default - today) michael@0: # michael@0: # options michael@0: # ------- michael@0: # -y answer all questions with y - use at your own risk...ignores warnings michael@0: # -s silent (only usefull with -y) michael@0: # -h, -? - you guessed right - displays this text michael@0: # -d debug michael@0: # -f - write the (error)output to filename michael@0: # -m - send filename to mailinglist (csl) only useful michael@0: # with -f michael@0: # -cron equivalient to -y -s -d -f $RESULTDIR/$HOST.qa_stat michael@0: # michael@0: ######################################################################## michael@0: michael@0: O_OPTIONS=ON michael@0: michael@0: TBX_EXIT=49 # in case we are running on a tinderbox build, any michael@0: # early exit needs to return an error michael@0: if [ -z "$O_TBX" -o "$O_TBX" = "OFF" ] ; then michael@0: if [ -z "$O_LOCAL" -o "$O_LOCAL" = "OFF" ] ; then michael@0: . `dirname $0`/header michael@0: fi michael@0: fi michael@0: Debug "Sourced header O_TBX=$O_TBX O_LOCAL=$O_LOCAL" michael@0: TBX_EXIT=48 michael@0: EARLY_EXIT=TRUE michael@0: michael@0: URL="cindercone.red.iplanet.com" michael@0: michael@0: DOCDIR=/u/sonmi/doc michael@0: michael@0: HTML_ERRORCOLOR=\"#FF0000\" michael@0: HTML_ERRORMSG=Failed michael@0: michael@0: HTML_MISSINGCOLOR=\"#FFFFCC\" michael@0: HTML_MISSINGMSG=Missing michael@0: michael@0: HTML_INCOMPLETECOLOR=$HTML_MISSINGCOLOR michael@0: HTML_INCOMPLETEMSG=Incomplete michael@0: michael@0: HTML_PASSEDCOLOR=\"#66FF99\" michael@0: HTML_PASSEDMSG=Passed michael@0: michael@0: # this file is used to deal with hanging rsh - a new shell is started michael@0: # for each rsh, and a function is called after it is finished - they michael@0: # communicate with this file michael@0: michael@0: RSH_FILE=$TMP/rsh.$$ michael@0: echo >$RSH_FILE michael@0: TMPFILES="$TMPFILES $WARNINGLIST $RSH_FILE " michael@0: RSH_WAIT_TIME=80 #maximum time allowed for the 2 rsh to finish... michael@0: #TOTAL_TESTS=106 michael@0: TOTAL_TESTS=252 #tip michael@0: #TOTAL_TESTS=244 #3.4 michael@0: #TOTAL_TESTS=123 #3.3.2 michael@0: BCT_TOTAL_TESTS=122 #3.2.2 michael@0: #TOTAL_TESTS=133 #tip michael@0: michael@0: Debug "NTDIST $NTDIST" michael@0: Debug "UXDIST $UXDIST" michael@0: Debug "TESTSCRIPTDIR $TESTSCRIPTDIR" michael@0: Debug "RESULTDIR $RESULTDIR" michael@0: michael@0: ############################### watch_rsh ############################## michael@0: # local shell function, deals with a hanging rsh (kills it...) michael@0: # this function is started as a backgroundprocess before the rsh is started, michael@0: # and writes info to the RSH_FILE, after the rsh is finished it writes finish michael@0: # info to the same file (this time called as a function, forground). michael@0: # the backgroundprocess stays around for RSH_WAIT_TIME, if then the finish michael@0: # information is not there attempts to kill the rsh michael@0: # michael@0: # watch_rsh start qa_computername & michael@0: # watch_rsh stop qa_computername michael@0: # michael@0: ######################################################################## michael@0: watch_rsh() michael@0: { michael@0: case $1 in michael@0: start) michael@0: echo "$2 started" >>$RSH_FILE michael@0: sleep $RSH_WAIT_TIME michael@0: O_ALWAYS_YES=ON # may modify global flags because this is a michael@0: # forked off bg process - kill_by_name otherwise michael@0: # will ask the user if it really should be killed michael@0: grep "$2 finished" $RSH_FILE >/dev/null || kill_by_name "rsh $2" michael@0: exit michael@0: ;; michael@0: stop) michael@0: echo "$2 finished" >>$RSH_FILE michael@0: ;; michael@0: esac michael@0: } michael@0: michael@0: ############################### find_qa_systems ######################## michael@0: # local shell function, tries to determine the QA operating system michael@0: # works remotely, and for Windows machines michael@0: ######################################################################## michael@0: find_qa_systems() michael@0: { michael@0: for QA_SYS in `ls $RESULTDIR | grep '\.1$' | sed -e "s/\..*//" | sort -u` michael@0: do michael@0: NO_RSH="FALSE" michael@0: QA_OS="" michael@0: QA_RHVER="" michael@0: IS_64="" michael@0: IS_WIN="" michael@0: michael@0: grep OS-LINE ${RESULTDIR}/${QA_SYS}.nssqa >/dev/null && NO_RSH=TRUE michael@0: michael@0: if [ "$NO_RSH" = "TRUE" ] michael@0: then michael@0: michael@0: QA_OS=`grep OS-LINE ${RESULTDIR}/${QA_SYS}.nssqa | sort -u | sed \ michael@0: -e "s/.*-OS-LINE: /${QA_SYS}/"` michael@0: QA_OS_STRING=`echo $QA_OS | sed -e "s/^[_ ]//" -e "s/ /_/g"` michael@0: echo $QA_OS_STRING >>$PLATFORMLIST michael@0: if [ "$O_SILENT" != ON ] ; then michael@0: echo $QA_OS michael@0: fi michael@0: michael@0: #grep OS-LINE ${RESULTDIR}/${QA_SYS}.nssqa | sort -u | sed \ michael@0: #-e "s/.*-OS-LINE: /${QA_SYS}_/" >>$PLATFORMLIST michael@0: #if [ "$O_SILENT" != ON ] ; then michael@0: #grep OS-LINE ${RESULTDIR}/${QA_SYS}.nssqa | sort -u | sed \ michael@0: #-e "s/.*-OS-LINE:/${QA_SYS}/" michael@0: #fi michael@0: else michael@0: REM_SYSNAME=$QA_SYS michael@0: watch_rsh start $REM_SYSNAME & michael@0: qa_stat_get_sysinfo $QA_SYS michael@0: watch_rsh stop $REM_SYSNAME michael@0: echo $QA_OS_STRING >>$PLATFORMLIST michael@0: # use later for missing list michael@0: fi michael@0: done michael@0: michael@0: } michael@0: michael@0: ################################### qa_stat_init ########################## michael@0: # local shell function, sets the name of the resultfile to: michael@0: # if option -f michael@0: # $RESULTDIR/result if write permission michael@0: # (mozilla/tests_results/security/result) michael@0: # $HOME/resultNSS${NSSVER}-${BUILDDATE} if no write permission in $RESULTDIR michael@0: ######################################################################## michael@0: qa_stat_init() michael@0: { michael@0: if [ $O_FILE = ON -a $O_CRON = OFF ] # if -f was specified write there michael@0: then michael@0: RFILE=$FILENAME michael@0: else michael@0: RFILE=${RESULTDIR}/result.$$ michael@0: if [ ! -w $RESULTDIR ] michael@0: then michael@0: RFILE=$HOME/resultNSS${NSSVER}-${BUILDDATE}.$$ michael@0: Debug "Using alternate resultfile $RFILE" michael@0: #elif [ $O_CRON = ON ] michael@0: #then michael@0: ##find ${RESULTDIR} -exec chmod a+rw {} \; #FIXME - umask michael@0: ##doesn't seem to work - this is a tmp workaround michael@0: fi michael@0: michael@0: if [ ! -x $RESULTDIR -o ! -r $RESULTDIR -o ! -w $RESULTDIR ] michael@0: then michael@0: glob_usage "$RESULTDIR does not have the right permissions `ls -l $RESULTDIR`" michael@0: fi michael@0: if [ -d $RESULTDIR ] michael@0: then michael@0: cd $RESULTDIR michael@0: else michael@0: glob_usage "$RESULTDIR does not exist" michael@0: fi michael@0: fi michael@0: michael@0: ERRORLIST=${RFILE}.E michael@0: PLATFORMLIST=${RFILE}.P michael@0: PERFLIST=${RFILE}.PE michael@0: TMP_HTML_FILE=${RFILE}.html michael@0: HTML_FILE=${RESULTDIR}/result.html michael@0: WARNINGLIST=${RFILE}.W michael@0: BCMISSINGLIST=${RFILE}.BCM michael@0: BCERRORLIST=${RFILE}.BCE michael@0: TMPFILE=${RFILE}.T michael@0: ML_FILE=${RFILE}.ML michael@0: michael@0: TMPFILES="$TMPFILES $TMPFILE" michael@0: TMPFILES="$TMPFILES $ERRORLIST $PLATFORMLIST $PERFLIST $WARNINGLIST \ michael@0: $BCMISSINGLIST $BCERRORLIST $ML_FILE" #FIXME uncomment michael@0: michael@0: FILENAME=$RFILE #we might want to mail it...later switch to html file michael@0: O_FILE="ON" michael@0: michael@0: rm $ERRORLIST $PLATFORMLIST $PERFLIST $WARNINGLIST \ michael@0: $BCMISSINGLIST $BCERRORLIST $TMP_HTML_FILE 2>/dev/null michael@0: touch $ERRORLIST $PLATFORMLIST $PERFLIST $WARNINGLIST \ michael@0: $BCMISSINGLIST $BCERRORLIST $TMP_HTML_FILE 2>/dev/null michael@0: michael@0: if [ $O_WIN = "ON" -a "$O_TBX" = "ON" ] ; then michael@0: HTML_PATH="http://${URL}${UX_D0}/nss${NSSVER}/tinderbox/tests_results/security/`basename $RESULTDIR`" michael@0: else michael@0: HTML_PATH="http://${URL}${RESULTDIR}" michael@0: fi michael@0: HREF_TMP_HTML_FILE="${HTML_PATH}/`basename $HTML_FILE`" michael@0: michael@0: write_qa_header_html >$TMP_HTML_FILE michael@0: } michael@0: michael@0: ################################# html_footer ######################### michael@0: # local shell function, writes end of the html body michael@0: ####################################################################### michael@0: write_qa_header_html() michael@0: { michael@0: echo 'Subject: QA Report ' $NSSVER $BUILDDATE ' michael@0: From: sonmi@iplanet.com michael@0: Reply-To: sonmi@iplanet.com michael@0: Content-Type: text/html; charset=us-ascii michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0:
michael@0:   michael@0:
  michael@0:

michael@0: Tinderbox
michael@0: Tinderbox QA result
michael@0: Mozilla Daily NSS QA result

michael@0:   michael@0: michael@0:   michael@0:
  michael@0:
michael@0:

michael@0: QA Results

michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: ' michael@0: } michael@0: michael@0: ################################# html_footer ######################### michael@0: # local shell function, writes end of the html body michael@0: ####################################################################### michael@0: html_footer() michael@0: { michael@0: echo '' michael@0: echo '' michael@0: } michael@0: michael@0: ################################# setQAsysvars ######################### michael@0: # local shell function, sets system specific variables michael@0: ######################################################################## michael@0: setQAsysvars() michael@0: { michael@0: if [ "$MACHINE" != "0" ] michael@0: then michael@0: MACHINE=`echo $MACHINE | sed -e 's/^bct.//g'` michael@0: TESTDATE=`ls -ld $MACHINE | awk '{ print $6, $7, $8 }'` michael@0: TESTNUMBER=`echo $MACHINE | sed -e 's/.*\.//'` michael@0: SYSNAME=`echo $MACHINE | sed -e 's/\..*//'` michael@0: Debug "SYSNAME= $SYSNAME" michael@0: michael@0: if [ "$O_TBX" = "ON" -o "$O_LOCAL" = "ON" ] ; then michael@0: QA_SYS_OS=$QA_OS michael@0: else michael@0: QA_SYS_OS=`grep $SYSNAME $PLATFORMLIST | michael@0: sed -e 's/ michael@0: //' | \ michael@0: sort | uniq | sed -e "s/$SYSNAME//" \ michael@0: -e "s/^_//" | sort | uniq` michael@0: fi michael@0: Debug "QA_SYS_OS= $QA_SYS_OS" michael@0: fi michael@0: BUILD_SYS=`echo $BUILDPLATFORM | sed -e 's/\.OBJ//' -e 's/_DBG/ Debug/' \ michael@0: -e 's/_OPT/ Optimized/' -e 's/_64/ 64bit/' -e 's/_glibc_PTH//' \ michael@0: -e 's/_/ /'` michael@0: Debug "BUILD_SYS=$BUILD_SYS" michael@0: if [ -f "${RESULTDIR}/${MACHINE}/results.html" ] ; then michael@0: RESULT="${HTML_PATH}/${MACHINE}/results.html" michael@0: else michael@0: RESULT="0" michael@0: fi michael@0: if [ -f "${RESULTDIR}/bct/${MACHINE}/results.html" ] ; then michael@0: BCB_RESULT="${HTML_PATH}/bct/${MACHINE}/results.html" michael@0: else michael@0: BCB_RESULT="0" michael@0: fi michael@0: michael@0: if [ -f "${RESULTDIR}/${MACHINE}/output.log" ] ; then michael@0: LOG="${HTML_PATH}/${MACHINE}/output.log" michael@0: else michael@0: LOG="0" michael@0: fi michael@0: if [ -f "${RESULTDIR}/bct/${MACHINE}/output.log" ] ; then michael@0: BCB_LOG="${HTML_PATH}/bct/${MACHINE}/output.log" michael@0: else michael@0: BCB_LOG="0" michael@0: fi michael@0: } michael@0: michael@0: ################################# html_line() ######################### michael@0: # local shell function, writes a line in the html table michael@0: ######################################################################## michael@0: html_line() michael@0: { michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: if [ "$QA_SYS_OS" != "0" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: echo '' michael@0: if [ "$SYSNAME" != "0" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: #echo '' michael@0: echo '' michael@0: # hopefully we never run more different tests on a tinderbox build... michael@0: # on win some shells can not handle exit codes greater then 52 (64???) michael@0: # so for very early exits the codes are set 50-45, for failures later michael@0: # in the process the higher the number, the more failures michael@0: if [ "$O_TBX" = "ON" -a "$TBX_EXIT" -gt 45 ] ; then michael@0: TBX_EXIT=0 michael@0: fi michael@0: if [ "$1" = "failed" ] michael@0: then michael@0: TBX_EXIT=`expr $TBX_EXIT + 1` michael@0: echo '' michael@0: elif [ "$1" = "passed" ] michael@0: then michael@0: echo '' michael@0: elif [ "$1" = "incomplete" ] michael@0: then michael@0: TBX_EXIT=`expr $TBX_EXIT + 1` michael@0: echo '' michael@0: else michael@0: TBX_EXIT=`expr $TBX_EXIT + 1` michael@0: echo '' michael@0: fi michael@0: if [ "$CURRENT_TABLE" != "BC" ] ; then michael@0: if [ "$RESULT" = "0" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: if [ "$LOG" = "0" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: if [ "$1" = "failed" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: else michael@0: # michael@0: # michael@0: # michael@0: michael@0: #echo '' michael@0: #echo '' michael@0: #echo '' michael@0: #if [ "$RESULT" != "0" -a "$LOG" != "0" ] ; then michael@0: #echo '' michael@0: #elif [ "$RESULT" = "0" -a "$LOG" != "0" ] ; then michael@0: #echo '' michael@0: #elif [ "$RESULT" != "0" -a "$LOG" = "0" ] ; then michael@0: #echo '' michael@0: #else michael@0: #echo '' michael@0: #fi michael@0: #if [ "$BCB_RESULT" != "0" -a "$BCB_LOG" != "0" ] ; then michael@0: #echo '' michael@0: #elif [ "$BCB_RESULT" = "0" -a "$BCB_LOG" != "0" ] ; then michael@0: #echo '' michael@0: #elif [ "$BCB_RESULT" != "0" -a "$BCB_LOG" = "0" ] ; then michael@0: #echo '' michael@0: #else michael@0: #echo '' michael@0: #fi michael@0: if [ "$BCB_RESULT" = "0" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: if [ "$BCB_LOG" = "0" ] ; then michael@0: echo '' michael@0: else michael@0: echo '' michael@0: fi michael@0: fi michael@0: echo '' michael@0: echo '' michael@0: } michael@0: michael@0: ################################# qa_errorlist ######################### michael@0: # local shell function, finds problems in the previously run QA michael@0: # linux:the gnu grep, on Linux can output 10 lines above and 3 lines below michael@0: # the errormessage michael@0: ######################################################################## michael@0: qa_errorlist() michael@0: { michael@0: grep "bgcolor=red" ${MACHINES_TO_CHECK}*/results.html | michael@0: sed -e 's/.results.html:' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: #echo '' michael@0: #echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: michael@0: } michael@0: michael@0: old_bc_test() michael@0: { michael@0: CURRENT_TABLE="BC" #so html_line can determine which fields to write michael@0: michael@0: qa_stat_table "Backward Compatibility Test" michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: #echo '' michael@0: #echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: michael@0: for w in `ls */results.html` michael@0: do michael@0: TMP_RESULT="`dirname $w`/results.tmp" michael@0: TMP_BC_RESULT="`dirname bct/$w`/results.tmp" michael@0: rm $TMP_RESULT $TMP_BC_RESULT 2>/dev/null michael@0: cat $w | sed -e 's/<[^>]*>//g' -e 's/ /_/g' \ michael@0: -e 's/signtool_-[vw]/signtool_-vw/' | michael@0: grep '_[PF]a[si][sl]ed' >$TMP_RESULT michael@0: cat bct/$w | sed -e 's/<[^>]*>//g' -e 's/ /_/g' \ michael@0: -e 's/signtool_-[vw]/signtool_-vw/' | michael@0: grep '_[PF]a[si][sl]ed' >$TMP_BC_RESULT michael@0: diff $TMP_RESULT $TMP_BC_RESULT 2>>$BCMISSINGLIST | michael@0: grep -v "Create_objsign_cert_.signtool_-G.*Passed" | michael@0: grep -v "porting_Alice.s_email_cert" | michael@0: grep -v "^[0-9,cad]*$" | grep -v "^---$" | grep -v "^---.$" | michael@0: grep -v "Can.t_run_pk12util_tests_for_NSS_3.2" >/dev/null && ( michael@0: echo "$w differs" >> $BCMISSINGLIST michael@0: echo "=========================================" michael@0: echo "diff $w bct/$w" michael@0: echo "=========================================" michael@0: diff $TMP_RESULT $TMP_BC_RESULT 2>&1 | michael@0: grep -v "Create_objsign_cert_.signtool_-G.*Passed" | michael@0: grep -v "porting_Alice.s_email_cert" | michael@0: grep -v "Can.t_run_pk12util_tests_for_NSS_3.2" michael@0: ) 2>&1 >>$BCERRORLIST michael@0: michael@0: #diff -b $w bct/$w 2>>$BCMISSINGLIST | michael@0: #grep -v "Create objsign cert .signtool -G.*Passed" | michael@0: #grep -v "Listing signed files in jar .signtool -v.*Passed" | michael@0: #grep -v "Listing signed files in jar .signtool -w.*Passed" | michael@0: #grep -v "backward compatibility" | michael@0: #grep -v "Can.t run pk12util tests for NSS 3.2" | michael@0: #grep -v "porting Alice.s email cert " | michael@0: #grep -v "^---$" | grep -v "^[<> ] $" | michael@0: #grep -v "^---.$" | grep -v "^[<> ] .$" | michael@0: #grep -v '< ' | michael@0: #grep -v "^[0-9,cad]*$" 2>>$BCMISSINGLIST >/dev/null && ( michael@0: #echo "$w differs" >> $BCMISSINGLIST michael@0: #echo "=========================================" michael@0: #echo "diff $w bct/$w" michael@0: #echo "=========================================" michael@0: #diff -b $w bct/$w 2>&1 | michael@0: #grep -v "Listing signed files in jar .signtool -v.*Passed" | michael@0: #grep -v "Listing signed files in jar .signtool -w.*Passed" | michael@0: #grep -v "backward compatibility" | michael@0: #grep -v "Can.t run pk12util tests for NSS 3.2" | michael@0: #grep -v "porting Alice.s email cert " | michael@0: #grep -v "^---$" | grep -v "^[<> ] $" | michael@0: #grep -v "^---.$" | grep -v "^[<> ] .$" | michael@0: #grep -v '< ' | michael@0: #grep -v "^[0-9,cad]*$" \ michael@0: #) 2>&1 >>$BCERRORLIST michael@0: rm $TMP_RESULT $TMP_BC_RESULT 2>/dev/null michael@0: done michael@0: rm $ERRORLIST michael@0: cat $BCMISSINGLIST | sed -e "s/^diff: bc_...s.//" \ michael@0: -e "s/.results.html.*/\/results.html/" | michael@0: sort -u > $ERRORLIST michael@0: michael@0: platformlist michael@0: echo '
 Build-OS and versionQA-OSSystemnameP/FresultoutputerrorsQA time / #
'$BUILD_SYS''$QA_SYS_OS''$SYSNAME''$SYSNAME $TESTNUMBER $TESTDATE''$HTML_ERRORMSG''$HTML_PASSEDMSG''$HTML_INCOMPLETEMSG''$HTML_MISSINGMSG''$HTML_MISSINGMSG' result '$HTML_MISSINGMSG' log  error errorsP/FP/FAll Currentold dllsold executablesresult, loglogresult'$HTML_MISSINGMSG'result, loglogresult'$HTML_MISSINGMSG''$HTML_MISSINGMSG' result '$HTML_MISSINGMSG' log '$TESTDATE $TESTNUMBER'
/ /' -e 's/<[^>]*>/ /g' michael@0: grep 'cache hits; .* cache misses, .* cache not reusable' \ michael@0: ${MACHINES_TO_CHECK}*/output.log | michael@0: grep strsclnt | michael@0: grep -v '0 cache hits; 0 cache misses, 0 cache not reusable' | michael@0: grep -v ' cache hits; 1 cache misses, 0 cache not reusable' michael@0: for logfile in ${MACHINES_TO_CHECK}*/output.log; do michael@0: grep -vi "write to SSL socket" $logfile | michael@0: grep -vi "HDX PR_Read returned error" | michael@0: grep -vi "no error" | michael@0: grep -vi "12285" | michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP error michael@0: #grep -vi "5938" | needed for -v option michael@0: #grep -vi "HDX PR_Read hit EOF" | michael@0: grep -vi "write to SSL socket" $logfile | michael@0: grep -vi "peer cannot verify" | michael@0: grep -vi "error" | michael@0: grep -vi "fatal" | michael@0: grep -vi "TCP Connection aborted" | michael@0: grep -vi "TCP connection reset" | michael@0: grep $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP -i failed michael@0: done michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "segmentation violation" \ michael@0: ${MACHINES_TO_CHECK}*/output.log michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "memory fault" \ michael@0: ${MACHINES_TO_CHECK}*/output.log michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "bus error" \ michael@0: ${MACHINES_TO_CHECK}*/output.log michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "core dumped" \ michael@0: ${MACHINES_TO_CHECK}*/output.log michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP fatal \ michael@0: ${MACHINES_TO_CHECK}*/output.log michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP -i\ michael@0: "PKCS12 decode not verified" ${MACHINES_TO_CHECK}*/output.log michael@0: michael@0: if [ -n "${MACHINES_TO_CHECK}" ] ; then michael@0: find ${MACHINES_TO_CHECK}* -name core -print 2>/dev/null | michael@0: grep -v bct michael@0: else michael@0: find . -name core -print 2>/dev/null | michael@0: grep -v bct michael@0: fi michael@0: } michael@0: michael@0: tbx_missing_platforms () michael@0: { michael@0: QA_MISSING="QA report missing" michael@0: MACHINE="0" michael@0: michael@0: if [ "$QA_OS_STRING" = "WINNT4.0" ] ; then michael@0: QA_OS_STRING="Windows-NT-4.0" michael@0: fi michael@0: for BUILDPLATFORM in `grep $QA_OS_STRING $TESTSCRIPTDIR/platformlist.tbx` michael@0: do michael@0: if [ "$BUILDPLATFORM" != "$QA_OS_STRING" ] ; then michael@0: Debug "BUILDPLATFORM = $BUILDPLATFORM QA_OS_STRING = $QA_OS_STRING" michael@0: grep $BUILDPLATFORM ${MACHINES_TO_CHECK}*/results.html \ michael@0: >/dev/null || { michael@0: setQAsysvars michael@0: html_line missing >>$TMP_HTML_FILE michael@0: } michael@0: fi michael@0: done michael@0: } michael@0: michael@0: ############################ platform _list ########################### michael@0: # local shell function, generate pass/fail information for each Platform michael@0: ######################################################################## michael@0: platformlist() michael@0: { michael@0: grep Platform ${MACHINES_TO_CHECK}*/results.html | michael@0: sed -e 's/.results.html:

Platform: /---/' \ michael@0: -e 's/
//' >$TMPFILE michael@0: # this is done a little complicated to avoid starting a subshell in michael@0: # a while read that gets the input from a pipeline, and variables set michael@0: #in or underneath this function get unset after done... michael@0: for MB in `cat $TMPFILE` ; do michael@0: MACHINE=`echo $MB | sed -e "s/---.*//"` michael@0: BUILDPLATFORM=`echo $MB | sed -e "s/.*---//"` michael@0: grep "${MACHINE}[^0-9]" $ERRORLIST >/dev/null michael@0: ret=$? michael@0: setQAsysvars michael@0: if [ $ret -eq 0 ] michael@0: then michael@0: echo "Failed $MACHINE $BUILDPLATFORM" >>$RFILE michael@0: html_line failed >>$TMP_HTML_FILE michael@0: else michael@0: echo "Passed $MACHINE $BUILDPLATFORM" >>$RFILE michael@0: html_line passed >>$TMP_HTML_FILE michael@0: fi michael@0: done michael@0: } michael@0: michael@0: ############################ missing_platforms ########################### michael@0: # local shell function, finds out if we ran on all required platforms michael@0: ######################################################################## michael@0: missing_platforms() michael@0: { michael@0: QA_MISSING="QA report missing" michael@0: MACHINE="0" michael@0: SYSNAME="0" michael@0: QA_SYS_OS="0" michael@0: michael@0: for BUILDPLATFORM in `cat $TESTSCRIPTDIR/platformlist` michael@0: do michael@0: grep $BUILDPLATFORM $PLATFORMLIST > /dev/null || { michael@0: setQAsysvars michael@0: html_line missing >>$TMP_HTML_FILE michael@0: } michael@0: done michael@0: } michael@0: michael@0: ############################ incomplete_results ########################### michael@0: # local shell function, finds out if all qa runs were complete michael@0: ######################################################################## michael@0: incomplete_results () michael@0: { michael@0: michael@0: for w in `ls ${MACHINES_TO_CHECK}*/results.html` michael@0: do michael@0: grep bgcolor=red $w || { michael@0: PASSED_LINES="" michael@0: PASSED_LINES=`grep bgcolor=lightGreen $w | wc -l` michael@0: if [ -n "$PASSED_LINES" -a "$PASSED_LINES" -lt "$TOTAL_TESTS" ] ; then michael@0: BUILDPLATFORM=`grep Platform $w | sed -e 's/

Platform:/ /' -e 's/
//'` michael@0: MACHINE=`echo $w | sed -e "s/.results.html//"` michael@0: #MACHINE=`echo $w | sed -e "s/\.[0-9]*.results.html//"` michael@0: setQAsysvars michael@0: html_line incomplete >>$TMP_HTML_FILE michael@0: elif [ "$PASSED_LINES" -gt "$TOTAL_TESTS" ] ; then michael@0: echo "WARNING - more tests than expected on $w ($PASSED_LINES)" >>$WARNINGLIST michael@0: fi michael@0: } michael@0: done michael@0: } michael@0: michael@0: qa_stat_table() michael@0: { michael@0: echo ' ' michael@0: echo '
 ' michael@0: echo '
' michael@0: echo '

' michael@0: echo ''$1'

' michael@0: echo ' ' michael@0: echo '' michael@0: echo '' michael@0: } michael@0: michael@0: ############################### psaperf ######################## michael@0: # local shell function, copies results of the daily performance test michael@0: # into a table in the QA report michael@0: ######################################################################## michael@0: rsaperf() michael@0: { michael@0: grep RSAPERF */output.log | grep -v "_DBG" > $PERFLIST michael@0: michael@0: qa_stat_table "Performance list" michael@0: michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: cat $PERFLIST | michael@0: while read MACHINE BUILDPLATFORM no_iter t1 t2 total total_unit t3 \ michael@0: t4 t5 average average_unit michael@0: do michael@0: #caution subshell, variables local to this loop michael@0: BUILD_SYS=`echo $BUILDPLATFORM | sed -e 's/\.OBJ//' \ michael@0: -e 's/_DBG/ Debug/' \ michael@0: -e 's/_OPT/ Optimized/' -e 's/_64/ 64bit/' -e 's/_glibc_PTH//' \ michael@0: -e 's/_/ /'` michael@0: TESTNUMBER=`echo $MACHINE | sed -e 's/[^\.]*\.//' -e 's/\/.*//'` michael@0: MACHINE=`echo $MACHINE | sed -e 's/\..*//'` michael@0: TESTDATE=`ls -ld ${MACHINE}.${TESTNUMBER} | awk '{ print $6, $7, $8 }'` michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: echo '' michael@0: done michael@0: echo '
Build-OS and versionSystemname# of iterationsaverage for one opTotalQA time / #
'$BUILD_SYS''$MACHINE''$no_iter''$average' '$average_unit''$total' '$total_unit''$TESTDATE $TESTNUMBER'
' michael@0: } michael@0: michael@0: ############################### qa_stat_cleanup ######################## michael@0: # local shell function, finishes html file, sets variables for global Exit michael@0: ######################################################################## michael@0: qa_stat_cleanup() michael@0: { michael@0: michael@0: html_footer >>$TMP_HTML_FILE michael@0: michael@0: O_DEBUG=OFF michael@0: michael@0: EARLY_EXIT=FALSE michael@0: cp $TMP_HTML_FILE $HTML_FILE michael@0: FILENAME=$HTML_FILE #we might want to mail it... michael@0: Exit michael@0: } michael@0: michael@0: michael@0: ############################### bc_test ######################## michael@0: # local shell function, evaluates the results of the backward u michael@0: # compatibility tests michael@0: ######################################################################## michael@0: bc_header() michael@0: { michael@0: CURRENT_TABLE="BC" #so html_line can determine which fields to write michael@0: michael@0: qa_stat_table "Backward Compatibility Test" michael@0: echo '

Build-OS and versionQA-OSSystemnameP/FAll Currentbackward comp. testresultoutputQA time / #
Build-OS and versionQA-OSSystemnameP/FAll Currentbackward comp. testresultoutputQA time / #
' >>$TMP_HTML_FILE michael@0: michael@0: head -200 $BCERRORLIST | sed -e 's/<[^>]*>//g' -e "s/^/
/" michael@0: } michael@0: michael@0: bc_test() michael@0: { michael@0: CURRENT_TABLE="BC" #so html_line can determine which fields to write michael@0: michael@0: qa_stat_table "Backward Compatibility Test" michael@0: echo 'Build-OS and version' michael@0: echo 'QA-OS' michael@0: echo 'Systemname' michael@0: echo 'P/F' michael@0: #echo 'All Current' michael@0: #echo 'backward comp. test' michael@0: echo 'result' michael@0: echo 'output' michael@0: echo 'QA time / #' michael@0: echo '' michael@0: michael@0: set -x michael@0: for w in `ls */results.html` michael@0: do michael@0: BCT_DIR=`dirname "bct/$w"` michael@0: BCT_RESULT="bct/$w" michael@0: BCT_LOG="$BCT_DIR/output.log" michael@0: grep "bgcolor=red" $BCT_RESULT | michael@0: sed -e 's/.results.html:/ /' -e 's/<[^>]*>/ /g' michael@0: grep 'cache hits; .* cache misses, .* cache not reusable' \ michael@0: $BCT_LOG | michael@0: grep -v selfserv | michael@0: grep -v '0 cache hits; 1 cache misses, 0 cache not reusable' | michael@0: grep -v '0 cache hits; 0 cache misses, 0 cache not reusable' | michael@0: grep -v ' cache hits; 1 cache misses, 0 cache not reusable' michael@0: grep -vi "write to SSL socket" $BCT_LOG | michael@0: grep -vi "HDX PR_Read returned error" | michael@0: grep -vi "no error" | michael@0: grep -vi "12285" | michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP error michael@0: grep -vi "write to SSL socket" $BCT_LOG | michael@0: grep -vi "peer cannot verify" | michael@0: grep -vi "TCP Connection aborted" | michael@0: grep -vi "error" | michael@0: grep -vi "fatal" | michael@0: grep -vi "TCP connection reset" | michael@0: grep $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP -i failed $BCT_LOG michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "segmentation violation" $BCT_LOG michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "memory fault" $BCT_LOG michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "bus error" $BCT_LOG michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP "core dumped" $BCT_LOG michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP fatal $BCT_LOG michael@0: grep -i $BEFORE_CONTEXT_GREP $AFTER_CONTEXT_GREP -i "PKCS12 decode not verified" $BCT_LOG michael@0: find ${BTC_DIR} -name core -print michael@0: michael@0: done 2>&1 >>$BCERRORLIST michael@0: rm $ERRORLIST michael@0: cat $BCMISSINGLIST | sed -e "s/^diff: bc_...s.//" \ michael@0: -e "s/.results.html.*/\/results.html/" | michael@0: sort -u > $ERRORLIST michael@0: michael@0: platformlist michael@0: echo '' >>$TMP_HTML_FILE michael@0: michael@0: head -200 $BCERRORLIST | sed -e 's/<[^>]*>//g' -e "s/^/
/" michael@0: } michael@0: michael@0: michael@0: ############################### bc_test ######################## michael@0: # local shell function, evaluates the results of the backward u michael@0: # compatibility tests michael@0: # move the whole function to old to tests a new solution michael@0: ######################################################################## michael@0: bc_test_old() michael@0: { michael@0: CURRENT_TABLE="BC" #so html_line can determine which fields to write michael@0: michael@0: qa_stat_table "Backward Compatibility Test" michael@0: echo 'Build-OS and version' michael@0: echo 'QA-OS' michael@0: echo 'Systemname' michael@0: echo 'P/F' michael@0: #echo 'All Current' michael@0: #echo 'backward comp. test' michael@0: echo 'result' michael@0: echo 'output' michael@0: echo 'QA time / #' michael@0: echo '' michael@0: michael@0: for w in `ls */results.html` michael@0: do michael@0: diff -b $w bct/$w 2>>$BCMISSINGLIST | michael@0: grep -v "Create objsign cert .signtool -G.*Passed" | michael@0: grep -v "Listing signed files in jar .signtool -v.*Passed" | michael@0: grep -v "Listing signed files in jar .signtool -w.*Passed" | michael@0: grep -v "backward compatibility" | michael@0: grep -v "Can.t run pk12util tests for NSS 3.2" | michael@0: grep -v "porting Alice.s email cert " | michael@0: grep -v "^---$" | grep -v "^[<> ] $" | michael@0: grep -v "^---.$" | grep -v "^[<> ] .$" | michael@0: grep -v '< ' | michael@0: grep -v "^[0-9,cad]*$" 2>>$BCMISSINGLIST >/dev/null && ( michael@0: echo "$w differs" >> $BCMISSINGLIST michael@0: echo "=========================================" michael@0: echo "diff $w bct/$w" michael@0: echo "=========================================" michael@0: diff -b $w bct/$w 2>&1 | michael@0: grep -v "Listing signed files in jar .signtool -v.*Passed" | michael@0: grep -v "Listing signed files in jar .signtool -w.*Passed" | michael@0: grep -v "backward compatibility" | michael@0: grep -v "Can.t run pk12util tests for NSS 3.2" | michael@0: grep -v "porting Alice.s email cert " | michael@0: grep -v "^---$" | grep -v "^[<> ] $" | michael@0: grep -v "^---.$" | grep -v "^[<> ] .$" | michael@0: grep -v '< ' | michael@0: grep -v "^[0-9,cad]*$" \ michael@0: ) 2>&1 >>$BCERRORLIST michael@0: done michael@0: rm $ERRORLIST michael@0: cat $BCMISSINGLIST | sed -e "s/^diff: bc_...s.//" \ michael@0: -e "s/.results.html.*/\/results.html/" | michael@0: sort -u > $ERRORLIST michael@0: michael@0: platformlist michael@0: echo '' >>$TMP_HTML_FILE michael@0: michael@0: head -200 $BCERRORLIST | sed -e 's/<[^>]*>//g' -e "s/^/
/" michael@0: michael@0: } michael@0: michael@0: ############################### tbx_main ######################## michael@0: # local shell function, tinderbox variation of the qa status script michael@0: ######################################################################## michael@0: tbx_main() michael@0: { michael@0: TBX_EXIT=47 michael@0: qa_stat_get_sysinfo # find out the OS we are running and all required tests michael@0: # on this OS michael@0: michael@0: MACHINES_TO_CHECK=$HOST #`uname -n` only search the local tests for errors michael@0: qa_errorlist > $ERRORLIST # michael@0: platformlist michael@0: #tbx_missing_platforms #temp. taken out until we find a better way to michael@0: #determine if all necessary QA ran - right now we run different michael@0: #tinderboxes on one machine michael@0: incomplete_results michael@0: echo '' >>$TMP_HTML_FILE michael@0: echo '' >> $TMP_HTML_FILE michael@0: cat $ERRORLIST | sed -e "s/^/
/" >>$TMP_HTML_FILE michael@0: michael@0: } michael@0: michael@0: ############################### qa_stat_main ######################## michael@0: # local shell function, main flow of the qa status script michael@0: ######################################################################## michael@0: qa_stat_main() michael@0: { michael@0: find_qa_systems 2>/dev/null michael@0: MACHINES_TO_CHECK="" # check all founf qa runs michael@0: qa_errorlist > $ERRORLIST michael@0: platformlist michael@0: missing_platforms michael@0: incomplete_results michael@0: echo '' >>$TMP_HTML_FILE michael@0: echo '' >> $TMP_HTML_FILE michael@0: cat $ERRORLIST | sed -e "s/^/
/" >>$TMP_HTML_FILE michael@0: cat $WARNINGLIST 2>/dev/null | sed -e "s/^/
/" >>$TMP_HTML_FILE 2>/dev/null michael@0: rsaperf >>$TMP_HTML_FILE michael@0: bc_header >>$TMP_HTML_FILE michael@0: MACHINES_TO_CHECK="bct/" michael@0: TOTAL_TESTS=$BCT_TOTAL_TESTS michael@0: BEFORE_CONTEXT_GREP="" #WORKAROUND - errors in one outputlog within the first michael@0: AFTER_CONTEXT_GREP="" # or last lines will show up in the next/previos file michael@0: qa_errorlist > $ERRORLIST michael@0: platformlist michael@0: missing_platforms michael@0: incomplete_results michael@0: echo '' >>$TMP_HTML_FILE michael@0: echo '' >> $TMP_HTML_FILE michael@0: cat $ERRORLIST | sed -e "s/^/
/" >>$TMP_HTML_FILE michael@0: cat $WARNINGLIST 2>/dev/null | sed -e "s/^/
/" >>$TMP_HTML_FILE 2>/dev/null michael@0: #bc_test >>$TMP_HTML_FILE michael@0: } michael@0: michael@0: CURRENT_TABLE="Standard" michael@0: qa_stat_init michael@0: michael@0: if [ "$O_TBX" = "ON" -o "$O_LOCAL" = "ON" ] ; then michael@0: tbx_main michael@0: else michael@0: qa_stat_main michael@0: fi michael@0: michael@0: qa_stat_cleanup