Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-21 03:38:51

0001 #!/bin/bash
0002 
0003 test=testSwitchProducer
0004 
0005 function die { echo Failure $1: status $2 ; exit $2 ; }
0006 
0007 # Running on multiple threads and streams to test any behavior that
0008 # occurs when there are many of them
0009 NUMTHREADS=4
0010 
0011 pushd ${LOCAL_TMP_DIR}
0012 
0013   echo "*************************************************"
0014   echo "SwitchProducer in a Task"
0015   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}Task_cfg.py || die "cmsRun ${test}Task_cfg.py 1" $?
0016 
0017   echo "*************************************************"
0018   echo "SwitchProducer in a Task, case test2 disabled"
0019   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}Task_cfg.py disableTest2 || die "cmsRun ${test}Task_cfg.py 2" $?
0020 
0021   echo "*************************************************"
0022   echo "SwitchProducer in a Task, SwitchProducers have same labels as products in input file"
0023   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}TaskInput_cfg.py || die "cmsRun ${test}TaskInput_cfg.py 1" $?
0024 
0025   echo "*************************************************"
0026   echo "SwitchProducer in a Task, SwitchProducers have same labels as products in input file, case test2 disabled"
0027   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}TaskInput_cfg.py disableTest2 || die "cmsRun ${test}TaskInput_cfg.py 2" $?
0028 
0029   echo "*************************************************"
0030   echo "Merge outputs (Task)"
0031   cmsRun ${LOCAL_TEST_DIR}/${test}Merge_cfg.py outputFile=testSwitchProducerTaskMerge1.root inputFiles=file:testSwitchProducerTask1.root inputFiles=file:testSwitchProducerTask2.root || die "Merge Task1: order 1 2" $?
0032   echo "*************************************************"
0033   echo "Merge outputs in reverse order (Task)"
0034   cmsRun ${LOCAL_TEST_DIR}/${test}Merge_cfg.py outputFile=testSwitchProducerTaskMerge2.root inputFiles=file:testSwitchProducerTask2.root inputFiles=file:testSwitchProducerTask1.root || die "Merge Task2: order 2 1" $?
0035 
0036   echo "*************************************************"
0037   echo "Test provenance of merged output (Task)"
0038   cmsRun ${LOCAL_TEST_DIR}/${test}ProvenanceAnalyzer_cfg.py testSwitchProducerTaskMerge1.root || die "cmsRun ${test}ProvenanceAnalyzer_cfg.py Task1" $?
0039   echo "*************************************************"
0040   echo "Test provenance of reversely merged output (Task)"
0041   cmsRun ${LOCAL_TEST_DIR}/${test}ProvenanceAnalyzer_cfg.py testSwitchProducerTaskMerge2.root || die "cmsRun ${test}ProvenanceAnalyzer_cfg.py Task2" $?
0042 
0043 
0044   echo "*************************************************"
0045   echo "SwitchProducer in a ConditionalTask"
0046   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}ConditionalTask_cfg.py || die "cmsRun ${test}ConditionalTask_cfg.py 1" $?
0047 
0048   echo "*************************************************"
0049   echo "SwitchProducer in a ConditionalTask, case test2 disabled"
0050   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}ConditionalTask_cfg.py disableTest2 || die "cmsRun ${test}ConditionalTask_cfg.py 2" $?
0051 
0052   echo "*************************************************"
0053   echo "Merge outputs (ConditionalTask)"
0054   cmsRun ${LOCAL_TEST_DIR}/${test}Merge_cfg.py outputFile=testSwitchProducerConditionalTaskMerge1.root inputFiles=file:testSwitchProducerConditionalTask1.root inputFiles=file:testSwitchProducerConditionalTask2.root || die "Merge ConditionalTask1: order 1 2" $?
0055   echo "*************************************************"
0056   echo "Merge outputs in reverse order (ConditionalTask)"
0057   cmsRun ${LOCAL_TEST_DIR}/${test}Merge_cfg.py outputFile=testSwitchProducerConditionalTaskMerge2.root inputFiles=file:testSwitchProducerConditionalTask2.root inputFiles=file:testSwitchProducerConditionalTask1.root || die "Merge ConditionalTask2: order 2 1" $?
0058 
0059   echo "*************************************************"
0060   echo "Test provenance of merged output (ConditionalTask)"
0061   cmsRun ${LOCAL_TEST_DIR}/${test}ProvenanceAnalyzer_cfg.py testSwitchProducerConditionalTaskMerge1.root || die "cmsRun ${test}ProvenanceAnalyzer_cfg.py ConditionalTask1" $?
0062   echo "*************************************************"
0063   echo "Test provenance of reversely merged output (ConditionalTask)"
0064   cmsRun ${LOCAL_TEST_DIR}/${test}ProvenanceAnalyzer_cfg.py testSwitchProducerConditionalTaskMerge2.root || die "cmsRun ${test}ProvenanceAnalyzer_cfg.py ConditionalTask2" $?
0065 
0066   echo "*************************************************"
0067   echo "SwitchProducer in a ConditionalTask, more extensive EDAlias tests"
0068   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}ConditionalTaskEDAlias_cfg.py || die "cmsRun ${test}ConditionalTaskEDAlias_cfg.py 1" $?
0069 
0070   echo "*************************************************"
0071   echo "SwitchProducer in a ConditionalTask, more extensive EDAlias tests, case test2 disabled"
0072   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}ConditionalTaskEDAlias_cfg.py disableTest2 || die "cmsRun ${test}ConditionalTaskEDAlias_cfg.py 2" $?
0073 
0074   echo "*************************************************"
0075   echo "SwitchProducer in a ConditionalTask, test EDAlias with all cases being explicitly consumed"
0076   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}ConditionalTaskEDAliasConsumeAllCases_cfg.py || die "cmsRun ${test}ConditionalTaskEDAliasConsumeAllCases_cfg.py 1" $?
0077 
0078   echo "*************************************************"
0079   echo "SwitchProducer in a ConditionalTask, test EDAlias with all cases being explicitly consumed, case test2 disabled"
0080   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}ConditionalTaskEDAliasConsumeAllCases_cfg.py disableTest2 || die "cmsRun ${test}ConditionalTaskEDAliasConsumeAllCases_cfg.py 2" $?
0081 
0082   
0083   echo "*************************************************"
0084   echo "SwitchProducer in a Path"
0085   cmsRun -n ${NUMTHREADS}  ${LOCAL_TEST_DIR}/${test}Path_cfg.py || die "cmsRun ${test}Path_cfg.py 1" $?
0086 
0087   echo "*************************************************"
0088   echo "SwitchProducer in a Path, case test2 disabled"
0089   cmsRun -n ${NUMTHREADS}  ${LOCAL_TEST_DIR}/${test}Path_cfg.py disableTest2 || die "cmsRun ${test}Path_cfg.py 2" $?
0090 
0091   echo "*************************************************"
0092   echo "Merge outputs (Path)"
0093   cmsRun ${LOCAL_TEST_DIR}/${test}Merge_cfg.py outputFile=testSwitchProducerPathMerge1.root inputFiles=file:testSwitchProducerPath1.root inputFiles=file:testSwitchProducerPath2.root || die "Merge Path1: order 1 2" $?
0094   echo "*************************************************"
0095   echo "Merge outputs in reverse order (Path)"
0096   cmsRun ${LOCAL_TEST_DIR}/${test}Merge_cfg.py outputFile=testSwitchProducerPathMerge2.root inputFiles=file:testSwitchProducerPath2.root inputFiles=file:testSwitchProducerPath1.root || die "Merge Path2: order 2 1" $?
0097 
0098   echo "*************************************************"
0099   echo "Test provenance of merged output (Path)"
0100   cmsRun ${LOCAL_TEST_DIR}/${test}ProvenanceAnalyzer_cfg.py testSwitchProducerPathMerge1.root || die "cmsRun ${test}ProvenanceAnalyzer_cfg.py Path1" $?
0101   echo "*************************************************"
0102   echo "Test provenance of reversely merged output (Path)"
0103   cmsRun ${LOCAL_TEST_DIR}/${test}ProvenanceAnalyzer_cfg.py testSwitchProducerPathMerge2.root || die "cmsRun ${test}ProvenanceAnalyzer_cfg.py Path2" $?
0104 
0105 
0106   echo "*************************************************"
0107   echo "SwitchProducer in a Path after a failing filter"
0108   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}PathFilter_cfg.py || die "cmsRun ${test}PathFilter_cfg.py 1" $?
0109 
0110   echo "*************************************************"
0111   echo "SwitchProducer in a Path after a failing filter, case test2 disabled"
0112   cmsRun -n ${NUMTHREADS}  ${LOCAL_TEST_DIR}/${test}PathFilter_cfg.py disableTest2 || die "cmsRun ${test}PathFilter_cfg.py 2" $?
0113 
0114 
0115   echo "*************************************************"
0116   echo "Keeping SwitchProducer-with-EDAlias and the aliased-for product should fail"
0117   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}AliasOutput_cfg.py && die "cmsRun ${test}AliasOutput_cfg.py did not throw an exception" 1
0118 
0119   echo "*************************************************"
0120   echo "Alias to non-existent product should fail only when a corresponding product is accessed"
0121   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}AliasToNonExistent_cfg.py || die "cmsRun ${test}AliasToNonExistent_cfg.py" $?
0122   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}AliasToNonExistent_cfg.py includeFilter && die "cmsRun ${test}AliasToNonExistent_cfg.py includeFilter did not throw an exception" 1
0123 
0124   echo "*************************************************"
0125   echo "SwitchProducer-with-EDAlias being before the aliased-for producer in a Path should fail"
0126   cmsRun -n ${NUMTHREADS} ${LOCAL_TEST_DIR}/${test}PathWrongOrder_cfg.py && die "cmsRun ${test}PathWrongOrder_cfg.py did not throw an exception" 1
0127 
0128   echo "SwitchProducer tests succeeded"
0129   echo "*************************************************"
0130 
0131 popd
0132 
0133 exit 0