Skip to content

Commit 81e18a7

Browse files
author
efajardo
committed
Updating my changes
First commit wiht the changes for TPT configuring the xrootd HTTP servers for TPC Adding scitokens to the tests
1 parent 5a54660 commit 81e18a7

File tree

2 files changed

+100
-5
lines changed

2 files changed

+100
-5
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
sudo: required
22
env:
33
matrix:
4-
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun
5-
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun
6-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun,singularity-runtime,osg-oasis
7-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun,singularity-runtime,osg-oasis
8-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=xrootd,xrootd-client,xrootd-multiuser,globus-proxy-utils
4+
# - OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun
5+
# - OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun
6+
# - OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun,singularity-runtime,osg-oasis
7+
# - OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun,singularity-runtime,osg-oasis
8+
- OS_TYPE=centos OS_VERSION=7 PACKAGES=xrootd,xrootd-client,xrootd-multiuser,xrootd-scitokens,globus-proxy-utils
99

1010
services:
1111
- docker
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import os
2+
import pwd
3+
import osgtest.library.core as core
4+
import osgtest.library.files as files
5+
import osgtest.library.service as service
6+
import osgtest.library.osgunittest as osgunittest
7+
8+
9+
HTTP_PORT1 = 9001 # chosen so it doesn't conflict w/ the stashcache instances
10+
HTTP_PORT2 = 9002
11+
12+
XROOTD_CFG_TEXT = """\
13+
cms.space min 2g 5g
14+
xrootd.seclib /usr/lib64/libXrdSec-4.so
15+
sec.protocol /usr/lib64 gsi -certdir:/etc/grid-security/certificates \
16+
-cert:/etc/grid-security/xrd/xrdcert.pem \
17+
-key:/etc/grid-security/xrd/xrdkey.pem \
18+
-crl:3 \
19+
--gmapopt:10 \
20+
--gmapto:0 \
21+
%s
22+
23+
acc.authdb /etc/xrootd/auth_file
24+
ofs.authorize
25+
26+
if exec xrootd
27+
http.cadir /etc/grid-security/certificates
28+
http.cert /etc/grid-security/xrd/xrdcert.pem
29+
http.key /etc/grid-security/xrd/xrdkey.pem
30+
http.secxtractor /usr/lib64/libXrdLcmaps.so
31+
http.listingdeny yes
32+
http.desthttps yes
33+
34+
# Enable third-party-copy
35+
http.exthandler xrdtpc libXrdHttpTPC.so
36+
# Pass the bearer token to the Xrootd authorization framework.
37+
http.header2cgi Authorization authz
38+
39+
# Enable Macaroons
40+
ofs.authlib libXrdMacaroons.so libXrdAccSciTokens.so
41+
42+
fi
43+
44+
if named xrd-TPC-1
45+
xrd.protocol http:%d /usr/lib64/libXrdHttp-4.so
46+
fi
47+
48+
if named xrd-TPC-2
49+
xrd.protocol http:%d /usr/lib64/libXrdHttp-4.so
50+
fi
51+
end
52+
"""
53+
54+
class TestStartXrootdTPC(osgunittest.OSGTestCase):
55+
@core.elrelease(7,8)
56+
def test_01_start_xrootd(self):
57+
core.config['certs.xrootdcert'] = '/etc/grid-security/xrd/xrdcert.pem'
58+
core.config['certs.xrootdkey'] = '/etc/grid-security/xrd/xrdkey.pem'
59+
core.config['xrootd.tpc.config'] = '/etc/xrootd/xrootd-third-party-copy.cfg'
60+
core.config['xrootd.tpc.http-port1'] = HTTP_PORT1
61+
core.config['xrootd.tpc.http-port2'] = HTTP_PORT2
62+
core.state['xrootd.started-http-server-1'] = False
63+
core.state['xrootd.started-http-server-2'] = False
64+
core.state['xrootd.tpc.backups-exist'] = False
65+
66+
self.skip_ok_unless(core.options.adduser, 'user not created')
67+
core.skip_ok_unless_installed('xrootd', by_dependency=True)
68+
69+
user = pwd.getpwnam("xrootd")
70+
core.skip_ok_unless_installed('globus-proxy-utils')
71+
72+
lcmaps_packages = ('lcmaps', 'lcmaps-db-templates', 'xrootd-lcmaps', 'vo-client', 'vo-client-lcmaps-voms')
73+
if all([core.rpm_is_installed(x) for x in lcmaps_packages]):
74+
core.log_message("Using xrootd-lcmaps authentication")
75+
sec_protocol = '-authzfun:libXrdLcmaps.so -authzfunparms:--loglevel,5'
76+
if core.PackageVersion('xrootd-lcmaps') >= '1.4.0':
77+
sec_protocol += ',--policy,authorize_only'
78+
else:
79+
core.log_message("Using XRootD mapfile authentication")
80+
sec_protocol = '-gridmap:/etc/grid-security/xrd/xrdmapfile'
81+
82+
files.append(core.config['xrootd.tpc.config'],
83+
XROOTD_CFG_TEXT % (sec_protocol, core.config['xrootd.port']),
84+
owner='xrootd', backup=True)
85+
core.state['xrootd.tpc.backups-exist'] = True
86+
87+
def test_02_start_xrootd(self):
88+
core.skip_ok_unless_installed('xrootd', 'xrootd-scitokens', by_dependency=True)
89+
core.config['xrootd_tpc_service_1'] = "xrd-TPC-1@third-party-copy"
90+
core.config['xrootd_tpc_service_2'] = "xrd-TPC-2@third-party-copy"
91+
service.check_start(core.config['xrootd_tpc_service_1'])
92+
service.check_start(core.config['xrootd_tpc_service_2'])
93+
94+
core.state['xrootd_tpc_service_1'] = True
95+
core.state['xrootd_tpc_service_2'] = True

0 commit comments

Comments
 (0)