Skip to content

Commit

Permalink
Merge pull request #46 from brianhlin/sw2450_pbs_cache
Browse files Browse the repository at this point in the history
Verify that the PBS blahp cache is populated
  • Loading branch information
matyasselmeci authored Sep 29, 2016
2 parents 9a0564a + 5bed555 commit abd43b7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
4 changes: 1 addition & 3 deletions osgtest/tests/test_41_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ def test_03_globus_run_pbs(self):
self.verify_job_environment(stdout)

def test_04_condor_run_pbs(self):
core.skip_ok_unless_installed('condor', 'blahp', 'torque-mom', 'torque-server', 'torque-scheduler',
'globus-gatekeeper')
self.skip_bad_unless(core.state['globus-gatekeeper.running'], 'gatekeeper not running')
core.skip_ok_unless_installed('condor', 'blahp', 'torque-mom', 'torque-server', 'torque-scheduler')
self.skip_bad_unless(core.state['jobs.env-set'], 'job environment not set')
self.skip_bad_unless(core.state['condor.running-service'], 'condor not running')
self.skip_bad_unless(core.state['torque.pbs-mom-running'] and core.state['torque.pbs-server-running'],
Expand Down
33 changes: 32 additions & 1 deletion osgtest/tests/test_55_condorce.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,38 @@ def test_05_pbs_trace(self):
os.chdir('/tmp')

command = ('condor_ce_trace', '-a osgTestPBS = True', '--debug', core.get_hostname())
core.check_system(command, 'ce trace against pbs', user=True)
trace_out, _, _ = core.check_system(command, 'ce trace against pbs', user=True)

pbs_jobid = re.search(r'PBS_JOBID=(\d+)', trace_out).group(1)
pbs_cache_file = '/var/tmp/qstat_cache_%s/blahp_results_cache' % core.options.username

f = open(pbs_cache_file, 'r')
pbs_cache = f.read()
f.close()

# Verify PBS job ID in cache for multiple formats between the different
# versions of the blahp. For blahp-1.18.16.bosco-1.osg32:
#
# 2: [BatchJobId="2"; WorkerNode="fermicloud171.fnal.gov-0"; JobStatus=4; ExitCode= 0; ]\n
#
# For blahp-1.18.25.bosco-1.osg33:
#
# 5347907 "(dp0
# S'BatchJobId'
# p1
# S'""5347907""'
# p2
# sS'WorkerNode'
# p3
# S'""node1358""'
# p4
# sS'JobStatus'
# p5
# S'2'
# p6
# s."
self.assert_(re.search(r'BatchJobId[=\s"\'p1S]+%s' % pbs_jobid, pbs_cache),
'Job %s not found in PBS blahp cache:\n%s' % (pbs_jobid, pbs_cache))

os.chdir(cwd)

Expand Down

0 comments on commit abd43b7

Please sign in to comment.