Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-15 22:42:45

0001 #!/bin/bash
0002 
0003 function die { echo Failure $1: status $2 ; exit $2 ; }
0004 
0005 pushd ${LOCAL_TMP_DIR}
0006 
0007 rm -f run_DOMCount.log
0008 echo "Normal output of DOMCount is written to file tmp/${SCRAM_ARCH}/run_DOMCount.log"
0009 
0010 # Each of these cfi files contains a list of xml files
0011 # We will run DOMCount on each of the xml files
0012 cfiFiles=Geometry/CMSCommonData/cmsIdealGeometryXML_cfi
0013 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometry2015XML_cfi"
0014 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometry2015devXML_cfi"
0015 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometryGFlashXML_cfi"
0016 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometryHFLibraryXML_cfi"
0017 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometryHFParametrizeXML_cfi"
0018 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometryNoAPDXML_cfi"
0019 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsIdealGeometryTotemT1XML_cfi"
0020 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015CastorMeasuredXML_cfi"
0021 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015CastorSystMinusXML_cfi"
0022 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015CastorSystPlusXML_cfi"
0023 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015MuonGEMDevXML_cfi"
0024 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015PilotXML_cfi"
0025 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015XML_cfi"
0026 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015ZeroMaterialXML_cfi"
0027 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015devCastorMeasuredXML_cfi"
0028 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015devCastorSystMinusXML_cfi"
0029 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015devCastorSystPlusXML_cfi"
0030 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2015devXML_cfi"
0031 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2016XML_cfi"
0032 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2019XML_cfi"
0033 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryGFlashXML_cfi"
0034 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryHFLibraryNoCastorXML_cfi"
0035 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryHFLibraryXML_cfi"
0036 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryHFParametrizeXML_cfi"
0037 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryNoCastorXML_cfi"
0038 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryTest2014XML_cfi"
0039 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryXML_cfi"
0040 cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometryZeroMaterialXML_cfi"
0041 
0042 # automatically retrieve active phase 2 geometries
0043 read -a DETS <<< $(python3 -c 'from Configuration.Geometry.dict2026Geometry import detectorVersionDict; print " ".join(sorted([x[1] for x in detectorVersionDict.items()]))')
0044 for DET in ${DETS[@]}; do
0045         cfiFiles="${cfiFiles} Geometry/CMSCommonData/cmsExtendedGeometry2026${DET}XML_cfi"
0046 done
0047 
0048 for cfiFile in ${cfiFiles}
0049 do
0050   echo "run_DOMCount.py $cfiFile" | tee -a run_DOMCount.log
0051   ${LOCAL_TEST_DIR}/run_DOMCount.py $cfiFile >> run_DOMCount.log 2>&1 || die "run_DOMCount.py $cfiFile" $?
0052 done
0053 
0054 # Errors in the xml files and also missing xml or schema files will
0055 # show up in the log file. (if the python script above actually
0056 # exits with a nonzero status it probably means the python test
0057 # script has a bug in it)
0058 errorCount=`(grep --count "Error" run_DOMCount.log)`
0059 
0060 if [ $errorCount -eq 0 ]
0061 then
0062     echo "No XML Schema violations in xml files."
0063 else
0064     echo "Test failed. Here are the errors from tmp/${SCRAM_ARCH}/run_DOMCount.log:"
0065     cat run_DOMCount.log | grep -v '\.xml:.*elems\.$'
0066     popd
0067     exit 1
0068 fi
0069 
0070 popd
0071 exit 0