108def check_hlt_properties(filename='HLTJobOptions.db.json'):
109 '''Check a few important job options in the JSON file'''
110
111 log = get_logger()
112
113 with open(filename) as f:
114 props = json.load(f)['properties']
115
116 def checkprop(comp, prop, regex):
117 value = props[comp][prop]
118 if re.match(regex, value) is None:
119 log.error('Property "%s.%s" does not match "%s". Current value: "%s"', comp, prop, regex, value)
120 return False
121 return True
122
123 checks = [
124 checkprop('IOVDbSvc', 'CacheAlign', '0'),
125 checkprop('IOVDbSvc', 'CacheRun', '0'),
126 checkprop('IOVDbSvc', 'CacheTime', '0'),
127 checkprop('AtlasFieldMapCondAlg', 'LoadMapOnStart', 'True'),
128 checkprop('IOVDbSvc', 'Folders', r'.*/TRIGGER/LUMI/HLTPrefLumi\s*<extensible/>.*'),
129 checkprop('IOVDbSvc', 'Folders', r'.*/Indet/Onl/Beampos\s*<extensible/>.*'),
130 checkprop('IOVDbSvc', 'Folders', r'.*/TRIGGER/HLT/PrescaleKey <tag>HEAD</tag>\s*<extensible/>.*'),
131 ]
132 return 0 if all(checks) else 1
133
134