def setupSchema(self, groupName = 'PeopleLikeMe', userName = '******', teamName = 'White Sox', CMSSWVersion = 'CMSSW_3_5_8', scramArch = 'slc5_ia32_gcc434'): """ _setupSchema_ Set up a test schema so that we can run a test request. Standardization! """ self.jsonSender.put('user/%[email protected]' % userName) self.jsonSender.put('group/%s' % groupName) self.jsonSender.put('group/%s/%s' % (groupName, userName)) self.jsonSender.put(urllib.quote('team/%s' % teamName)) self.jsonSender.put('version/%s/%s' % (CMSSWVersion, scramArch)) schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" schema['Requestor'] = '%s' % userName schema['Group'] = '%s' % groupName return schema
def setUp(self): RESTBaseUnitTest.setUp(self) self.testInit.setupCouch("%s" % self.couchDBName, "GroupUser", "ConfigCache") self.params = {} self.params['endpoint'] = self.config.getServerUrl() self.reqService = RequestManagerDS(self.params) self.jsonSender = JSONRequests(self.config.getServerUrl()) self.jsonSender.put('user/[email protected]') self.jsonSender.put('group/PeopleLikeMe') self.jsonSender.put('group/PeopleLikeMe/me') self.jsonSender.put('version/CMSSW_3_5_8/slc5_ia32_gcc434') schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" schema['Requestor'] = '%s' % "me" schema['Group'] = '%s' % "PeopleLikeMe" schema['BlockWhitelist'] = ['/dataset/dataset/dataset#alpha'] schema['BlockBlacklist'] = ['/dataset/dataset/dataset#beta'] schema['Campaign'] = 'MyTestCampaign' try: r = self.jsonSender.put('request/' + schema['RequestName'], schema) except Exception, ex: print "Exception during set up, investigate exception instance attributes:" print dir(ex) return
def setupSchema( self, groupName="PeopleLikeMe", userName="******", teamName="White Sox", CMSSWVersion="CMSSW_3_5_8", scramArch="slc5_ia32_gcc434", ): """ _setupSchema_ Set up a test schema so that we can run a test request. Standardization! """ self.jsonSender.put("user/%[email protected]" % userName) self.jsonSender.put("group/%s" % groupName) self.jsonSender.put("group/%s/%s" % (groupName, userName)) self.jsonSender.put(urllib.quote("team/%s" % teamName)) self.jsonSender.put("version/%s/%s" % (CMSSWVersion, scramArch)) schema = ReReco.getTestArguments() schema["RequestName"] = "TestReReco" schema["RequestType"] = "ReReco" schema["CmsPath"] = "/uscmst1/prod/sw/cms" schema["Requestor"] = "%s" % userName schema["Group"] = "%s" % groupName schema["CustodialSite"] = "US_T1_FNAL" schema["TimePerEvent"] = "12" schema["Memory"] = 3000 schema["SizePerEvent"] = 512 return schema
def getSchema(groupName = 'PeopleLikeMe', userName = '******'): schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" schema['Requestor'] = '%s' % userName schema['Group'] = '%s' % groupName schema['TimePerEvent'] = '12' schema['Memory'] = 3000 schema['SizePerEvent'] = 512 return schema
def getSchema(groupName = 'PeopleLikeMe', userName = '******'): schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" schema['Requestor'] = '%s' % userName schema['Group'] = '%s' % groupName schema['CustodialSite'] = 'US_T1_FNAL' schema['TimePerEvent'] = '12' schema['Memory'] = 3000 schema['SizePerEvent'] = 512 return schema
def createRequests(self, numRequests): """ Inject new numRequests into ReqMgr instance. (see ReqMgr_t testE how to create a request) """ logging.info("Creating %s new requests ..." % numRequests) schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" schema['Requestor'] = '%s' % "testinguser" schema['Group'] = '%s' % "PeopleLikeMe" schema['BlockWhitelist'] = ['/dataset/dataset/dataset#alpha'] schema['BlockBlacklist'] = ['/dataset/dataset/dataset#beta'] schema['Campaign'] = 'MyTestCampaign' for i in range(numRequests): urlQuery = "request/testRequest" logging.info("Query: '%s':" % urlQuery) r = self.restSender.put(urlQuery, schema) # print "request creating response: ", r print "created: ", r[0]["RequestName"]
def createRequests(self, numRequests): """ Inject new numRequests into ReqMgr instance. (see ReqMgr_t testE how to create a request) """ logging.info("Creating %s new requests ..." % numRequests) schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" schema['Requestor'] = '%s' % "zmaxa" schema['Group'] = '%s' % "DATAOPS" schema['BlockWhitelist'] = ['/dataset/dataset/dataset#alpha'] schema['BlockBlacklist'] = ['/dataset/dataset/dataset#beta'] schema['Campaign'] = 'MyTestCampaign' for i in range(numRequests): urlQuery = "request/testRequest" print "Query: '%s':" % urlQuery print "Schema (request): '%s'" % schema r = self.restSender.put(urlQuery, schema) # print "request creating response: ", r print "created: ", r[0]["RequestName"]
def testReReco(self): schema = ReReco.getTestArguments() schema['RequestName'] = 'TestReReco' schema['RequestType'] = 'ReReco' schema['CmsPath'] = "/uscmst1/prod/sw/cms" self.doRequest(schema)
def createReRecoSpec(self, specName, returnType="spec"): spec = ReReco.rerecoWorkload(specName, ReRecoParams.MinBiasWithoutEmulator) return self._selectReturnType(spec, returnType)
def testReReco(self): self.do('ReReco', ReRecoSpec.getTestArguments())