File indexing completed on 2024-04-06 12:18:19
0001
0002
0003
0004
0005
0006
0007 outputFile="${CMSSW_BASE}"/src/HLTrigger/Configuration/test/testAccessToEDMInputsOfHLTTests_filelist.txt
0008
0009
0010 TESTDIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
0011
0012
0013 if [ "${TESTDIR}" != "${CMSSW_BASE}"/src/HLTrigger/Configuration/test ]; then
0014 printf "\n%s\n" "ERROR -- the directory hosting testAccessToHLTTestInputs.sh [1] does not correspond to \${CMSSW_BASE}/src/HLTrigger/Configuration/test [2]"
0015 printf "%s\n" " [1] ${TESTDIR}"
0016 printf "%s\n\n" " [2] ${CMSSW_BASE}/src/HLTrigger/Configuration/test"
0017 exit 1
0018 fi
0019
0020
0021 cmsswFiles=(
0022 HLTrigger/Configuration/test/cmsDriver.csh
0023 Configuration/HLT/python/addOnTestsHLT.py
0024 Utilities/ReleaseScripts/scripts/addOnTests.py
0025 )
0026
0027
0028
0029 cmsswBranches=($(git branch -a | grep 'remotes/official-cmssw/CMSSW_[0-9]*_[0-9]*_X$'))
0030 cmsswBranches+=("HEAD")
0031
0032
0033 TMPFILE1=$(mktemp)
0034
0035
0036 cd "${CMSSW_BASE}"/src
0037
0038 printf "%s\n" "-------------------------"
0039 printf "%s\n" "Finding list of EDM files used by HLT tests in CMSSW (branches: '^CMSSW_[0-9]*_[0-9]*_X$')..."
0040
0041
0042 for cmsswBranch in "${cmsswBranches[@]}"; do
0043 foo=($(git grep -h "[='\" ]/store/.*.root" ${cmsswBranch} -- ${cmsswFiles[*]} 2> /dev/null |
0044 sed 's|=/store/| /store/|g' | sed "s|'| |g" | sed 's|"| |g' |
0045 awk '{ for(i=1;i<=NF;i++) if ($i ~ /\/store\/.*.root/) print $i }'))
0046 printf "\n %s\n" "${cmsswBranch}"
0047 for bar in "${foo[@]}"; do
0048 printf " %s\n" "${bar}"
0049 echo "${bar}" >> "${TMPFILE1}"
0050 done
0051 unset foo bar
0052 done; unset cmsswBranch
0053
0054
0055 TMPFILE2=$(mktemp)
0056
0057
0058
0059
0060 function edmFileIsAvailable() {
0061 [ $
0062
0063 edmFileUtil -f root://eoscms.cern.ch//eos/cms/store/user/cmsbuild"${1}" &> /dev/null
0064 [ $? -ne 0 ] || return 0
0065
0066 edmFileUtil -f root://cms-xrd-global.cern.ch/"${1}" &> /dev/null
0067 return $?
0068 }
0069
0070 printf "%s\n" "-------------------------"
0071 printf "%s\n" "Checking availability of EDM files..."
0072 printf "%s\n" "(checks whether the file is in the ibeos cache, or it can be accessed remotely via the redirector cms-xrd-global.cern.ch)"
0073
0074 for inputFile in $(cat "${TMPFILE1}" | sort -u); do
0075 printf '\e[1;34m%-20s\e[m %s\033[0K\r' "[Checking...]" "${inputFile}"
0076 if ! edmFileIsAvailable "${inputFile}"; then
0077 printf '\e[1;31m%-20s\e[m %s\n' "[File not available]" "${inputFile}"
0078 continue
0079 fi
0080 printf '\e[1;32m%-20s\e[m %s\n' "[File available]" "${inputFile}"
0081 echo "${inputFile}" >> "${TMPFILE2}"
0082 done
0083 unset inputFile
0084
0085
0086 cat "${TMPFILE2}" | sort -u > "${outputFile}"
0087
0088 printf "%s\n" "-------------------------"
0089 printf "%s\n" "File updated: ${outputFile}"
0090 printf "%s\n" "-------------------------"
0091
0092
0093 cd "${TESTDIR}"