def test_010_addCondDBLayer_2(self):
     """Add layers from allowed Configurable instances""" 
     # Add the layers (one per type)
     types = [CondDBAccessSvc,
              CondDBDispatcherSvc,
              CondDBLayeringSvc,
              CondDBTimeSwitchSvc,
              CondDBSQLiteCopyAccSvc]
     layers = []
     for i in range(len(types)):
         layer = types[i]("layer_%d"%i)
         layers.append(layer)
         self.CondDB.addLayer(layer)
     
     applyConfigurableUsers()
     
     reader = allConfigurables["CondDBCnvSvc"].CondDBReader
     # check if we have a layering svc
     self.assertEquals(reader.__class__.__name__, "CondDBLayeringSvc")
     # correct size?
     self.assertEquals(len(reader.Layers), len(layers) + 1)
     # correct order (inverse of insertion order)...
     layers.reverse()
     for i in range(len(types)):
         self.assertEqual(reader.Layers[i], layers[i])
     # ... plus the original one
     self.assertEqualsConfig(reader.Layers[len(layers)], orig_reader)
 def test_000_originalConfiguration(self):
     """Check the default configuration"""
     applyConfigurableUsers()
     global orig_reader, orig_dict
     orig_reader = allConfigurables["CondDBCnvSvc"].CondDBReader
     self.assertEquals(orig_reader.__class__.__name__,
                       "CondDBDispatcherSvc")
     orig_dict = dict(orig_reader.Alternatives)
 def test_043_heartbeat(self):
     """HeartBeat condition (on-line, SQLite, default)"""
     self.CondDB.Online = True
     self.CondDB.UseOracle = False
     applyConfigurableUsers()
     
     online = allConfigurables["ONLINE"]
     for conf in online.Readers:
         self.checkHeartBeat(conf, "")
 def test_030_heartbeat(self):
     """HeartBeat condition (off-line, Oracle, default)"""
     self.CondDB.Online = False
     self.CondDB.UseOracle = True
     applyConfigurableUsers()
     
     hbc = allConfigurables["ONLINE"].getProp("HeartBeatCondition")
     
     self.assertEquals(hbc, "/Conditions/Online/LHCb/Tick")
 def test_041_heartbeat(self):
     """HeartBeat condition (on-line, Oracle, default)"""
     self.CondDB.Online = True
     self.CondDB.UseOracle = True
     applyConfigurableUsers()
     
     hbc = allConfigurables["ONLINE"].getProp("HeartBeatCondition")
     
     self.assertEquals(hbc, "")
 def test_033_heartbeat(self):
     """HeartBeat condition (off-line, SQLite, ignore)"""
     self.CondDB.Online = False
     self.CondDB.UseOracle = False
     self.CondDB.IgnoreHeartBeat = True
     applyConfigurableUsers()
     
     online = allConfigurables["ONLINE"]
     for conf in online.Readers:
         self.checkHeartBeat(conf, "")
 def test_031_heartbeat(self):
     """HeartBeat condition (off-line, Oracle, ignore)"""
     self.CondDB.Online = False
     self.CondDB.UseOracle = True
     self.CondDB.IgnoreHeartBeat = True
     applyConfigurableUsers()
     
     hbc = allConfigurables["ONLINE"].getProp("HeartBeatCondition")
     
     self.assertEquals(hbc, "")
 def test_032_heartbeat(self):
     """HeartBeat condition (off-line, SQLite, default)"""
     self.CondDB.Online = False
     self.CondDB.UseOracle = False
     applyConfigurableUsers()
     
     online = allConfigurables["ONLINE"]
     for conf in online.Readers[:-1]:
         self.checkHeartBeat(conf, "")
     conf = online.Readers[-1]
     self.checkHeartBeat(conf, "/Conditions/Online/LHCb/Tick")
 def test_010_addCondDBLayer_1(self):
     """Add one layer from CondDBAccessSvc instance""" 
     # Add the layer
     layer = CondDBAccessSvc("layer")
     self.CondDB.addLayer(layer)
     
     applyConfigurableUsers()
     
     reader = allConfigurables["CondDBCnvSvc"].CondDBReader
     # check if we have a layering svc
     self.assertEquals(reader.__class__.__name__, "CondDBLayeringSvc")
     # check for the new layer...
     self.assertEqual(reader.Layers[0], layer)
     # ... plus the original one
     self.assertEqualsConfig(reader.Layers[1], orig_reader)
    def test_020_addCondDBAlternative_1(self):
        """Add one alternative from CondDBAccessSvc instance"""
        # Add the alternative
        alternative = CondDBAccessSvc("alternative")
        self.CondDB.addAlternative(alternative, "/Test")

        applyConfigurableUsers()
        
        reader = allConfigurables["CondDBCnvSvc"].CondDBReader
        # the reader should not have changed
        self.assertEqualsConfig(reader, orig_reader)
        # correct size?
        self.assertEquals(len(reader.Alternatives), len(orig_dict) + 1)
        # check the previous alternatives
        for k in orig_dict:
            self.assertEqualsConfig(reader.Alternatives[k], orig_dict[k])
        # plus the new one
        self.assertEqualsConfig(reader.Alternatives["/Test"], alternative)
    def test_020_addCondDBAlternative_2(self):
        """Replace one alternative from CondDBAccessSvc instance"""
        path = orig_dict.keys()[0]
        
        # Add the alternative
        alternative = CondDBAccessSvc("alternative")
        self.CondDB.addAlternative(alternative, path)

        applyConfigurableUsers()
        
        reader = allConfigurables["CondDBCnvSvc"].CondDBReader
        # the reader should not have changed
        self.assertEqualsConfig(reader, orig_reader)
        # correct size?
        self.assertEquals(len(reader.Alternatives), len(orig_dict))
        # check the previous alternatives
        for k in orig_dict:
            if k != path:
                self.assertEqualsConfig(reader.Alternatives[k], orig_dict[k])
            else:
                self.assertEqualsConfig(reader.Alternatives[k], alternative)
Exemplo n.º 12
0
        print self.msg

def ActionFunction():
    calledActions.append("Action Function")
    print "Action Function"

appendPostConfigAction(Action("Action Object One"))
appendPostConfigAction(ActionFunction)
appendPostConfigAction(Action("Action Object Two"))

# Instantiate the application configurable
Application()

# apply all ConfigurableUser instances
from GaudiKernel.Configurable import applyConfigurableUsers
applyConfigurableUsers()

# check that everything has been applied
expected = {'Application':               ('Property1', 10),
            'TestInstance':              ('Property', 1),
            'Application_MultiInstance': ('Property', 0),
            'SubModule1':                ('Property1', 10),
            'SubModule2':                ('Property1', 10),
            'TestInstance_SubModule1':   ('Property1', 0),
            'Application_MultiInstance_SubModule1': ('Property1', 0),
            'NotActivelyUsed':           ('Property', -5)}
assert set(appliedConf) == set(expected)

# check the order of application
assert appliedConf.index('Application') < appliedConf.index('SubModule1')
assert appliedConf.index('Application') < appliedConf.index('SubModule2')
Exemplo n.º 13
0
Moore().ForceSingleL0Configuration = True
Moore().OutputLevel = 3
Moore().RemoveInputHltRawBanks = False
Moore().EvtMax = -1
Moore().EnableTimer = True

from PRConfig.TestFileDB import test_file_db
input = test_file_db['2015HLTValidationData_L0filtered_0x0050']
input.run(configurable=Moore())

Moore().CondDBtag = 'cond-20150828'
Moore().DDDBtag = 'dddb-20150724'
Moore().DataType = '2015'

from GaudiKernel.Configurable import applyConfigurableUsers
applyConfigurableUsers()

from Configurables import HltConf
conf = HltConf()
settings = HltConf().settings()

configuredStreams = settings.Streams()
knownStreams = conf.knownStreams()

from Configurables import HltRoutingBitsWriter
rb1 = HltRoutingBitsWriter('Hlt1RoutingBitsWriter')
rb2 = HltRoutingBitsWriter('Hlt2RoutingBitsWriter')

passed = True
for stream, rb in configuredStreams.iteritems():
    try: