Skip to content

Commit e51d6a3

Browse files
authored
Merge pull request #190 from opensciencegrid/Fix-TPC-tests
added the suggestion from @matyasselmeci.
2 parents 28ab68a + ede1b0f commit e51d6a3

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

osgtest/library/service.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ def start(service_name):
3636
core.check_system(command, 'Start ' + service_name + ' service')
3737
core.state[service_name + '.started-service'] = True
3838

39-
def check_start(service_name, timeout=10, log_to_check = None):
39+
def check_start(service_name, timeout=10, log_to_check = None, min_up_time=0):
4040
"""
4141
Start a service, 'service_name' via init script or systemd and ensure that
42-
it starts running within a 'timeout' second window (default=10s)
42+
it starts running within a 'timeout' second window (default=10s).
43+
Will wait 'min_up_time' seconds before checking; the timeout window starts
44+
after min_up_time has been reached.
4345
"""
4446
start(service_name)
47+
time.sleep(min_up_time)
4548
assert is_running(service_name, timeout=10, log_to_check = log_to_check), "%s is not running" % service_name
4649

4750
def stop(service_name):

osgtest/tests/test_158_xrootd_tpc.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
if named third-party-copy-1
2222
set HttpPort = 9001
2323
macaroons.secretkey /etc/xrootd/macaroon-secret-1
24+
xrd.port 9001
2425
fi
2526
if named third-party-copy-2
2627
set HttpPort = 9002
2728
macaroons.secretkey /etc/xrootd/macaroon-secret-2
29+
xrd.port 9002
2830
fi
2931
"""
3032

@@ -94,9 +96,13 @@ def test_02_create_secrets(self):
9496
core.config['xrootd.tpc.macaroon-secret-2'], "64"], "Creating symmetric key")
9597

9698
def test_03_start_xrootd(self):
97-
core.config['xrootd_tpc_service_1'] = "xrootd@third-party-copy-1"
98-
core.config['xrootd_tpc_service_2'] = "xrootd@third-party-copy-2"
99-
service.check_start(core.config['xrootd_tpc_service_1'], log_to_check = '/var/log/xrootd/third-party-copy-1/xrootd.log')
100-
service.check_start(core.config['xrootd_tpc_service_2'], log_to_check = '/var/log/xrootd/third-party-copy-2/xrootd.log')
99+
if core.rpm_is_installed("xrootd-multiuser"):
100+
core.config['xrootd_tpc_service_1'] = "xrootd-privileged@third-party-copy-1"
101+
core.config['xrootd_tpc_service_2'] = "xrootd-privileged@third-party-copy-2"
102+
else:
103+
core.config['xrootd_tpc_service_1'] = "xrootd@third-party-copy-1"
104+
core.config['xrootd_tpc_service_2'] = "xrootd@third-party-copy-2"
105+
service.check_start(core.config['xrootd_tpc_service_1'], log_to_check = '/var/log/xrootd/third-party-copy-1/xrootd.log', min_up_time = 5)
106+
service.check_start(core.config['xrootd_tpc_service_2'], log_to_check = '/var/log/xrootd/third-party-copy-2/xrootd.log', min_up_time = 5)
101107
core.state['xrootd.started-http-server-1'] = True
102108
core.state['xrootd.started-http-server-2'] = True

0 commit comments

Comments
 (0)