diff --git a/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py b/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py index 23008c3633dcb..c96ed34bf1107 100644 --- a/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py +++ b/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py @@ -26,9 +26,10 @@ # For each file change the variable values in the config so that they match the selected XML file and then run the config +test_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),'test_writeTotemDAQMapping.py') for fileContent in filesToRead: for fileInfo in fileContent["configuration"]: - with open(f'{os.environ["CMSSW_BASE"]}/src/CalibPPS/ESProducers/test/test_writeTotemDAQMapping.py', 'r+') as f: + with open(test_script, 'r+') as f: content = f.read() # replace values specific for selected detector content = re.sub(r'subSystemName =.*', f'subSystemName = "{fileContent["subSystemName"]}"', content) diff --git a/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh b/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh index 961f93e663d76..30389bbe794d8 100755 --- a/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh +++ b/CondTools/CTPPS/test/test_XML_to_SQLite_mapping.sh @@ -6,6 +6,7 @@ DET_TO_CHECK=("TotemTiming" "TimingDiamond" "TrackingStrip" "TotemT2") MASK_DATA="AnalysisMask" TEST_DIR=$CMSSW_BASE/src/CondTools/CTPPS/test PRINTER_SCRIPT=$CMSSW_BASE/src/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py +[ -e ${PRINTER_SCRIPT} ] || PRINTER_SCRIPT=$CMSSW_RELEASE_BASE/src/CalibPPS/ESProducers/test/script_test_many_writeTotemDAQMapping.py # --------------- python3 ${TEST_DIR}/script-ctpps-write-many-XML-to-SQLite.py False "${DET_TO_CHECK[@]}" || die 'Failed in script-ctpps-write-many-XML-to-SQLite.py' $? @@ -38,4 +39,4 @@ done rm all__db.txt all__xml.txt rm CTPPS_AnalysisMask.db -echo "Cleaned after tests" \ No newline at end of file +echo "Cleaned after tests"