Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:02

0001 #!/bin/bash
0002 
0003 function die { echo Failure $1: status $2 ; exit $2 ; }
0004 
0005 if [ -z  $LOCAL_TEST_DIR ]; then
0006 LOCAL_TEST_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
0007 fi
0008 echo "LOCAL_TEST_DIR = $LOCAL_TEST_DIR"
0009 
0010 if [ -z  $LOCAL_TMP_DIR ]; then
0011 LOCAL_TMP_DIR="/tmp"
0012 fi
0013 echo "LOCAL_TMP_DIR = $LOCAL_TMP_DIR"
0014 
0015 cd $LOCAL_TEST_DIR
0016 
0017 RC=0
0018 P=$$
0019 PREFIX=results_${USER}${P}
0020 OUTDIR=${LOCAL_TMP_DIR}/${PREFIX}
0021 
0022 mkdir ${OUTDIR}
0023 cp *_cfg.py ${OUTDIR}
0024 cd ${OUTDIR}
0025 
0026 mkdir inDir
0027 cmsRun streamOut_cfg.py > out 2>&1 || die "cmsRun streamOut_cfg.py" $?
0028 cp teststreamfile.dat teststreamfile.original
0029 mv teststreamfile.dat inDir
0030 timeout --signal SIGTERM 180 cmsRun streamIn_cfg.py  > in  2>&1 || die "cmsRun streamIn_cfg.py" $?
0031 
0032 rm watcherSourceToken
0033 cp teststreamfile.original inDir/teststreamfile.dat
0034 cmsRun streamOutAlt_cfg.py  > outAlt 2>&1 || die "cmsRun streamOutAlt_cfg.py" $?
0035 mv teststreamfile_alt.dat inDir
0036 timeout --signal SIGTERM 180 cmsRun streamIn_cfg.py  >alt  2>&1 || die "cmsRun streamIn_cfg.py" $?
0037 #timeout --signal SIGTERM 180 cmsRun  streamInAlt_cfg.py  > alt  2>&1 || die "cmsRun streamInAlt_cfg.py" $?
0038 
0039 rm watcherSourceToken
0040 cp teststreamfile.original inDir/teststreamfile.dat
0041 cmsRun streamOutExt_cfg.py  > outExt 2>&1 || die "cmsRun streamOutExt_cfg.py" $?
0042 mv teststreamfile_ext.dat inDir
0043 timeout --signal SIGTERM 180 cmsRun streamIn_cfg.py  > ext  2>&1 || die "cmsRun streamIn_cfg.py" $?
0044 #timeout --signal SIGTERM 180 cmsRun streamInExt_cfg.py  > ext  2>&1 || die "cmsRun streamInExt_cfg.py" $?
0045 
0046 # echo "CHECKSUM = 1" > out
0047 # echo "CHECKSUM = 1" > in
0048 
0049 ANS_OUT_SIZE=`grep -c CHECKSUM out`
0050 ANS_OUT=`grep CHECKSUM out`
0051 ANS_IN=`grep CHECKSUM in`
0052 
0053 if [ "${ANS_OUT_SIZE}" == "0" ]
0054 then
0055     echo "New Stream Test Failed (out was not created)"
0056     RC=1
0057 fi
0058 
0059 if [ "${ANS_OUT}" != "${ANS_IN}" ]
0060 then
0061     echo "New Stream Test Failed (out!=in)"
0062     RC=1
0063 fi
0064 
0065 #rm -rf ${OUTDIR}
0066 exit ${RC}