Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:21

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 if [ -z  $TEST_COMPRESSION_ALGO ]; then
0016 TEST_COMPRESSION_ALGO="ZLIB"
0017 fi
0018 echo "TEST_COMPRESSION_ALGO = $TEST_COMPRESSION_ALGO"
0019 
0020 cd $LOCAL_TEST_DIR
0021 
0022 RC=0
0023 P=$$
0024 PREFIX=results_${USER}${P}
0025 OUTDIR=${LOCAL_TMP_DIR}/${PREFIX}
0026 
0027 mkdir ${OUTDIR}
0028 cp *_cfg.py ${OUTDIR}
0029 cd ${OUTDIR}
0030 
0031 cmsRun NewStreamOut_cfg.py compAlgo=${TEST_COMPRESSION_ALGO} > out 2>&1 || die "cmsRun NewStreamOut_cfg.py compAlgo=${TEST_COMPRESSION_ALGO}" $?
0032 cmsRun NewStreamOutAlt_cfg.py compAlgo=${TEST_COMPRESSION_ALGO} > outAlt 2>&1 || die "cmsRun NewStreamOut_cfg.py compAlgo=${TEST_COMPRESSION_ALGO}" $?
0033 cmsRun NewStreamOutExt_cfg.py compAlgo=${TEST_COMPRESSION_ALGO} > outExt 2>&1 || die "cmsRun NewStreamOut_cfg.py compAlgo=${TEST_COMPRESSION_ALGO}" $?
0034 cmsRun --parameter-set NewStreamIn_cfg.py  > in  2>&1 || die "cmsRun NewStreamIn_cfg.py" $?
0035 cmsRun --parameter-set NewStreamIn2_cfg.py  > in2  2>&1 || die "cmsRun NewStreamIn2_cfg.py" $?
0036 cmsRun --parameter-set NewStreamCopy_cfg.py  > copy  2>&1 || die "cmsRun NewStreamCopy_cfg.py" $?
0037 cmsRun --parameter-set NewStreamCopy2_cfg.py  > copy2  2>&1 || die "cmsRun NewStreamCopy2_cfg.py" $?
0038 cmsRun --parameter-set NewStreamInAlt_cfg.py  > alt  2>&1 || die "cmsRun NewStreamInAlt_cfg.py" $?
0039 cmsRun --parameter-set NewStreamInExt_cfg.py  > ext  2>&1 || die "cmsRun NewStreamInExt_cfg.py" $?
0040 
0041 # echo "CHECKSUM = 1" > out
0042 # echo "CHECKSUM = 1" > in
0043 
0044 ANS_OUT_SIZE=`grep -c CHECKSUM out`
0045 ANS_OUT=`grep CHECKSUM out`
0046 ANS_IN=`grep CHECKSUM in`
0047 ANS_IN2=`grep CHECKSUM in2`
0048 ANS_COPY=`grep CHECKSUM copy`
0049 
0050 if [ "${ANS_OUT_SIZE}" == "0" ]
0051 then
0052     echo "New Stream Test Failed (out was not created)"
0053     RC=1
0054 fi
0055 
0056 if [ "${ANS_OUT}" != "${ANS_IN}" ]
0057 then
0058     echo "New Stream Test Failed (out!=in)"
0059     RC=1
0060 fi
0061 
0062 if [ "${ANS_OUT}" != "${ANS_IN2}" ]
0063 then
0064     echo "New Stream Test Failed (out!=in2)"
0065     RC=1
0066 fi
0067 
0068 if [ "${ANS_OUT}" != "${ANS_COPY}" ]
0069 then
0070     echo "New Stream Test Failed (copy!=out)"
0071     RC=1
0072 fi
0073 
0074 #rm -rf ${OUTDIR}
0075 exit ${RC}