def helloWorldJob(): job = Job() job.setName( "helloWorld" ) exeScriptLocation = find_all( 'exe-script.py', '.', 'WorkloadManagementSystem' )[0] job.setInputSandbox( exeScriptLocation ) job.setExecutable( exeScriptLocation, "", "helloWorld.log" ) return job
def setUp( self ): super( IntegrationTest, self ).setUp() self.dirac = Dirac() exeScriptLoc = find_all( 'exe-script.py', '.', 'Regression' )[0] helloWorldLoc = find_all( 'helloWorld.py', '.', 'Regression' )[0] shutil.copyfile( exeScriptLoc, './exe-script.py' ) shutil.copyfile( helloWorldLoc, './helloWorld.py' ) helloWorldXMLLocation = find_all( 'helloWorld.xml', '.', 'Regression' )[0] self.j_u_hello = Job( helloWorldXMLLocation ) helloWorldXMLFewMoreLocation = find_all( 'helloWorld.xml', '.', 'Regression' )[0] self.j_u_helloPlus = Job( helloWorldXMLFewMoreLocation )
def test_execute( self ): job = Job() job.setName( "helloWorld-test" ) job.setExecutable( find_all( "helloWorld.py", '.', 'Integration' )[0], arguments = "This is an argument", logFile = "aLogFileForTest.txt" , parameters=[('executable', 'string', '', "Executable Script"), ('arguments', 'string', '', 'Arguments for executable Script'), ( 'applicationLog', 'string', '', "Log file name" ), ( 'someCustomOne', 'string', '', "boh" )], paramValues = [( 'someCustomOne', 'aCustomValue' )] ) job.setBannedSites( ['LCG.SiteA.com', 'DIRAC.SiteB.org'] ) job.setOwner( 'ownerName' ) job.setOwnerGroup( 'ownerGroup' ) job.setName( 'jobName' ) job.setJobGroup( 'jobGroup' ) job.setType( 'jobType' ) job.setDestination( 'DIRAC.someSite.ch' ) job.setCPUTime( 12345 ) job.setLogLevel( 'DEBUG' ) res = job.runLocal( self.d ) self.assertTrue( res['OK'] )
def test_execute(self): job = Job() job.setName("helloWorld-test") job.setExecutable(find_all("helloWorld.py", '.', 'Integration')[0], arguments="This is an argument", logFile="aLogFileForTest.txt", parameters=[('executable', 'string', '', "Executable Script"), ('arguments', 'string', '', 'Arguments for executable Script'), ('applicationLog', 'string', '', "Log file name"), ('someCustomOne', 'string', '', "boh")], paramValues=[('someCustomOne', 'aCustomValue')]) job.setBannedSites(['LCG.SiteA.com', 'DIRAC.SiteB.org']) job.setOwner('ownerName') job.setOwnerGroup('ownerGroup') job.setName('jobName') job.setJobGroup('jobGroup') job.setType('jobType') job.setDestination('DIRAC.someSite.ch') job.setCPUTime(12345) job.setLogLevel('DEBUG') res = job.runLocal(self.d) self.assertTrue(res['OK'])
def helloWorld(): J = baseToAllJobs('helloWorld') J.setInputSandbox( [find_all('exe-script.py', '.', 'GridTestSubmission')[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") return endOfAllJobs(J)
def helloWorldJob(): job = Job() job.setName("helloWorld") exeScriptLocation = find_all('exe-script.py', '.', 'WorkloadManagementSystem')[0] job.setInputSandbox(exeScriptLocation) job.setExecutable(exeScriptLocation, "", "helloWorld.log") return job
def test_submit(self): print "**********************************************************************************************************" gLogger.info("\n Submitting hello world job") helloJ = Job() helloJ.setName("helloWorld-test-T2s") helloJ.setInputSandbox( [find_all('exe-script.py', '.', 'GridTestSubmission')[0]]) helloJ.setExecutable("exe-script.py", "", "helloWorld.log") helloJ.setCPUTime(17800) result = self.dirac.submit(helloJ) gLogger.info("Hello world job: ", result) jobID = int(result['Value']) jobsSubmittedList.append(jobID) self.assert_(result['OK']) print "**********************************************************************************************************" gLogger.info("\n Submitting a job that uploads an output") helloJ = Job() helloJ.setName("upload-Output-test") helloJ.setInputSandbox( [find_all('testFileUpload.txt', '.', 'GridTestSubmission')[0]]) helloJ.setExecutable("exe-script.py", "", "helloWorld.log") helloJ.setCPUTime(17800) helloJ.setOutputData(['testFileUpload.txt']) result = self.dirac.submit(helloJ) gLogger.info("Hello world with output: ", result) jobID = int(result['Value']) jobsSubmittedList.append(jobID) self.assert_(result['OK'])
def test_execute( self ): """ this one tests that I can execute a job that requires multi-processing """ j = Job() j.setName( "MP-test" ) j.setExecutable( self.mpExe ) j.setInputSandbox( find_all( 'mpTest.py', '.', 'Utilities' )[0] ) j.setTag( 'MultiProcessor' ) res = j.runLocal( self.d ) self.assertTrue( res['OK'] )
def test_SSCChain( self ): """ full test of functionalities """ ssc = SandboxStoreClient() smDB = SandboxMetadataDB() exeScriptLocation = find_all( 'exe-script.py', '.', 'WorkloadManagementSystem' )[0] fileList = [exeScriptLocation] res = ssc.uploadFilesAsSandbox( fileList ) self.assert_( res['OK'] ) # SEPFN = res['Value'].split( '|' )[1] res = ssc.uploadFilesAsSandboxForJob( fileList, 1, 'Input' ) self.assert_( res['OK'] ) # res = ssc.downloadSandboxForJob( 1, 'Input' ) #to run this would need the RSS on # self.assert_( res['OK'] ) # only ones needing the DB res = smDB.getUnusedSandboxes() self.assert_( res['OK'] )
def setUp(self): super(IntegrationTest, self).setUp() self.d = Dirac() self.exeScriptLocation = find_all('exe-script.py', '.', 'Integration')[0]
def helloWorld(): J = baseToAllJobs( 'helloWorld' ) J.setInputSandbox( [find_all( 'exe-script.py', '.', 'GridTestSubmission' )[0]] ) J.setExecutable( "exe-script.py", "", "helloWorld.log" ) return endOfAllJobs( J )
def setUp( self ): super( IntegrationTest, self ).setUp() self.d = Dirac() self.exeScriptLocation = find_all( 'exe-script.py', '.', 'Integration' )[0]
def setUp( self ): super( IntegrationTest, self ).setUp() self.d = Dirac() self.exeScriptLocation = find_all( 'exe-script.py', '.', 'Integration' )[0] self.mpExe = find_all( 'testMpJob.sh', '.', 'Utilities' )[0]