6Definitions of additional validation steps in Trigger ART tests relevant only for TrigP1Test.
7The main common check steps are defined in the TrigValSteering.CheckSteps module.
10from TrigValTools.TrigValSteering
import Step, CheckSteps
11from TrigValTools.TrigValSteering.Common
import get_logger
19 Extra step based on grepping trigbs_dumpHLTContentInBS.py output
20 and comparing the line count to expected value
24 super(TrigBSDumpGrepStep, self).
__init__(name)
32 def run(self, dry_run=False):
34 self.log.info(
'Skipping %s in dry run', self.
name)
36 return self.
result,
'# (internal) {} -> skipped'.format(self.
name)
38 for ls_file
in os.listdir(
'.'):
42 self.log.
error(
'%s cannot find the BS output file', self.
name)
46 return self.
result,
'# (internal) {} -> failed'.format(self.
name)
47 self.log.
debug(
'%s found BS file %s', self.
name, file_name)
48 self.args +=
' ' + file_name
49 self.args +=
' | grep "{}" | wc -l'.format(self.
regex)
53 ret, cmd = super(TrigBSDumpGrepStep, self).
run(dry_run)
62 if not os.path.isfile(self.get_log_file_name()):
63 self.log.
error(
'%s failed, the file %s is missing',
64 self.
name, self.get_log_file_name())
71 with open(self.get_log_file_name())
as log_file:
72 num = eval(log_file.read())
74 self.log.
error(
'%s failed the comparison', self.
name)
81 compare_str =
''.join(compare_str_list[1:])
82 compare_str = compare_str.strip()
83 self.log.info(
'Comparison %s for num=%s gives True', compare_str, num)
92 Step which extracts the EXPERT directory from an online monitoring file
93 produced by OH server into an offline-like expert-monitoring.root
95 def __init__(self, name='ExtractExpertMonitoring'):
96 super(ExtractExpertMonitoring, self).
__init__(name)
106 super(ExtractExpertMonitoring, self).
configure(test)
110 '''Check a few important job options in the JSON file'''
114 with open(filename)
as f:
115 props = json.load(f)[
'properties']
117 def checkprop(comp, prop, regex):
118 value = props[comp][prop]
119 if re.match(regex, value)
is None:
120 log.error(
'Property "%s.%s" does not match "%s". Current value: "%s"', comp, prop, regex, value)
125 checkprop(
'IOVDbSvc',
'CacheAlign',
'0'),
126 checkprop(
'IOVDbSvc',
'CacheRun',
'0'),
127 checkprop(
'IOVDbSvc',
'CacheTime',
'0'),
128 checkprop(
'AtlasFieldMapCondAlg',
'LoadMapOnStart',
'True'),
129 checkprop(
'IOVDbSvc',
'Folders',
r'.*/TRIGGER/LUMI/HLTPrefLumi\s*<extensible/>.*'),
130 checkprop(
'IOVDbSvc',
'Folders',
r'.*/Indet/Onl/Beampos\s*<extensible/>.*'),
131 checkprop(
'IOVDbSvc',
'Folders',
r'.*/TRIGGER/HLT/PrescaleKey <tag>HEAD</tag>\s*<extensible/>.*'),
133 return 0
if all(checks)
else 1
140 hist_path_split = hist_path.split(
':')
141 if len(hist_path_split) > 1:
142 extract_hist.input_file = hist_path_split[0]
143 extract_hist.path_prefix = hist_path_split[1]
145 extract_hist.input_file = hist_path
146 steps.append(extract_hist)
148 steps.extend(CheckSteps.default_check_steps(test))
150 matches = [step
for step
in steps
if step.name ==
'HistMerge']
151 for hm_step
in matches:
152 steps.remove(hm_step)
156 '''Extract ByteStream data for a given stream from a file with multiple streams'''
157 from TrigValTools.TrigValSteering
import ExecStep
158 from TrigValTools.TrigValSteering.Common
import find_file
159 filterStep = ExecStep.ExecStep(
'FilterBS_'+stream_name)
160 filterStep.type =
'other'
161 filterStep.executable =
'trigbs_extractStream.py'
162 filterStep.input =
''
163 filterStep.args = f
'{extra_args} -s {stream_name} ' + find_file(
'data*_SingleStream.daq.RAW.*_output.*.data', max_files=
None)
167 '''Deserialise HLT data from ByteStream and save to an ESD file'''
168 from TrigValTools.TrigValSteering
import ExecStep
169 from TrigValTools.TrigValSteering.Common
import find_file
170 decodeStep = ExecStep.ExecStep(
'DecodeBS_'+stream_name)
171 decodeStep.type =
'other'
172 decodeStep.executable =
'python'
173 decodeStep.input =
''
174 decodeStep.explicit_input =
True
175 decodeStep.args = f
'-m TrigP1Test.DecodeBS --moduleID={moduleID} --filesInput=' + find_file(f
'data*_{stream_name}.*.data')
__init__(self, name='TrigBSDumpGrep')
std::vector< std::string > split(const std::string &s, const std::string &t=":")
check_hlt_properties(filename='HLTJobOptions.db.json')
default_check_steps_OHMon(test, hist_path)
decodeBS(stream_name, moduleID=0)
filterBS(stream_name, extra_args='')