def test_matcher(self): # insert a proper DN to run the test resourceDescription = { "OwnerGroup": "prod", "OwnerDN": "/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser", "DIRACVersion": "pippo", "GridCE": "some.grid.ce.org", "ReleaseVersion": "blabla", "VirtualOrganization": "LHCb", "PilotInfoReportedFlag": "True", "PilotBenchmark": "anotherPilot", "Site": "DIRAC.Jenkins.ch", "CPUTime": 86400, } wmsClient = WMSClient() job = helloWorldJob() job.setDestination("DIRAC.Jenkins.ch") job.setInputData("/a/bbb") job.setType("User") jobDescription = createFile(job) res = wmsClient.submitJob(job._toJDL(xmlFile=jobDescription)) self.assertTrue(res["OK"], res.get("Message")) jobID = res["Value"] # forcing the update res = JobStateUpdateClient().setJobStatus(jobID, JobStatus.WAITING, "matching", "source", None, True) self.assertTrue(res["OK"], res.get("Message")) tqDB = TaskQueueDB() tqDefDict = { "OwnerDN": "/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser", "OwnerGroup": "prod", "Setup": "dirac-JenkinsSetup", "CPUTime": 86400, } res = tqDB.insertJob(jobID, tqDefDict, 10) self.assertTrue(res["OK"], res.get("Message")) res = MatcherClient().requestJob(resourceDescription) print(res) self.assertTrue(res["OK"], res.get("Message")) wmsClient.deleteJob(jobID)
def test_matcher(self): # insert a proper DN to run the test resourceDescription = { 'OwnerGroup': 'prod', 'OwnerDN': '/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser/[email protected]', 'DIRACVersion': 'pippo', 'ReleaseVersion': 'blabla', 'VirtualOrganization': 'LHCb', 'PilotInfoReportedFlag': 'True', 'PilotBenchmark': 'anotherPilot', 'Site': 'DIRAC.Jenkins.ch', 'CPUTime': 86400 } wmsClient = WMSClient() job = helloWorldJob() job.setDestination('DIRAC.Jenkins.ch') job.setInputData('/a/bbb') job.setType('User') jobDescription = createFile(job) res = wmsClient.submitJob(job._toJDL(xmlFile=jobDescription)) self.assertTrue(res['OK'], res.get('Message')) jobID = res['Value'] res = JobStateUpdateClient().setJobStatus(jobID, 'Waiting', 'matching', 'source') self.assertTrue(res['OK'], res.get('Message')) tqDB = TaskQueueDB() tqDefDict = { 'OwnerDN': '/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser/[email protected]', 'OwnerGroup': 'prod', 'Setup': 'dirac-JenkinsSetup', 'CPUTime': 86400 } res = tqDB.insertJob(jobID, tqDefDict, 10) self.assertTrue(res['OK'], res.get('Message')) res = MatcherClient().requestJob(resourceDescription) print(res) self.assertTrue(res['OK'], res.get('Message')) wmsClient.deleteJob(jobID)