8
8
except ImportError :
9
9
from urllib .request import urlopen
10
10
11
- import osgtest .library .condor as condor
12
11
import osgtest .library .core as core
13
12
import osgtest .library .files as files
14
13
import osgtest .library .service as service
@@ -20,6 +19,8 @@ class TestCondorCE(osgunittest.OSGTestCase):
20
19
def setUp (self ):
21
20
# Enforce GSI auth for testing
22
21
os .environ ['_condor_SEC_CLIENT_AUTHENTICATION_METHODS' ] = 'GSI'
22
+ core .skip_ok_unless_installed ('condor' , 'htcondor-ce' , 'htcondor-ce-client' )
23
+ self .skip_bad_unless (service .is_running ('condor-ce' ), 'ce not running' )
23
24
24
25
def tearDown (self ):
25
26
os .environ .pop ('_condor_SEC_CLIENT_AUTHENTICATION_METHODS' )
@@ -64,37 +65,27 @@ def run_blahp_trace(self, lrms):
64
65
# S'2'
65
66
# p6
66
67
# s."
67
- self .assert_ (re .search (r'BatchJobId[=\s"\'p1S]+%s' % backend_jobid , cache ),
68
- 'Job %s not found in %s blahp cache:\n %s' % (backend_jobid , lrms .upper (), cache ))
68
+ self .assertTrue (re .search (r'BatchJobId[=\s"\'p1S]+%s' % backend_jobid , cache ),
69
+ 'Job %s not found in %s blahp cache:\n %s' % (backend_jobid , lrms .upper (), cache ))
69
70
70
71
os .chdir (cwd )
71
72
72
- def general_requirements (self ):
73
- core .skip_ok_unless_installed ('condor' , 'htcondor-ce' , 'htcondor-ce-client' )
74
- self .skip_bad_unless (service .is_running ('condor-ce' ), 'ce not running' )
75
-
76
73
def test_01_status (self ):
77
- self .general_requirements ()
78
-
79
74
command = ('condor_ce_status' , '-any' )
80
75
core .check_system (command , 'ce status' , user = True )
81
76
82
77
def test_02_queue (self ):
83
- self .general_requirements ()
84
-
85
78
command = ('condor_ce_q' , '-verbose' )
86
79
core .check_system (command , 'ce queue' , user = True )
87
80
88
81
def test_03_ping (self ):
89
- self .general_requirements ()
90
82
self .skip_bad_unless (core .state ['proxy.valid' ], 'requires a proxy cert' )
91
83
92
84
command = ('condor_ce_ping' , 'WRITE' , '-verbose' )
93
85
stdout , _ , _ = core .check_system (command , 'ping using GSI and gridmap' , user = True )
94
- self .assert_ (re .search (r'Authorized:\s*TRUE' , stdout ), 'could not authorize with GSI' )
86
+ self .assertTrue (re .search (r'Authorized:\s*TRUE' , stdout ), 'could not authorize with GSI' )
95
87
96
88
def test_04_trace (self ):
97
- self .general_requirements ()
98
89
self .skip_bad_unless (core .state ['condor-ce.schedd-ready' ], 'CE schedd not ready to accept jobs' )
99
90
self .skip_bad_unless (core .state ['proxy.valid' ], 'requires a proxy cert' )
100
91
@@ -107,7 +98,6 @@ def test_04_trace(self):
107
98
os .chdir (cwd )
108
99
109
100
def test_05_pbs_trace (self ):
110
- self .general_requirements ()
111
101
self .skip_bad_unless (core .state ['condor-ce.schedd-ready' ], 'CE schedd not ready to accept jobs' )
112
102
core .skip_ok_unless_installed ('torque-mom' , 'torque-server' , 'torque-scheduler' , 'torque-client' , 'munge' ,
113
103
by_dependency = True )
@@ -116,7 +106,6 @@ def test_05_pbs_trace(self):
116
106
self .run_blahp_trace ('pbs' )
117
107
118
108
def test_06_slurm_trace (self ):
119
- self .general_requirements ()
120
109
core .skip_ok_unless_installed (core .SLURM_PACKAGES )
121
110
self .skip_bad_unless (service .is_running ('munge' ), 'slurm requires munge' )
122
111
self .skip_bad_unless (core .state ['condor-ce.schedd-ready' ], 'CE schedd not ready to accept jobs' )
@@ -126,7 +115,6 @@ def test_06_slurm_trace(self):
126
115
127
116
def test_07_ceview (self ):
128
117
core .config ['condor-ce.view-listening' ] = False
129
- self .general_requirements ()
130
118
core .skip_ok_unless_installed ('htcondor-ce-view' )
131
119
view_url = 'http://%s:%s' % (core .get_hostname (), int (core .config ['condor-ce.view-port' ]))
132
120
try :
@@ -141,6 +129,5 @@ def test_07_ceview(self):
141
129
debug_contents += 'Failed to read %s\n ' % debug_file
142
130
core .log_message (debug_contents )
143
131
self .fail ('Could not reach HTCondor-CE View at %s: %s' % (view_url , err ))
144
- self .assert_ (re .search (r'HTCondor-CE Overview' , src ), 'Failed to find expected CE View contents' )
132
+ self .assertTrue (re .search (r'HTCondor-CE Overview' , src ), 'Failed to find expected CE View contents' )
145
133
core .config ['condor-ce.view-listening' ] = True
146
-
0 commit comments