def test_LHCbsubmit(self):

        print "**********************************************************************************************************"

        gLogger.info(
            "\n Submitting hello world job targeting DIRAC.JobDebugger.cern")

        helloJ = LHCbJob()

        helloJ.setName("helloWorld-test-CERN")
        helloJ.setInputSandbox([
            find_all('exe-script.py', '..',
                     '/LHCbDIRAC/tests/System/GridTestSubmission')[0]
        ])
        helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

        helloJ.setCPUTime(17800)
        helloJ.setDestination('DIRAC.JobDebugger.cern')
        result = self.dirac.submitJob(helloJ)
        gLogger.info("Hello world job: ", result)
        jobID = int(result['Value'])
        jobsSubmittedList.append(jobID)

        self.assertTrue(result['OK'])

        print "**********************************************************************************************************"

        gLogger.info("\n Submitting hello world job targeting slc6 machines")

        helloJ = LHCbJob()

        helloJ.setName("helloWorld-test-slc6")
        helloJ.setInputSandbox([
            find_all('exe-script.py', '.',
                     '/LHCbDIRAC/tests/System/GridTestSubmission')[0]
        ])
        helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

        helloJ.setCPUTime(17800)
        helloJ.setPlatform('x86_64-slc6')
        result = self.dirac.submitJob(helloJ)
        gLogger.info("Hello world job: ", result)

        jobID = int(result['Value'])
        jobsSubmittedList.append(jobID)

        self.assertTrue(result['OK'])

        print "**********************************************************************************************************"

        gLogger.info("\n Submitting a job that uploads an output")

        helloJ = LHCbJob()

        helloJ.setName("upload-Output-test")
        helloJ.setInputSandbox( [find_all( 'testFileUpload.txt', '.',
                                           '/LHCbDIRAC/tests/System/GridTestSubmission' )[0]]\
                                            + [find_all( 'exe-script.py', '.',
                                                         '/LHCbDIRAC/tests/System/GridTestSubmission' )[0]] )
        helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

        helloJ.setCPUTime(17800)
        helloJ.setDestination('DIRAC.JobDebugger.cern')

        helloJ.setOutputData(['testFileUpload.txt'])

        result = self.dirac.submitJob(helloJ)
        gLogger.info("Hello world with output: ", result)

        jobID = int(result['Value'])
        jobsSubmittedList.append(jobID)

        self.assertTrue(result['OK'])
Exemplo n.º 2
0
cwd = os.path.realpath('.')

dirac = DiracLHCb()

# Simple Hello Word job to DIRAC.Jenkins.ch
gLogger.info("\n Submitting hello world job targeting DIRAC.Jenkins.ch")
helloJ = LHCbJob()
helloJ.setName("helloWorld-TEST-TO-Jenkins")
try:
  helloJ.setInputSandbox([find_all('exe-script.py', rootPath, '/DIRAC/tests/Workflow/')[0]])
except IndexError:
  helloJ.setInputSandbox([find_all('exe-script.py', os.environ['WORKSPACE'], '/DIRAC/tests/Workflow/')[0]])
helloJ.setExecutable("exe-script.py", "", "helloWorld.log")
helloJ.setCPUTime(17800)
helloJ.setDestination('DIRAC.Jenkins.ch')
result = dirac.submitJob(helloJ)
gLogger.info("Hello world job: ", result)
if not result['OK']:
  gLogger.error("Problem submitting job", result['Message'])
  exit(1)


# Simple Hello Word job to DIRAC.Jenkins.ch, with an input file
gLogger.info("\n Submitting hello world job, with input, targeting DIRAC.Jenkins.ch")
inputJ = LHCbJob()
inputJ.setName("helloWorld-TEST-INPUT-TO-Jenkins")
try:
  inputJ.setInputSandbox([find_all('exe-script-with-input-jenkins.py',
                                   rootPath,
                                   'tests/System/GridTestSubmission')[0]])
Exemplo n.º 3
0
########################################################################################

gLogger.info("\n Submitting hello world job targeting %s" % cernSite)

helloJ = LHCbJob()
dirac = DiracLHCb()

helloJ.setName("helloWorld-test-CERN")
helloJ.setInputSandbox([
    find_all('exe-script.py', rootPath, '/tests/System/GridTestSubmission')[0]
])
helloJ.setExecutable("exe-script.py", "", "helloWorld.log")

helloJ.setCPUTime(17800)
helloJ.setDestination(cernSite)
result = dirac.submitJob(helloJ)
gLogger.info("Hello world job: ", result)

########################################################################################

gLogger.info("\n Submitting hello world job targeting slc6 machines")

helloJ = LHCbJob()
dirac = DiracLHCb()

helloJ.setName("helloWorld-test-slc6")
helloJ.setInputSandbox([
    find_all('exe-script.py', rootPath, '/tests/System/GridTestSubmission')[0]
])
helloJ.setExecutable("exe-script.py", "", "helloWorld.log")