19
19
ofs.authorize
20
20
"""
21
21
22
+ # XRootD configuration necessaryfor osg-xrootd-standalone
23
+ META_XROOTD_CFG_TEXT = """\
24
+ set rootdir = /
25
+ set resourcename = OSG_TEST_XROOTD_STANDALONE
26
+ """
27
+
22
28
AUTHFILE_TEXT = """\
23
29
u * /tmp a /usr/share/ r
24
30
u = /tmp/@=/ a
@@ -37,8 +43,11 @@ def test_01_start_xrootd(self):
37
43
core .config ['xrootd.pid-file' ] = '/var/run/xrootd/xrootd-default.pid'
38
44
core .config ['certs.xrootdcert' ] = '/etc/grid-security/xrd/xrdcert.pem'
39
45
core .config ['certs.xrootdkey' ] = '/etc/grid-security/xrd/xrdkey.pem'
40
- core .config ['xrootd.config' ] = '/etc/xrootd/xrootd-clustered.cfg'
41
- core .config ['xrootd.config-extra' ] = '/etc/xrootd/config.d/99-osg-test.cfg'
46
+ if core .rpm_is_installed ('osg-xrootd-standalone' ):
47
+ # rootdir and resourcename needs to be set early for the default osg-xrootd config
48
+ core .config ['xrootd.config' ] = '/etc/xrootd/config.d/10-osg-test.cfg'
49
+ else :
50
+ core .config ['xrootd.config' ] = '/etc/xrootd/config.d/99-osg-test.cfg'
42
51
core .config ['xrootd.multiuser' ] = False
43
52
core .state ['xrootd.started-server' ] = False
44
53
core .state ['xrootd.backups-exist' ] = False
@@ -51,27 +60,25 @@ def test_01_start_xrootd(self):
51
60
core .install_cert ('certs.xrootdcert' , 'certs.hostcert' , 'xrootd' , 0o644 )
52
61
core .install_cert ('certs.xrootdkey' , 'certs.hostkey' , 'xrootd' , 0o400 )
53
62
54
- lcmaps_packages = ('lcmaps' , 'lcmaps-db-templates' , 'xrootd-lcmaps' , 'vo-client' , 'vo-client-lcmaps-voms' )
55
- if all ([core .rpm_is_installed (x ) for x in lcmaps_packages ]):
56
- core .log_message ("Using xrootd-lcmaps authentication" )
57
- sec_protocol = '-authzfun:libXrdLcmaps.so -authzfunparms:--loglevel,5'
58
- if core .PackageVersion ('xrootd-lcmaps' ) >= '1.4.0' :
59
- sec_protocol += ',--policy,authorize_only'
63
+ if core .rpm_is_installed ('osg-xrootd-standalone' ):
64
+ core .log_message ("Using osg-xrootd configuration" )
65
+ xrootd_config = META_XROOTD_CFG_TEXT
60
66
else :
61
- core .log_message ("Using XRootD mapfile authentication" )
62
- sec_protocol = '-gridmap:/etc/grid-security/xrd/xrdmapfile'
63
- files .write ("/etc/grid-security/xrd/xrdmapfile" , "\" %s\" vdttest" % core .config ['user.cert_subject' ],
64
- owner = "xrootd" ,
65
- chown = (user .pw_uid , user .pw_gid ))
66
-
67
- if core .PackageVersion ('xrootd' ) < '1:4.9.0' :
68
- files .append (core .config ['xrootd.config' ],
69
- XROOTD_CFG_TEXT % sec_protocol ,
70
- owner = 'xrootd' , backup = True )
71
- else :
72
- files .write (core .config ['xrootd.config-extra' ],
73
- XROOTD_CFG_TEXT % sec_protocol ,
74
- owner = 'xrootd' , backup = True , chmod = 0o644 )
67
+ lcmaps_packages = ('lcmaps' , 'lcmaps-db-templates' , 'xrootd-lcmaps' , 'vo-client' , 'vo-client-lcmaps-voms' )
68
+ if all ([core .rpm_is_installed (x ) for x in lcmaps_packages ]):
69
+ core .log_message ("Using xrootd-lcmaps authentication" )
70
+ sec_protocol = '-authzfun:libXrdLcmaps.so -authzfunparms:--loglevel,5'
71
+ if core .PackageVersion ('xrootd-lcmaps' ) >= '1.4.0' :
72
+ sec_protocol += ',--policy,authorize_only'
73
+ else :
74
+ core .log_message ("Using XRootD mapfile authentication" )
75
+ sec_protocol = '-gridmap:/etc/grid-security/xrd/xrdmapfile'
76
+ files .write ("/etc/grid-security/xrd/xrdmapfile" , "\" %s\" vdttest" % core .config ['user.cert_subject' ],
77
+ owner = "xrootd" ,
78
+ chown = (user .pw_uid , user .pw_gid ))
79
+ xrootd_config = XROOTD_CFG_TEXT % sec_protocol
80
+
81
+ files .write (core .config ['xrootd.config' ], xrootd_config , owner = 'xrootd' , backup = True )
75
82
76
83
authfile = '/etc/xrootd/auth_file'
77
84
files .write (authfile , AUTHFILE_TEXT , owner = "xrootd" , chown = (user .pw_uid , user .pw_gid ))
@@ -81,28 +88,22 @@ def test_01_start_xrootd(self):
81
88
def test_02_configure_hdfs (self ):
82
89
core .skip_ok_unless_installed ('xrootd-hdfs' )
83
90
hdfs_config = "ofs.osslib /usr/lib64/libXrdHdfs.so"
84
- if core .PackageVersion ('xrootd' ) < '1:4.9.0' :
85
- files .append (core .config ['xrootd.config' ], hdfs_config , backup = False )
86
- else :
87
- files .append (core .config ['xrootd.config-extra' ], hdfs_config , backup = False )
91
+ files .append (core .config ['xrootd.config' ], hdfs_config , backup = False )
88
92
89
93
def test_03_configure_multiuser (self ):
90
94
core .skip_ok_unless_installed ('xrootd-multiuser' , 'globus-proxy-utils' , by_dependency = True )
91
95
xrootd_multiuser_conf = "xrootd.fslib libXrdMultiuser.so default"
92
- if core .PackageVersion ('xrootd' ) < '1:4.9.0' :
93
- files .append (core .config ['xrootd.config' ], xrootd_multiuser_conf , owner = 'xrootd' , backup = False )
94
- else :
95
- files .append (core .config ['xrootd.config-extra' ], xrootd_multiuser_conf , owner = 'xrootd' , backup = False )
96
+ files .append (core .config ['xrootd.config' ], xrootd_multiuser_conf , owner = 'xrootd' , backup = False )
96
97
core .config ['xrootd.multiuser' ] = True
97
98
98
99
def test_04_start_xrootd (self ):
99
100
core .skip_ok_unless_installed ('xrootd' , by_dependency = True )
100
101
if core .el_release () < 7 :
101
102
core .config ['xrootd_service' ] = "xrootd"
102
103
elif core .config ['xrootd.multiuser' ]:
103
- core .config ['xrootd_service' ] = "xrootd-privileged@clustered "
104
+ core .config ['xrootd_service' ] = "xrootd-privileged@standalone "
104
105
else :
105
- core .config ['xrootd_service' ] = "xrootd@clustered "
106
+ core .config ['xrootd_service' ] = "xrootd@standalone "
106
107
107
108
service .check_start (core .config ['xrootd_service' ])
108
109
core .state ['xrootd.started-server' ] = True
0 commit comments