Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:58

0001 #!/bin/bash
0002 
0003 function die { echo Failure $1: status $2 ; exit $2 ; }
0004 
0005 if [ -z  $SCRAM_TEST_PATH ]; then
0006 SCRAM_TEST_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
0007 fi
0008 echo "LOCAL_TEST_DIR = $SCRAM_TEST_PATH"
0009 
0010 RC=0
0011 
0012 mkdir inDir
0013 cmsRun ${SCRAM_TEST_PATH}/streamOutPadding_cfg.py > outp 2>&1 || die "cmsRun streamOutPadding_cfg.py" $?
0014 cp teststreamfile.dat teststreamfile.padding
0015 mv teststreamfile.dat inDir/
0016 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py  > inp  2>&1 || die "cmsRun streamIn_cfg.py" $?
0017 rm -rf inDir
0018 
0019 mkdir inDir
0020 cmsRun ${SCRAM_TEST_PATH}/streamOut_cfg.py > out 2>&1 || die "cmsRun streamOut_cfg.py" $?
0021 cp teststreamfile.dat teststreamfile.original
0022 mv teststreamfile.dat inDir
0023 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py  > in  2>&1 || die "cmsRun streamIn_cfg.py" $?
0024 
0025 rm watcherSourceToken
0026 cp teststreamfile.original inDir/teststreamfile.dat
0027 cmsRun ${SCRAM_TEST_PATH}/streamOutAlt_cfg.py  > outAlt 2>&1 || die "cmsRun streamOutAlt_cfg.py" $?
0028 mv teststreamfile_alt.dat inDir
0029 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py  >alt  2>&1 || die "cmsRun streamIn_cfg.py" $?
0030 #timeout --signal SIGTERM 180 cmsRun  ${SCRAM_TEST_PATH}/streamInAlt_cfg.py  > alt  2>&1 || die "cmsRun streamInAlt_cfg.py" $?
0031 
0032 rm watcherSourceToken
0033 cp teststreamfile.original inDir/teststreamfile.dat
0034 cmsRun ${SCRAM_TEST_PATH}/streamOutExt_cfg.py  > outExt 2>&1 || die "cmsRun streamOutExt_cfg.py" $?
0035 mv teststreamfile_ext.dat inDir
0036 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py  > ext  2>&1 || die "cmsRun streamIn_cfg.py" $?
0037 #timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamInExt_cfg.py  > ext  2>&1 || die "cmsRun streamInExt_cfg.py" $?
0038 
0039 # echo "CHECKSUM = 1" > out
0040 # echo "CHECKSUM = 1" > in
0041 
0042 ANS_OUT_SIZE=`grep -c CHECKSUM out`
0043 ANS_OUT=`grep CHECKSUM out`
0044 ANS_IN=`grep CHECKSUM in`
0045 
0046 ANS_OUTP_SIZE=`grep -c CHECKSUM outp`
0047 ANS_OUTP=`grep CHECKSUM outp`
0048 ANS_INP=`grep CHECKSUM inp`
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_OUTP_SIZE}" == "0" ]
0063 then
0064     echo "New Stream Test Failed (out was not created)"
0065     RC=1
0066 fi
0067 
0068 if [ "${ANS_OUTP}" != "${ANS_INP}" ]
0069 then
0070     echo "New Stream Test Failed (out!=in)"
0071     RC=1
0072 fi
0073 
0074 exit ${RC}