Example #1
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])

        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()

        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr",
                                   "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco.json"), 'r')

        rerecoArgs = json.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] = []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(
            self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"),
                          config.views.data.couch_reqmgr_aux_db, cmsswDoc)
        self.reqSvc = ReqMgr(self.jsonSender["host"])
        self.reqSvc._noStale = True
        self.reqSvc['requests'].additionalHeaders = self.create_header
Example #2
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"), 
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])
        
        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        #print "%s" % self.test_authz_key.data
        self.default_status_header = getAuthHeader(self.test_authz_key.data, DEFAULT_STATUS_PERMISSION)
        
        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco.json"), 'r')
        
        rerecoArgs = json.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoCreateArgs["PrepID"] = "test_prepid"
        self.rerecoCreateArgs["MCPileup"] = "/MCdata/pileup/RAW"
        self.rerecoCreateArgs["DataPileup"] = "/Data/pileup/RAW" 
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        # overwrite rereco args
        self.rerecoAssignArgs["AcquisitionEra"] = "test_aqc"
        
        lheFile = open(os.path.join(requestPath, "TaskChain_Data.json"), 'r')
        lheArgs = json.load(lheFile)
        self.lheStep0CreateArgs = lheArgs["createRequest"]
        self.lheStep0AssignArgs = lheArgs["assignRequest"]
        self.lheStep0AssignArgs["AcquisitionEra"] = "test_aqc"
        
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)        
Example #3
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])

        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        #print "%s" % self.test_authz_key.data
        self.default_status_header = getAuthHeader(self.test_authz_key.data, DEFAULT_STATUS_PERMISSION)

        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco_RunBlockWhite.json"), 'r')

        rerecoArgs = json.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoCreateArgs["PrepID"] = "test_prepid"
        self.rerecoCreateArgs["MCPileup"] = "/MCdata/pileup/RAW"
        self.rerecoCreateArgs["DataPileup"] = "/Data/pileup/RAW"
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        # overwrite rereco args
        self.rerecoAssignArgs["AcquisitionEra"] = "test_aqc"

        lheFile = open(os.path.join(requestPath, "TaskChain_Data.json"), 'r')
        lheArgs = json.load(lheFile)
        self.lheStep0CreateArgs = lheArgs["createRequest"]
        self.lheStep0AssignArgs = lheArgs["assignRequest"]
        self.lheStep0AssignArgs["AcquisitionEra"] = "test_aqc"

        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)
Example #4
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])

        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        #print "%s" % self.test_authz_key.data
        self.default_status_header = getAuthHeader(self.test_authz_key.data, DEFAULT_STATUS_PERMISSION)

        normPath = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..'))
        rerecoPath = os.path.join(normPath, 'data/ReqMgr/requests/DMWM/ReReco_RunBlockWhite.json')
        with open(rerecoPath) as jObj:
            rerecoArgs = json.load(jObj)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoCreateArgs["PrepID"] = "test_prepid"
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        # overwrite rereco args
        self.rerecoAssignArgs["AcquisitionEra"] = "test_aqc"

        taskChainPath = os.path.join(normPath, 'data/ReqMgr/requests/DMWM/TaskChain_InclParents.json')
        with open(taskChainPath) as jObj:
            lheArgs = json.load(jObj)
        self.lheStep0CreateArgs = lheArgs["createRequest"]
        self.lheStep0AssignArgs = lheArgs["assignRequest"]
        self.lheStep0AssignArgs["AcquisitionEra"] = "test_aqc"

        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)
Example #5
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])

        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()

        normPath = os.path.normpath(
            os.path.join(os.path.dirname(__file__), '..', '..', '..', '..'))
        rerecoPath = os.path.join(
            normPath, 'data/ReqMgr/requests/DMWM/ReReco_RunBlockWhite.json')
        with open(rerecoPath) as jObj:
            rerecoArgs = json.load(jObj)

        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] = []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(
            self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"),
                          config.views.data.couch_reqmgr_aux_db, cmsswDoc)
        self.reqSvc = ReqMgr(self.jsonSender["host"])
        self.reqSvc._noStale = True
        self.reqSvc['requests'].additionalHeaders = self.create_header
Example #6
0
 def setUp(self):
     config.main.tools.cms_auth.policy = "dangerously_insecure"
     self.setConfig(config)
     self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"),
                       (config.views.data.couch_reqmgr_aux_db, "ReqMgrAux")
                       ])
     self.setSchemaModules([])
     RESTBaseUnitTestWithDBBackend.setUp(self)
Example #7
0
 def setUp(self):
     """
     setUP global values
     """
     appport = 19888
     config = TestConfig(appport, os.getenv("COUCHURL"), False);
     self.setConfig(config)
     reqmgrCouchDB = splitCouchServiceURL(config.views.wmstats.reqmgrCouchURL)[1]
     wmstatsCouchDB = splitCouchServiceURL(config.views.wmstats.wmstatsCouchURL)[1]
     self.setCouchDBs([(reqmgrCouchDB, "ReqMgr"), (wmstatsCouchDB, "WMStats")])
     self.setSchemaModules([])
     RESTBaseUnitTestWithDBBackend.setUp(self)
Example #8
0
 def setUp(self):
     """
     setUP global values
     """
     appport = 19888
     config = TestConfig(appport, os.getenv("COUCHURL"), False);
     self.setConfig(config)
     reqmgrCouchDB = splitCouchServiceURL(config.views.wmstats.reqmgrCouchURL)[1]
     wmstatsCouchDB = splitCouchServiceURL(config.views.wmstats.wmstatsCouchURL)[1]
     self.setCouchDBs([(reqmgrCouchDB, "ReqMgr"), (wmstatsCouchDB, "WMStats")])
     self.setSchemaModules([])
     RESTBaseUnitTestWithDBBackend.setUp(self)
Example #9
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"), 
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])
        RESTBaseUnitTestWithDBBackend.setUp(self)

        # put into ReqMgr auxiliary database under "software" document scram/cmsms
        # which we'll need a little for request injection                
        #Warning: this assumes the same structure in jenkins wmcore_root/test
        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests")
        mcFile = open(os.path.join(requestPath, "MonteCarlo.json"), 'r')
        self.mcArgs = JsonWrapper.load(mcFile)["createRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.mcArgs["ScramArch"]] =  []
        cmsswDoc[self.mcArgs["ScramArch"]].append(self.mcArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc)        
Example #10
0
    def setUp(self):
        self.setConfig(config)
        self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr"), 
                          (config.views.data.couch_reqmgr_aux_db, None)])
        self.setSchemaModules([])
        
        RESTBaseUnitTestWithDBBackend.setUp(self)

        self.setFakeDN()
        
        requestPath = os.path.join(getWMBASE(), "test", "data", "ReqMgr", "requests", "DMWM")
        rerecoFile = open(os.path.join(requestPath, "ReReco.json"), 'r')
        
        rerecoArgs = JsonWrapper.load(rerecoFile)
        self.rerecoCreateArgs = rerecoArgs["createRequest"]
        self.rerecoAssignArgs = rerecoArgs["assignRequest"]
        cmsswDoc = {"_id": "software"}
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]] =  []
        cmsswDoc[self.rerecoCreateArgs["ScramArch"]].append(self.rerecoCreateArgs["CMSSWVersion"])
        insertDataToCouch(os.getenv("COUCHURL"), config.views.data.couch_reqmgr_aux_db, cmsswDoc) 
        self.reqSvc = ReqMgr(self.jsonSender["host"]) 
        self.reqSvc._noStale = True      
        self.reqSvc['requests'].additionalHeaders = self.create_header
Example #11
0
 def tearDown(self):
     RESTBaseUnitTestWithDBBackend.tearDown(self)
Example #12
0
 def tearDown(self):
     RESTBaseUnitTestWithDBBackend.tearDown(self)
Example #13
0
 def setUp(self):
     config.main.tools.cms_auth.policy = "dangerously_insecure"
     self.setConfig(config)
     self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr")])
     self.setSchemaModules([])
     RESTBaseUnitTestWithDBBackend.setUp(self)        
Example #14
0
 def setUp(self):
     self.setConfig(config)
     self.setCouchDBs([(config.views.data.couch_reqmgr_db, "ReqMgr")])
     self.setSchemaModules([])
     RESTBaseUnitTestWithDBBackend.setUp(self)