109def check_hlt_properties(filename='HLTJobOptions.db.json'):
110 '''Check a few important job options in the JSON file'''
111
112 log = get_logger()
113
114 with open(filename) as f:
115 props = json.load(f)['properties']
116
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)
121 return False
122 return True
123
124 checks = [
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/>.*'),
132 ]
133 return 0 if all(checks) else 1
134
135