#! /bin/sh # script to validate build cdfsoft releases on b0dap30 # this is more or less a copy of the validate_online and the create_kor scripts # 10/10/2000 Hartmut Stadie # List the packages to be validated PKGLIST="Consumer RootMods" # List of Consumer to be validated CONSUMERLIST="YMon TrigMon LumMon Stage0 XMon" # the name THIS=b0validate #set some limits ulimit -f 200 ulimit -t 80 ulimit -c 0 echo "${THIS}: started validation run on `uname -n` at `date`." # Check for arguments if [ $# -gt 2 ] then echo "${THIS}: wrong number of arguments. EXITING" echo "${THIS}: Usage:" echo "${THIS}: validate_packages [baserelease]" exit 1 fi if [ $# -lt 1 ] then echo "${THIS}: wrong number of arguments. EXITING" echo "${THIS}: Usage:" echo "${THIS}: validate_packages [baserelease]" exit 1 fi RELEASE=${1} if [ $# -eq 2 ] then BASERELEASE=${2} else BASERELEASE=${2} fi # get environment . ~cdfsoft/cdf2.shrc setup cdfsoft2 ${BASERELEASE} if [ -d ${BFDIST}/cdfsoftb0/${RELEASE} ] then cd ${BFDIST}/cdfsoftb0/${RELEASE} else echo "${THIS}: release ${RELEASE} does not exist!" exit 1 fi VALFILE=/tmp/validate.${RELEASE}.`whoami`.log VALDIR=/tmp/validate_${RELEASE} echo "${THIS}: validating release ${RELEASE}" #delete old VALFILE if [ -e ${VALFILE} ] then rm ${VALFILE} fi # Run validation echo "This file (${VALFILE}) was created by ${THIS} on `uname -n` at `date`." > ${VALFILE} for PKG in $PKGLIST do if [ -d ${PKG} ] then echo -n "${THIS}: generating test output for ${PKG} package... " gmake ${PKG}.test >> ${VALFILE} 2>&1 echo "done." else echo "${THIS}: Warning: ${PKG} package does not exist." fi done # Check for errors FILE=${VALFILE} if [ -r "${FILE}" ] then echo "${THIS}: will test the output in file ${FILE}" echo -n "${THIS}: checking for build errors..." if [ `grep -c 'gmake\[1' ${FILE}` -gt 0 ] then echo " FAILED." exit 1 else echo " PASSED." fi echo -n "${THIS}: checking for abnormal terminations..." if [ `grep -c 'failed with exit value' ${FILE}` -gt 0 ] then echo " FAILED." exit else echo " PASSED." fi else echo "${THIS}: no validation log available." exit 1 fi # validate run scripts for consumers listed in CONSUMERLIST echo "${THIS}: will check the CSL connection and the run scripts" # we create some files so we need to reset the limits, we kill the consumers # after some minutes time anyhow ulimit -f unlimited ulimit -t 120 ulimit -c 0 ## create test dir if [ -d ${VALDIR} ] then cd ${VALDIR} else if [ -e ${VALDIR} ] then rm ${VALDIR} fi mkdir ${VALDIR} cd ${VALDIR} fi COUNTER=0 for CONSUMER in ${CONSUMERLIST} do echo -n "${THIS}: executing run${CONSUMER} 14..." run${CONSUMER} 14 >> ${VALFILE} 2>&1 & sleep 180 #kill $! PROCESS=`ps | grep ${CONSUMER} | cut -b1-6` kill -9 ${PROCESS} COUNTER=$[ ${COUNTER}+1 ] echo " done" done cd - echo -n "${THIS}: cleaning up..." #delete dir rm -rf ${VALDIR} echo " done." #check if the consumers received events CONSINFO=`grep -c 'Display Server: Add consumer list entry and going to send list to' ${VALFILE}` if [ ${CONSINFO} -eq ${COUNTER} ] then echo "${THIS}: all consumers received events. PASSED" else echo "${THIS}: at least one consumer failed to receive events. FAILED" exit 1 fi echo "${THIS}: no failure in online validation. PASSED" exit 0