Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import subprocess
import sys
import shutil

# Script which reads data from DB/XML and writes them to file
# Run with python3
Expand All @@ -26,7 +27,9 @@


# 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')
test_script = 'test_writeTotemDAQMapping.py'
orig_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),test_script)
shutil.copyfile(orig_script, test_script)
for fileContent in filesToRead:
for fileInfo in fileContent["configuration"]:
with open(test_script, 'r+') as f:
Expand Down Expand Up @@ -86,6 +89,4 @@
f.truncate()


subprocess.run(f'cmsRun {os.environ["CMSSW_BASE"]}/src/CalibPPS/ESProducers/test/test_writeTotemDAQMapping.py' , shell=True)


subprocess.run(f'cmsRun ./{test_script}' , shell=True)
9 changes: 7 additions & 2 deletions CondTools/CTPPS/test/script-ctpps-write-many-XML-to-SQLite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import re
import subprocess
import sys
import shutil

# Script which reads data from XML and drops objects to SQLite
# Run with python3

Expand All @@ -18,9 +20,12 @@


# 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 = "write-ctpps-totem_daqmap_cfg.py"
orig_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),test_script)
shutil.copyfile(orig_script, test_script)
for fileContent in filesToWrite:
for fileInfo in fileContent["configuration"]:
with open(f'{os.environ["CMSSW_BASE"]}/src/CondTools/CTPPS/test/write-ctpps-totem_daqmap_cfg.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)
Expand Down Expand Up @@ -56,5 +61,5 @@
f.truncate()


subprocess.run(f'cmsRun {os.environ["CMSSW_BASE"]}/src/CondTools/CTPPS/test/write-ctpps-totem_daqmap_cfg.py' , shell=True)
subprocess.run(f'cmsRun ./{test_script}' , shell=True)