Beispiel #1
0
    def test_process_ok(self):

            glueceuniqueid = 'GlueCEUniqueID=cream-38.pd.infn.it:8443/cream-pbs-creamtest1,mds-vo-name=resource,o=grid'
            gluevoviewid = 'GlueVOViewLocalID=dteam,' + glueceuniqueid
            ldif = """
dn: %s
GlueVOViewLocalID: dteam
GlueChunkKey: GlueCEUniqueID=cream-38.pd.infn.it:8443/cream-pbs-creamtest1
GlueCEAccessControlBaseRule: VO:dteam

dn: %s
GlueCEUniqueID: cream-38.pd.infn.it:8443/cream-pbs-creamtest1
GlueCEName: creamtest1
GlueCEAccessControlBaseRule: VO:infngrid
GlueCEAccessControlBaseRule: VO:dteam
""" % (gluevoviewid, glueceuniqueid)

            workspace = Workspace(vomap = self.vomap)            
            workspace.setLRMSCmd(self._script())
            workspace.setGLUE1StaticFile(ldif)
            
            cfgfile = workspace.getConfigurationFile()
            config = DynSchedUtils.readConfigurationFromFile(cfgfile)
            
            dOut = DummyOutput()
            collector = Analyzer.analyze(config, {})
            GLUE1Handler.process(config, collector, dOut)
            
            result = dOut.queued[glueceuniqueid] == 2
            result = result and dOut.running[glueceuniqueid] == 4
            result = result and dOut.queued[gluevoviewid] == 1
            result = result and dOut.running[gluevoviewid] == 2
            self.assertTrue(result)
Beispiel #2
0
    def test_process_missingce(self):
        try:
            glueceuniqueid = 'GlueCEUniqueID=cream-38.pd.infn.it:8443/cream-pbs-creamtest1,mds-vo-name=resource,o=grid'
            gluevoviewid = 'GlueVOViewLocalID=dteam,' + glueceuniqueid
            ldif = """
dn: %s
GlueVOViewLocalID: dteam
GlueChunkKey: GlueCEUniqueID=cream-38.pd.infn.it:8443/cream-pbs-creamtest1
GlueCEAccessControlBaseRule: VO:dteam
""" % gluevoviewid
            
            workspace = Workspace(vomap = self.vomap)
            workspace.setLRMSCmd(self._script())
            workspace.setGLUE1StaticFile(ldif)
            
            cfgfile = workspace.getConfigurationFile()
            config = DynSchedUtils.readConfigurationFromFile(cfgfile)
            
            dOut = DummyOutput()
            collector = Analyzer.analyze(config, {})
            GLUE1Handler.process(config, collector, dOut)            
            self.fail("No exception detected")
        
        except GLUE1Handler.GLUE1Exception, glue_error:
            msg = str(glue_error)
            self.assertTrue(msg.startswith("Invalid foreign key"))