10
10
HTTP_PORT2 = 9002
11
11
12
12
XROOTD_CFG_TEXT = """\
13
- cms.space min 2g 5g
14
- xrootd.seclib /usr/lib64/libXrdSec.so
15
- http.secxtractor /usr/lib64/libXrdLcmaps.so
16
-
17
- sec.protocol /usr/lib64 gsi -d 2 -certdir:/etc/grid-security/certificates \
18
- -cert:/etc/grid-security/xrd/xrdcert.pem \
19
- -key:/etc/grid-security/xrd/xrdkey.pem \
20
- -crl:1 \
21
- -ca:0 \
22
- --gmapopt:10 \
23
- --gmapto:0 \
24
- %s
25
-
26
- acc.authdb /etc/xrootd/auth_file
27
- ofs.authorize
28
- all.export /
29
-
30
- if exec xrootd
31
- http.cadir /etc/grid-security/certificates
32
- http.cert /etc/grid-security/xrd/xrdcert.pem
33
- http.key /etc/grid-security/xrd/xrdkey.pem
34
- http.listingdeny yes
35
- http.desthttps yes
36
- http.trace all debug
37
- # Enable third-party-copy
38
- http.exthandler xrdtpc libXrdHttpTPC.so
39
- # Pass the bearer token to the Xrootd authorization framework.
40
- http.header2cgi Authorization authz
41
-
42
- # Enable Macaroons
43
- ofs.authlib libXrdMacaroons.so
44
- xrd.port %d
45
- xrd.protocol http:%d /usr/lib64/libXrdHttp-4.so
13
+ all.adminpath /var/spool/xrootd
14
+ all.pidpath /var/run/xrootd
15
+ set resourcename = VDTTEST
16
+ continue /etc/xrootd/config.d/
17
+ """
18
+
19
+
20
+ XROOTD_MACAROON_TXT = """\
21
+ if named third-party-copy-1
22
+ set HttpPort = 9001
23
+ macaroons.secretkey /etc/xrootd/macaroon-secret-1
24
+ fi
25
+ if named third-party-copy-2
26
+ set HttpPort = 9002
27
+ macaroons.secretkey /etc/xrootd/macaroon-secret-2
28
+ fi
29
+ """
30
+
31
+ XROOTD_STANDALONE_TXT = """\
32
+ set EnableHttp = 1
33
+ set EnableLcmaps = 1
34
+
35
+ if named standalone
36
+ set HttpPort = 1094
37
+ xrd.port $(HttpPort)
46
38
fi
47
- http.exthandler xrdmacaroons libXrdMacaroons.so
48
- all.sitename VDTTESTSITE
49
39
40
+ all.role server
41
+ cms.allow host *
42
+
43
+ # Logging verbosity
44
+ xrootd.trace emsg login stall redirect
45
+ ofs.trace -all
46
+ xrd.trace conn
47
+ cms.trace all
48
+
49
+ xrd.network keepalive kaparms 10m,1m,5
50
+ xrd.timeout idle 60m
50
51
"""
51
52
52
53
class TestStartXrootdTPC (osgunittest .OSGTestCase ):
53
54
@core .elrelease (7 ,8 )
54
55
def setUp (self ):
55
- core .skip_ok_unless_installed ("xrootd" ,
56
+ core .skip_ok_unless_installed ("osg- xrootd-standalone " ,
56
57
by_dependency = True )
57
58
if core .rpm_is_installed ("xcache" ):
58
59
self .skip_ok_if (core .PackageVersion ("xcache" ) >= "1.0.2" , "xcache 1.0.2+ configs conflict with xrootd tests" )
59
60
60
61
def test_01_configure_xrootd (self ):
61
62
core .config ['xrootd.tpc.config-1' ] = '/etc/xrootd/xrootd-third-party-copy-1.cfg'
62
63
core .config ['xrootd.tpc.config-2' ] = '/etc/xrootd/xrootd-third-party-copy-2.cfg'
63
- core .config ['xrootd.tpc.http-port1' ] = HTTP_PORT1
64
- core .config ['xrootd.tpc.http-port2' ] = HTTP_PORT2
64
+ core .config ['xrootd.tpc.basic-config' ] = '/etc/xrootd/config.d/36-osg-test-tpc.cfg'
65
65
core .state ['xrootd.started-http-server-1' ] = False
66
66
core .state ['xrootd.started-http-server-2' ] = False
67
67
core .state ['xrootd.tpc.backups-exist' ] = False
@@ -71,21 +71,18 @@ def test_01_configure_xrootd(self):
71
71
72
72
user = pwd .getpwnam ("xrootd" )
73
73
74
- lcmaps_packages = ('lcmaps' , 'lcmaps-db-templates' , 'xrootd-lcmaps' , 'vo-client' , 'vo-client-lcmaps-voms' )
75
- if all ([core .rpm_is_installed (x ) for x in lcmaps_packages ]):
76
- core .log_message ("Using xrootd-lcmaps authentication" )
77
- sec_protocol = '-authzfun:libXrdLcmaps.so -authzfunparms:--loglevel,5'
78
- sec_protocol += ',--policy,authorize_only'
79
- else :
80
- core .log_message ("Using XRootD mapfile authentication" )
81
- sec_protocol = '-gridmap:/etc/grid-security/xrd/xrdmapfile'
82
-
83
74
files .write (core .config ['xrootd.tpc.config-1' ],
84
- XROOTD_CFG_TEXT % ( sec_protocol , core . config [ 'xrootd.tpc.http-port1' ], core . config [ 'xrootd.tpc.http-port1' ]) ,
75
+ XROOTD_CFG_TEXT ,
85
76
owner = 'xrootd' , backup = True , chown = (user .pw_uid , user .pw_gid ))
86
77
files .write (core .config ['xrootd.tpc.config-2' ],
87
- XROOTD_CFG_TEXT % ( sec_protocol , core . config [ 'xrootd.tpc.http-port2' ], core . config [ 'xrootd.tpc.http-port2' ]) ,
78
+ XROOTD_CFG_TEXT ,
88
79
owner = 'xrootd' , backup = True , chown = (user .pw_uid , user .pw_gid ))
80
+ files .write ('/etc/xrootd/config.d/40-osg-standalone.cfg' , XROOTD_STANDALONE_TXT ,
81
+ owner = 'xrootd' , backup = True , chown = (user .pw_uid , user .pw_gid ))
82
+ files .write (core .config ['xrootd.tpc.basic-config' ],
83
+ XROOTD_MACAROON_TXT ,
84
+ owner = 'xrootd' , backup = True , chown = (user .pw_uid , user .pw_gid ))
85
+
89
86
core .state ['xrootd.tpc.backups-exist' ] = True
90
87
91
88
def test_02_create_secrets (self ):
@@ -95,12 +92,6 @@ def test_02_create_secrets(self):
95
92
core .config ['xrootd.tpc.macaroon-secret-1' ], "64" ], "Creating symmetric key" )
96
93
core .check_system (["openssl" , "rand" , "-base64" , "-out" ,
97
94
core .config ['xrootd.tpc.macaroon-secret-2' ], "64" ], "Creating symmetric key" )
98
- files .append (core .config ['xrootd.tpc.config-1' ],
99
- "macaroons.secretkey %s" % (core .config ['xrootd.tpc.macaroon-secret-1' ]),
100
- owner = 'xrootd' , backup = False )
101
- files .append (core .config ['xrootd.tpc.config-2' ],
102
- "macaroons.secretkey %s" % (core .config ['xrootd.tpc.macaroon-secret-2' ]),
103
- owner = 'xrootd' , backup = False )
104
95
105
96
def test_03_start_xrootd (self ):
106
97
core .config ['xrootd_tpc_service_1' ] = "xrootd@third-party-copy-1"
0 commit comments