27
27
http.cadir /etc/grid-security/certificates
28
28
http.cert /etc/grid-security/xrd/xrdcert.pem
29
29
http.key /etc/grid-security/xrd/xrdkey.pem
30
- http.secxtractor /usr/lib64/libXrdLcmaps.so
31
30
http.listingdeny yes
32
31
http.desthttps yes
33
-
32
+ http.trace all debug
34
33
# Enable third-party-copy
35
34
http.exthandler xrdtpc libXrdHttpTPC.so
36
35
# Pass the bearer token to the Xrootd authorization framework.
37
36
http.header2cgi Authorization authz
38
37
39
38
# Enable Macaroons
40
39
ofs.authlib libXrdMacaroons.so libXrdAccSciTokens.so
41
-
42
- fi
43
-
44
- if named xrd-TPC-1
40
+ xrd.port %d
45
41
xrd.protocol http:%d /usr/lib64/libXrdHttp-4.so
46
42
fi
43
+ http.exthandler xrdmacaroons libXrdMacaroons.so
44
+ macaroons.secretkey /etc/xrootd/macaroon-secret
45
+ all.sitename VDTTESTSITE
47
46
48
- if named xrd-TPC-2
49
- xrd.protocol http:%d /usr/lib64/libXrdHttp-4.so
50
- fi
51
- end
52
47
"""
53
48
54
49
class TestStartXrootdTPC (osgunittest .OSGTestCase ):
55
50
@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'
51
+ def test_01_configure_xrootd (self ):
52
+ core .config ['xrootd.tpc.config-1' ] = '/etc/xrootd/xrootd-third-party-copy-1.cfg'
53
+ core .config ['xrootd.tpc.config-2' ] = '/etc/xrootd/xrootd-third-party-copy-2.cfg'
60
54
core .config ['xrootd.tpc.http-port1' ] = HTTP_PORT1
61
55
core .config ['xrootd.tpc.http-port2' ] = HTTP_PORT2
62
56
core .state ['xrootd.started-http-server-1' ] = False
63
57
core .state ['xrootd.started-http-server-2' ] = False
64
58
core .state ['xrootd.tpc.backups-exist' ] = False
65
59
66
60
self .skip_ok_unless (core .options .adduser , 'user not created' )
67
- core .skip_ok_unless_installed ('xrootd' , by_dependency = True )
61
+ core .skip_ok_unless_installed ('xrootd' , 'xrootd-scitokens' , by_dependency = True )
68
62
69
63
user = pwd .getpwnam ("xrootd" )
70
64
core .skip_ok_unless_installed ('globus-proxy-utils' )
@@ -73,23 +67,33 @@ def test_01_start_xrootd(self):
73
67
if all ([core .rpm_is_installed (x ) for x in lcmaps_packages ]):
74
68
core .log_message ("Using xrootd-lcmaps authentication" )
75
69
sec_protocol = '-authzfun:libXrdLcmaps.so -authzfunparms:--loglevel,5'
76
- if core . PackageVersion ( 'xrootd-lcmaps' ) >= '1.4.0' :
77
- sec_protocol += ',--policy,authorize_only'
70
+ #XROOTD_CFG_TEXT += "http.secxtractor /usr/lib64/libXrdLcmaps.so/n"
71
+ sec_protocol += ',--policy,authorize_only'
78
72
else :
79
73
core .log_message ("Using XRootD mapfile authentication" )
80
74
sec_protocol = '-gridmap:/etc/grid-security/xrd/xrdmapfile'
81
75
82
- files .append (core .config ['xrootd.tpc.config' ],
83
- XROOTD_CFG_TEXT % (sec_protocol , core .config ['xrootd.port' ]),
84
- owner = 'xrootd' , backup = True )
76
+ files .write (core .config ['xrootd.tpc.config-1' ],
77
+ XROOTD_CFG_TEXT % (sec_protocol , core .config ['xrootd.tpc.http-port1' ], core .config ['xrootd.tpc.http-port1' ]),
78
+ owner = 'xrootd' , backup = True , chown = (user .pw_uid , user .pw_gid ))
79
+ files .write (core .config ['xrootd.tpc.config-2' ],
80
+ XROOTD_CFG_TEXT % (sec_protocol , core .config ['xrootd.tpc.http-port2' ], core .config ['xrootd.tpc.http-port1' ]),
81
+ owner = 'xrootd' , backup = True , chown = (user .pw_uid , user .pw_gid ))
85
82
core .state ['xrootd.tpc.backups-exist' ] = True
83
+
84
+ def test_02_create_secret_key (self ):
85
+ core .skip_ok_unless_installed ('xrootd' , 'xrootd-scitokens' , by_dependency = True )
86
+ core .config ['xrootd.tpc.macaroon-secret' ] = '/etc/xrootd/macaroon-secret'
87
+ core .check_system (["openssl" , "rand" , "-base64" , "-out" ,
88
+ core .config ['xrootd.tpc.macaroon-secret' ], "64" ], "Creating simmetric key" )
86
89
87
- def test_02_start_xrootd (self ):
90
+
91
+ def test_03_start_xrootd (self ):
88
92
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
93
+ core .config ['xrootd_tpc_service_1' ] = "xrootd @third-party-copy-1 "
94
+ core .config ['xrootd_tpc_service_2' ] = "xrootd @third-party-copy-2 "
95
+ service .check_start (core .config ['xrootd_tpc_service_1' ], logToCheck = '/var/log/xrootd/third-party-copy-1/xrootd.log' )
96
+ service .check_start (core .config ['xrootd_tpc_service_2' ], logToCheck = '/var/log/xrootd/third-party-copy-2/xrootd.log' )
97
+ core . state [ 'xrootd.started-http-server-1' ] = True
98
+ core .state ['xrootd.started-http-server-2 ' ] = True
99
+
0 commit comments