Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-19 01:44:00

0001 #!/bin/bash
0002 set -x
0003 LOCAL_TEST_DIR=${CMSSW_BASE}/src/FWCore/Integration/test
0004 LOCAL_TMP_DIR=${CMSSW_BASE}/tmp/${SCRAM_ARCH}
0005 
0006 function die { echo Failure $1: status $2 ; exit $2 ; }
0007 
0008 pushd ${LOCAL_TMP_DIR}
0009 
0010 # The tests executed by this bash script are all related and
0011 # it seemed clearest to include them all in the same file.
0012 # These tests are divided into distinct groups. Each time
0013 # the script runs, it will execute only one group of tests.
0014 # The script requires that its first command line argument
0015 # specifies the group to be run. The "if" conditional statements
0016 # below implement this. The BuildFile directs scram to run
0017 # this script once for each group when unit tests are run.
0018 # The BuildFile also specifies the dependencies between the
0019 # groups. In some cases, one group cannot run until another
0020 # group of tests has finished. The purpose of this is to
0021 # allow maximum concurrency while running the tests so the
0022 # tests can run faster.
0023 
0024 if [ $1 -eq 1 ]
0025 then
0026   echo "testProcessBlock1"
0027   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlock1_cfg.py &> testProcessBlock1.log || die "cmsRun testProcessBlock1_cfg.py" $?
0028 
0029   # The MetaData ProcessBlock branch and the TTree should exist to hold the ProcessBlock
0030   # data. The Events branch should not exist because there were not any ProcessBlock branches
0031   # saved from an input file. Test that here:
0032   edmFileUtil -l -t MetaData -P file:testProcessBlock1.root > testProcessBlock1ContentsM.txt
0033   grep "Branch.* ProcessBlockHelper " testProcessBlock1ContentsM.txt || die "Check for existence of ProcessBlockHelper branch" $?
0034   grep "TTree.*ProcessBlocksPROD1" testProcessBlock1ContentsM.txt || die "Check for existence of ProcessBlocksPROD1 TTree" $?
0035   edmFileUtil -t Events -P file:testProcessBlock1.root > testProcessBlock1ContentsE.txt
0036   grep "Branch.* EventToProcessBlockIndexes " testProcessBlock1ContentsE.txt && die "Check for non-existence of eventToProcessBlockIndexes branch" 1
0037 fi
0038 
0039 if [ $1 -eq 2 ]
0040 then
0041   echo "testProcessBlock2"
0042   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlock2_cfg.py &> testProcessBlock2.log || die "cmsRun testProcessBlock2_cfg.py" $?
0043 fi
0044 
0045 if [ $1 -eq 3 ]
0046 then
0047   echo "testProcessBlock3"
0048   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlock3_cfg.py &> testProcessBlock3.log || die "cmsRun testProcessBlock3_cfg.py" $?
0049 fi
0050 
0051 if [ $1 -eq 4 ]
0052 then
0053   echo "testProcessBlock4"
0054   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlock4_cfg.py &> testProcessBlock4.log || die "cmsRun testProcessBlock4_cfg.py" $?
0055 fi
0056 
0057 if [ $1 -eq 5 ]
0058 then
0059   echo "testProcessBlockMerge"
0060   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockMerge_cfg.py &> testProcessBlockMerge.log || die "cmsRun testProcessBlockMerge_cfg.py" $?
0061 
0062   # The ProcessBlock Branches and TTrees should exist in this case. Test that here:
0063   edmFileUtil -l -t MetaData -P file:testProcessBlockMerge.root > testProcessBlockMContentsM.txt
0064   grep "Branch.* ProcessBlockHelper " testProcessBlockMContentsM.txt || die "Check for existence of ProcessBlockHelper branch" $?
0065   grep "TTree.*ProcessBlocksPROD1" testProcessBlockMContentsM.txt || die "Check for existence of ProcessBlocksPROD1 TTree" $?
0066   grep "TTree.*ProcessBlocksMERGE" testProcessBlockMContentsM.txt || die "Check for existence of ProcessBlocksMERGE TTree" $?
0067   edmFileUtil -t Events -P file:testProcessBlockMerge.root > testProcessBlockMContentsE.txt
0068   grep "Branch.* EventToProcessBlockIndexes " testProcessBlockMContentsE.txt || die "Check for existence of eventToProcessBlockIndexes branch" $?
0069 fi
0070 
0071 if [ $1 -eq 6 ]
0072 then
0073   echo "testProcessBlockTEST"
0074   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockTEST_cfg.py &> testProcessBlockTEST.log || die "cmsRun testProcessBlockTEST_cfg.py" $?
0075 
0076   echo "testProcessBlockRead"
0077   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockRead_cfg.py &> testProcessBlockRead.log || die "cmsRun testProcessBlockRead_cfg.py" $?
0078   grep "InputProcessBlockIntAnalyzer::accessInputProcessBlock" testProcessBlockRead.log || die "Check that InputProcessBlockIntAnalyzer::accessInputProcessBlock was called" $?
0079   grep "InputProcessBlockIntFilter::accessInputProcessBlock" testProcessBlockRead.log || die "Check that InputProcessBlockIntFilter::accessInputProcessBlock was called" $?
0080   grep "InputProcessBlockIntProducer::accessInputProcessBlock" testProcessBlockRead.log || die "Check that InputProcessBlockIntProducer::accessInputProcessBlock was called" $?
0081 fi
0082 
0083 if [ $1 -eq 7 ]
0084 then
0085   echo "testProcessBlock2Dropped"
0086   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlock2Dropped_cfg.py &> testProcessBlock2Dropped.log || die "cmsRun testProcessBlock2Dropped_cfg.py" $?
0087 
0088   # The ProcessBlock Branches and TTrees should not exist in this case because
0089   # all the ProcessBlock products are dropped. Test that here:
0090   edmFileUtil -l -t MetaData -P file:testProcessBlock2Dropped.root > testProcessBlock2DroppedContentsM.txt
0091   grep "Branch.* ProcessBlockHelper " testProcessBlock2DroppedContentsM.txt && die "Check for non-existence of ProcessBlockHelper branch" 1
0092   grep "TTree.*ProcessBlocksPROD1" testProcessBlock2DroppedContentsM.txt && die "Check for non-existence of ProcessBlocksPROD1 TTree" 1
0093   edmFileUtil -t Events -P file:testProcessBlock2Dropped.root > testProcessBlock2DroppedContentsE.txt
0094   grep "Branch.* EventToProcessBlockIndexes " testProcessBlock2DroppedContentsE.txt && die "Check for non-existence of eventToProcessBlockIndexes branch" 1
0095 fi
0096 
0097 if [ $1 -eq 8 ]
0098 then
0099   # This one intentionally fails because the product content of the
0100   # files does not match (strict merging requirements for ProcessBlocks)
0101   echo "testProcessBlockFailMerge"
0102   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockFailMerge_cfg.py &> testProcessBlockFailMerge.log && die "cmsRun testProcessBlockFailMerge_cfg.py" 1
0103 fi
0104 
0105 if [ $1 -eq 9 ]
0106 then
0107   echo "testProcessBlockMerge2"
0108   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockMerge2_cfg.py &> testProcessBlockMerge2.log || die "cmsRun testProcessBlockMerge2_cfg.py" $?
0109 fi
0110 
0111 if [ $1 -eq 10 ]
0112 then
0113   echo "testProcessBlockMergeOfMergedFiles"
0114   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockMergeOfMergedFiles_cfg.py &> testProcessBlockMergeOfMergedFiles.log || die "cmsRun testProcessBlockMergeOfMergedFiles_cfg.py" $?
0115 fi
0116 
0117 if [ $1 -eq 11 ]
0118 then
0119   echo "testProcessBlockNOMergeOfMergedFiles"
0120   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockNOMergeOfMergedFiles_cfg.py &> testProcessBlockNOMergeOfMergedFiles.log || die "cmsRun testProcessBlockNOMergeOfMergedFiles_cfg.py" $?
0121 fi
0122 
0123 if [ $1 -eq 12 ]
0124 then
0125   echo "testProcessBlockRead2"
0126   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockRead2_cfg.py &> testProcessBlockRead2.log || die "cmsRun testProcessBlockRead2_cfg.py" $?
0127 fi
0128 
0129 if [ $1 -eq 14 ]
0130 then
0131   echo "testProcessBlockSubProcess"
0132   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockSubProcess_cfg.py &> testProcessBlockSubProcess.log || die "cmsRun testProcessBlockSubProcess_cfg.py" $?
0133 fi
0134 
0135 if [ $1 -eq 15 ]
0136 then
0137   echo "testProcessBlockSubProcessRead1"
0138   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockSubProcessRead1_cfg.py &> testProcessBlockSubProcessRead1.log || die "cmsRun testProcessBlockSubProcessRead1_cfg.py" $?
0139 fi
0140 
0141 if [ $1 -eq 16 ]
0142 then
0143   echo "testProcessBlockSubProcessRead2"
0144   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockSubProcessRead2_cfg.py &> testProcessBlockSubProcessRead2.log || die "cmsRun testProcessBlockSubProcessRead2_cfg.py" $?
0145 fi
0146 
0147 if [ $1 -eq 17 ]
0148 then
0149   echo "testProcessBlockSubProcessLooper"
0150   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockSubProcessLooper_cfg.py &> testProcessBlockSubProcessLooper.log || die "cmsRun testProcessBlockSubProcessLooper_cfg.py" $?
0151 fi
0152 
0153 if [ $1 -eq 18 ]
0154 then
0155   echo "testProcessBlock5"
0156   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlock5_cfg.py &> testProcessBlock5.log || die "cmsRun testProcessBlock5_cfg.py" $?
0157 
0158   echo "testProcessBlockMerge3"
0159   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockMerge3_cfg.py &> testProcessBlockMerge3.log || die "cmsRun testProcessBlockMerge3_cfg.py" $?
0160 
0161   echo "testProcessBlockMergeOfMergedFiles2"
0162   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockMergeOfMergedFiles2_cfg.py &> testProcessBlockMergeOfMergedFiles2.log || die "cmsRun testProcessBlockMergeOfMergedFiles2_cfg.py" $?
0163 fi
0164 
0165 if [ $1 -eq 19 ]
0166 then
0167   echo "testProcessBlockDropOnInput"
0168   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockDropOnInput_cfg.py &> testProcessBlockDropOnInput.log || die "cmsRun testProcessBlockDropOnInput_cfg.py" $?
0169 fi
0170 
0171 if [ $1 -eq 20 ]
0172 then
0173   echo "testProcessBlockThreeFileInput"
0174   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockThreeFileInput_cfg.py &> testProcessBlockThreeFileInput.log || die "cmsRun testProcessBlockThreeFileInput_cfg.py" $?
0175 
0176   echo "testProcessBlockReadThreeFileInput"
0177   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockReadThreeFileInput_cfg.py &> testProcessBlockReadThreeFileInput.log || die "cmsRun testProcessBlockReadThreeFileInput_cfg.py" $?
0178 fi
0179 
0180 if [ $1 -eq 21 ]
0181 then
0182   echo "testLooperEventNavigation2"
0183   cmsRun -p ${LOCAL_TEST_DIR}/testLooperEventNavigation2_cfg.py < ${LOCAL_TEST_DIR}/testLooperEventNavigation2.txt &> testLooperEventNavigation2.log || die "cmsRun testLooperEventNavigation2_cfg.py" $?
0184 fi
0185 
0186 if [ $1 -eq 22 ]
0187 then
0188   echo "testLooperEventNavigation3"
0189   cmsRun -p ${LOCAL_TEST_DIR}/testLooperEventNavigation3_cfg.py < ${LOCAL_TEST_DIR}/testLooperEventNavigation3.txt &> testLooperEventNavigation3.log || die "cmsRun testLooperEventNavigation3_cfg.py" $?
0190 fi
0191 
0192 if [ $1 -eq 23 ]
0193 then
0194   echo "testProcessBlockDropOnOutput"
0195   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockDropOnOutput_cfg.py &> testProcessBlockDropOnOutput.log || die "cmsRun testProcessBlockDropOnOutput_cfg.py" $?
0196 
0197   echo "testProcessBlockReadDropOnOutput"
0198   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockReadDropOnOutput_cfg.py &> testProcessBlockReadDropOnOutput.log || die "cmsRun testProcessBlockReadDropOnOutput_cfg.py" $?
0199 fi
0200 
0201 if [ $1 -eq 24 ]
0202 then
0203   echo "testProcessBlockDropOnOutput2"
0204   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockDropOnOutput2_cfg.py &> testProcessBlockDropOnOutput2.log || die "cmsRun testProcessBlockDropOnOutput2_cfg.py" $?
0205 
0206   echo "testProcessBlockReadDropOnOutput2"
0207   cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockReadDropOnOutput2_cfg.py &> testProcessBlockReadDropOnOutput2.log || die "cmsRun testProcessBlockReadDropOnOutput2_cfg.py" $?
0208 fi
0209 
0210 # The next three tests would be relevant if we disabled the strict merging requirement
0211 # in ProductRegistry.cc for ProcessBlock products (a one line code change). As long
0212 # as we always enforce the strict merging requirement these tests will fail, but they
0213 # would be useful if we decide to allow that requirement to be disabled in the future.
0214 # I ran them manually with the ProductRegistry.cc modified  to disable the requirement
0215 # and in May 2021 these tests passed. In addition to uncommenting the tests here, they
0216 # would also need to be added in the BuildFile with the proper dependency (both 25
0217 # and 26 depend on 19 at the moment)
0218 
0219 #if [ $1 -eq 25 ]
0220 #then
0221 #  echo "testProcessBlockNonStrict"
0222 #  cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockNonStrict_cfg.py &> testProcessBlockNonStrict.log || die "cmsRun testProcessBlockNonStrict_cfg.py" $?
0223 #
0224 #  echo "testProcessBlockNonStrict2"
0225 #  cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockNonStrict2_cfg.py &> testProcessBlockNonStrict2.log || die "cmsRun testProcessBlockNonStrict2_cfg.py" $?
0226 #fi
0227 
0228 #if [ $1 -eq 26 ]
0229 #then
0230 #  echo "testProcessBlockNonStrict3"
0231 #  cmsRun -p ${LOCAL_TEST_DIR}/testProcessBlockNonStrict3_cfg.py &> testProcessBlockNonStrict3.log || die "cmsRun testProcessBlockNonStrict3_cfg.py" $?
0232 #fi
0233 
0234 if [ $1 -eq 100 ]
0235 then
0236   rm testProcessBlock1ContentsM.txt
0237   rm testProcessBlock1ContentsE.txt
0238   rm testProcessBlockMContentsM.txt
0239   rm testProcessBlockMContentsE.txt
0240   rm testProcessBlock2DroppedContentsM.txt
0241   rm testProcessBlock2DroppedContentsE.txt
0242 
0243   rm testProcessBlock1.log
0244   rm testProcessBlock2.log
0245   rm testProcessBlock3.log
0246   rm testProcessBlock4.log
0247   rm testProcessBlockMerge.log
0248   rm testProcessBlockTEST.log
0249   rm testProcessBlockRead.log
0250   rm testProcessBlock2Dropped.log
0251   rm testProcessBlockFailMerge.log
0252   rm testProcessBlockMerge2.log
0253   rm testProcessBlockMergeOfMergedFiles.log
0254   rm testProcessBlockNOMergeOfMergedFiles.log
0255   rm testProcessBlockRead2.log
0256   rm testProcessBlockSubProcess.log
0257   rm testProcessBlockSubProcessRead1.log
0258   rm testProcessBlockSubProcessRead2.log
0259   rm testProcessBlockSubProcessLooper.log
0260   rm testProcessBlock5.log
0261   rm testProcessBlockMerge3.log
0262   rm testProcessBlockMergeOfMergedFiles2.log
0263   rm testProcessBlockDropOnInput.log
0264   rm testProcessBlockThreeFileInput.log
0265   rm testProcessBlockReadThreeFileInput.log
0266   rm testLooperEventNavigation2.log
0267   rm testLooperEventNavigation3.log
0268   rm testProcessBlockDropOnOutput.log
0269   rm testProcessBlockReadDropOnOutput.log
0270   rm testProcessBlockDropOnOutput2.log
0271   rm testProcessBlockReadDropOnOutput2.log
0272 
0273   rm testProcessBlock1.root
0274   rm testProcessBlock2.root
0275   rm testProcessBlock3.root
0276   rm testProcessBlock4.root
0277   rm testProcessBlockMerge.root
0278   rm testProcessBlockTest.root
0279   rm testProcessBlockRead.root
0280   rm testProcessBlock2Dropped.root
0281   rm testProcessBlockFailMerge.root
0282   rm testProcessBlockMerge2.root
0283   rm testProcessBlockMergeOfMergedFiles.root
0284   rm testProcessBlockNOMergeOfMergedFiles.root
0285   rm testProcessBlockRead2.root
0286   rm testProcessBlockSubProcessTest.root
0287   rm testProcessBlockSubProcessRead.root
0288   rm testProcessBlockSubProcessReadAgain.root
0289   rm testProcessBlockSubProcessRead1.root
0290   rm testProcessBlockSubProcessRead2.root
0291   rm testProcessBlockSubProcessLooperTest.root
0292   rm testProcessBlockSubProcessLooperRead.root
0293   rm testProcessBlockSubProcessLooperReadAgain.root
0294   rm testProcessBlock5.root
0295   rm testProcessBlockMerge3.root
0296   rm testProcessBlockMergeOfMergedFiles2.root
0297   rm testProcessBlockDropOnInput.root
0298   rm testProcessBlockThreeFileInput.root
0299   rm testProcessBlockReadThreeFileInput.root
0300   rm testProcessBlockDropOnOutput.root
0301   rm testProcessBlockDropOnOutput2.root
0302   rm testProcessBlockDropOnOutput2_2.root
0303   rm testProcessBlockReadDropOnOutput.root
0304   rm testProcessBlockReadDropOnOutput2.root
0305   rm testProcessBlockNOMergeOfMergedFiles001.root
0306   rm testProcessBlockSubProcessLooperRead001.root
0307   rm testProcessBlockSubProcessLooperRead002.root
0308   rm testProcessBlockSubProcessLooperReadAgain001.root
0309   rm testProcessBlockSubProcessLooperReadAgain002.root
0310   rm testProcessBlockSubProcessLooperTest001.root
0311   rm testProcessBlockSubProcessLooperTest002.root
0312 
0313   #rm testProcessBlockNonStrict.log
0314   #rm testProcessBlockNonStrict2.log
0315   #rm testProcessBlockNonStrict3.log
0316   #rm testProcessBlockNonStrict.root
0317   #rm testProcessBlockNonStrict2.root
0318   #rm testProcessBlockNonStrict3.root
0319 
0320 fi
0321 
0322 popd
0323 
0324 exit 0