File indexing completed on 2024-05-31 04:19:07
0001
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 echo "test padding"
0014 cmsRun ${SCRAM_TEST_PATH}/streamOutPadding_cfg.py > outp 2>&1 || die "cmsRun streamOutPadding_cfg.py" $?
0015 cp teststreamfile.dat teststreamfile.padding
0016 mv teststreamfile.dat inDir/
0017 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py > inp 2>&1 || die "cmsRun streamIn_cfg.py with padding" $?
0018 rm -rf inDir
0019
0020 mkdir inDir
0021
0022 echo "test original"
0023 cmsRun ${SCRAM_TEST_PATH}/streamOut_cfg.py > out 2>&1 || die "cmsRun streamOut_cfg.py" $?
0024 cp teststreamfile.dat teststreamfile.original
0025 mv teststreamfile.dat inDir
0026 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py > in 2>&1 || die "cmsRun streamIn_cfg.py original" $?
0027
0028 echo "test original and alt"
0029 rm watcherSourceToken
0030 cp teststreamfile.original inDir/teststreamfile.dat
0031 cmsRun ${SCRAM_TEST_PATH}/streamOutAlt_cfg.py > outAlt 2>&1 || die "cmsRun streamOutAlt_cfg.py" $?
0032 mv teststreamfile_alt.dat inDir
0033 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py --alt >alt 2>&1 || die "cmsRun streamIn_cfg.py alt" $?
0034
0035
0036 echo "test ext"
0037 rm watcherSourceToken
0038 cp teststreamfile.original inDir/teststreamfile.dat
0039 cmsRun ${SCRAM_TEST_PATH}/streamOutExt_cfg.py > outExt 2>&1 || die "cmsRun streamOutExt_cfg.py" $?
0040 mv teststreamfile_ext.dat inDir
0041 timeout --signal SIGTERM 180 cmsRun ${SCRAM_TEST_PATH}/streamIn_cfg.py --ext > ext 2>&1 || die "cmsRun streamIn_cfg.py ext" $?
0042
0043
0044
0045
0046
0047 ANS_OUT_SIZE=`grep -c CHECKSUM out`
0048 ANS_OUT=`grep CHECKSUM out`
0049 ANS_IN=`grep CHECKSUM in`
0050
0051 ANS_OUTP_SIZE=`grep -c CHECKSUM outp`
0052 ANS_OUTP=`grep CHECKSUM outp`
0053 ANS_INP=`grep CHECKSUM inp`
0054
0055 if [ "${ANS_OUT_SIZE}" == "0" ]
0056 then
0057 echo "New Stream Test Failed (out was not created)"
0058 RC=1
0059 fi
0060
0061 if [ "${ANS_OUT}" != "${ANS_IN}" ]
0062 then
0063 echo "New Stream Test Failed (out!=in)"
0064 RC=1
0065 fi
0066
0067 if [ "${ANS_OUTP_SIZE}" == "0" ]
0068 then
0069 echo "New Stream Test Failed (out was not created)"
0070 RC=1
0071 fi
0072
0073 if [ "${ANS_OUTP}" != "${ANS_INP}" ]
0074 then
0075 echo "New Stream Test Failed (out!=in)"
0076 RC=1
0077 fi
0078
0079 exit ${RC}