5 from __future__
import print_function
10 TESTING_DIR =
'/afs/cern.ch/user/a/atlasdqm/dqmdisk1/testing_references'
17 '''Test that histogram merging + postprocessing works'''
19 print(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
20 print(
'Running merge test ....')
21 print(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
22 outdir = os.environ.get(
'TMPDIR',
'.')
23 inlist = os.path.join(TESTING_DIR,
'test_merging')
24 self.
outfile = os.path.join(outdir,
'data09_calophys.00128005.physics_CosmicMuons.root')
25 rv = os.system(
'cd %s ; DQHistogramMerge.py %s %s True' % (outdir, inlist, self.
outfile))
26 self.assertTrue(rv==0,
"DQHistogramMerge.py return code is nonzero")
29 '''Test that a terminal web display job works'''
31 print(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
32 print(
'Running web display test ....')
33 print(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
34 outdir = os.environ.get(
'TMPDIR',
'.')
35 infile = os.path.join(TESTING_DIR,
'data09_calophys.00128005.physics_CosmicMuons.root')
36 rv = os.system(
'cd %s ; DQWebDisplay.py %s TestDisplay 123' % (outdir, infile))
37 self.assertTrue(rv==0,
"DQWebDisplay.py return code is nonzero")
40 '''Test that a terminal web display job works in temporary accumulation mode'''
42 print(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
43 print(
'Running intermediate web display test ....')
44 print(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
45 outdir = os.environ.get(
'TMPDIR',
'.')
46 infile = os.path.join(TESTING_DIR,
'data09_calophys.00128005.physics_CosmicMuons.root')
47 from DataQualityConfigurations.TestDisplay
import dqconfig
48 cachedir = dqconfig.histogramCache
50 self.fail(
'Unable to test intermediate web displays; no histogramCache directory set')
51 if not os.access(cachedir, os.W_OK):
52 print(
"No write permissions for cache dir %s; skipping test" % cachedir)
54 cachefilename = os.path.basename(infile).rsplit(
'.',1)[-2] +
'.CACHE_1'
55 shutil.copy(infile, os.path.join(cachedir, cachefilename))
57 rv = os.system(
'cd %s ; DQWebDisplay.py %s TestDisplay 123 True' % (outdir, infile))
58 self.assertTrue(rv==0,
"DQWebDisplay.py return code is nonzero")
68 suite = unittest.TestLoader().loadTestsFromTestCase(DQUTestCase)
71 if __name__ ==
'__main__':