job = Job()
# ... and its parameters ...
p = {}
- p[EXECUTABLE] = './copied-' + config.EXEC_TEST_NAME
+ p[EXECUTABLE] = config.EXEC_TEST_FULL_PATH
p[ARGUMENTS] = ["copied-seta.sh", "copied-setb.sh", "orig-result.txt"];
p[NAME] = 'Test_Python_Local_SH'
p[WORKDIR] = config.TEST_LOCAL_SH_WORK_DIR
- p[INFILE] = [('seta.sh', 'copied-seta.sh'), ('setb.sh', 'copied-setb.sh'),
- (config.EXEC_TEST_FULL_PATH, 'copied-' + config.EXEC_TEST_NAME)]
- p[OUTFILE] = [('result.txt', 'orig-result.txt')]
+ p[INFILE] = [('seta.sh', p[WORKDIR] + '/copied-seta.sh'),
+ ('setb.sh', p[WORKDIR] + '/copied-setb.sh')]
+ p[OUTFILE] = [('result.txt', p[WORKDIR] + '/orig-result.txt')]
job.setParametre(p)
# ... and its environment
e = {}
# Get the catalog
c = BatchManagerCatalog.getInstance()
- # Create a BatchManager of type Local_SSH on localhost
- bm = c('SH')('localhost')
+ # Create a BatchManager of type Local_SH on localhost
+ bm = c('LOCAL')('localhost', '', SH)
# Submit the job to the BatchManager
jobid = bm.submitJob(job)
# Wait for the end of the job
state = bm.waitForJobEnd(jobid, config.TEST_LOCAL_SH_TIMEOUT);
+
+ if state == FINISHED:
+ print "Job", jobid, "is done"
+ bm.importOutputFiles(job, "resultdir/seconddirname")
+ elif state == FAILED:
+ print "Job", jobid, " finished in error"
+ bm.importOutputFiles(job, "resultdir/seconddirname")
+ return 1
+ else:
+ print "Timeout while executing job"
+ return 1
+
if state != FINISHED and state != FAILED:
print "Error: Job not finished after timeout"
return 1;
- print "Job", jobid, "is done"
-
# test the result file
exp = "c = 12"
- f = open('result.txt')
+ f = open('resultdir/seconddirname/result.txt')
res = f.read().strip()
print "result found : %s, expected : %s" % (res, exp)