Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:55

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 run000001
0027 #the initial json file to read
0028 echo "{\"data\" :[10,10, \"teststreamfile.dat\"]}" >  run000001/run1_ls1_test.jsn
0029 cmsRun streamOut_cfg.py > out 2>&1 || die "cmsRun streamOut_cfg.py" $?
0030 mv teststreamfile.dat run000001/teststreamfile.dat
0031 cmsRun streamOutAlt_cfg.py  > outAlt 2>&1 || die "cmsRun streamOutAlt_cfg.py" $?
0032 cmsRun streamOutExt_cfg.py  > outExt 2>&1 || die "cmsRun streamOutExt_cfg.py" $?
0033 timeout --signal SIGTERM 180 cmsRun streamIn_cfg.py  > in  2>&1 || die "cmsRun streamIn_cfg.py" $?
0034 
0035 echo "{\"data\" :[10,10, \"teststreamfile.dat\"]}" >  run000001/run1_ls1_testAlt.jsn
0036 mv teststreamfile_alt.dat run000001/teststreamfile_alt.dat
0037 rm run000001/run000001_ls0000_EoR.jsn
0038 timeout --signal SIGTERM 180 cmsRun  streamInAlt_cfg.py  > alt  2>&1 || die "cmsRun streamInAlt_cfg.py" $?
0039 
0040 echo "{\"data\" :[10,10, \"teststreamfile.dat\"]}" >  run000001/run1_ls1_testExt.jsn
0041 rm run000001/run000001_ls0000_EoR.jsn
0042 mv teststreamfile_ext.dat run000001/teststreamfile_ext.dat
0043 timeout --signal SIGTERM 180 cmsRun streamInExt_cfg.py  > ext  2>&1 || die "cmsRun streamInExt_cfg.py" $?
0044 
0045 # echo "CHECKSUM = 1" > out
0046 # echo "CHECKSUM = 1" > in
0047 
0048 ANS_OUT_SIZE=`grep -c CHECKSUM out`
0049 ANS_OUT=`grep CHECKSUM out`
0050 ANS_IN=`grep CHECKSUM in`
0051 
0052 if [ "${ANS_OUT_SIZE}" == "0" ]
0053 then
0054     echo "New Stream Test Failed (out was not created)"
0055     RC=1
0056 fi
0057 
0058 if [ "${ANS_OUT}" != "${ANS_IN}" ]
0059 then
0060     echo "New Stream Test Failed (out!=in)"
0061     RC=1
0062 fi
0063 
0064 #rm -rf ${OUTDIR}
0065 exit ${RC}