Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-27 07:20:10

0001 #!/bin/bash
0002 
0003 function die { echo Failure $1: status $2 ; exit $2 ; }
0004 function runSuccess {
0005     echo "cmsRun $@"
0006     cmsRun $@ || die "cmsRun $*" $?
0007     echo
0008 }
0009 function runFailure {
0010     echo "cmsRun $@ (expected to fail)"
0011     cmsRun $@ && die "cmsRun $*" 1
0012     echo
0013 }
0014 
0015 VERSION_ARR=(${CMSSW_VERSION//_/ })
0016 VERSION1="${VERSION_ARR[0]}_${VERSION_ARR[1]}_${VERSION_ARR[2]}_0"
0017 VERSION2="${VERSION_ARR[0]}_${VERSION_ARR[1]}_${VERSION_ARR[2]}_1"
0018 VERSION3="${VERSION_ARR[0]}_${VERSION_ARR[1]}_$((${VERSION_ARR[2]}+1))_0"
0019 
0020 # Check that changing the patch version does not lead to new lumi or run
0021 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistoryCreate_cfg.py --version ${VERSION1} --firstEvent 1 --output version1.dat
0022 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistoryCreate_cfg.py --version ${VERSION2} --firstEvent 101 --output version2.dat
0023 
0024 CatStreamerFiles merged.dat version1.dat version2.dat
0025 
0026 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistory_cfg.py --input merged.dat --output merged.root
0027 
0028 edmProvDump merged.root | grep -q "PROD.*'${VERSION1}'" || die "Did not find ${VERSION1} from merged.root provenance" $?
0029 edmProvDump merged.root | grep -q "PROD.*'${VERSION2}'" || die "Did not find ${VERSION2} from merged.root provenance" $?
0030 
0031 
0032 # Check that changing the minor version leads to new lumi
0033 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistoryCreate_cfg.py --version ${VERSION3} --firstEvent 201 --output version3_lumi.dat
0034 
0035 CatStreamerFiles merged3_lumi.dat version1.dat version3_lumi.dat
0036 
0037 runFailure ${SCRAM_TEST_PATH}/testReducedProcessHistory_cfg.py --input merged3_lumi.dat --output merged3_lumi.root
0038 
0039 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistory_cfg.py --input merged3_lumi.dat --output merged3_lumi.root --expectNewLumi
0040 
0041 edmProvDump merged3_lumi.root | grep -q "PROD.*'${VERSION3}'" || die "Did not find ${VERSION3} from merged3_lumi.root provenance" $?
0042 
0043 
0044 # Check that changing the minor version leads to new run
0045 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistoryCreate_cfg.py --version ${VERSION3} --firstEvent 201 --lumi 2 --output version3_run.dat
0046 
0047 CatStreamerFiles merged3_run.dat version1.dat version3_run.dat
0048 
0049 runFailure ${SCRAM_TEST_PATH}/testReducedProcessHistory_cfg.py --input merged3_run.dat --output merged3_run.root
0050 
0051 runSuccess ${SCRAM_TEST_PATH}/testReducedProcessHistory_cfg.py --input merged3_run.dat --output merged3_run.root --expectNewRun
0052 
0053 edmProvDump merged3_run.root | grep -q "PROD.*'${VERSION3}'" || die "Did not find ${VERSION3} from merged3_run.root provenance" $?
0054 
0055 exit 0