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'])
Example #2
0
########################################################################################

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")

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

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

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

helloJ = LHCbJob()
dirac = DiracLHCb()

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