Skip to content

Commit 8495c56

Browse files
committed
Use osg-xrootd-standalone for XRootD tests where available
We didn't actually start the cmsd service so it's not like we were actually using the clustered configuration for its intended use
1 parent 75246d8 commit 8495c56

File tree

2 files changed

+34
-36
lines changed

2 files changed

+34
-36
lines changed

osgtest/tests/test_150_xrootd.py

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
ofs.authorize
2020
"""
2121

22+
# XRootD configuration necessaryfor osg-xrootd-standalone
23+
META_XROOTD_CFG_TEXT = """\
24+
set rootdir = /
25+
set resourcename = OSG_TEST_XROOTD_STANDALONE
26+
"""
27+
2228
AUTHFILE_TEXT = """\
2329
u * /tmp a /usr/share/ r
2430
u = /tmp/@=/ a
@@ -37,8 +43,11 @@ def test_01_start_xrootd(self):
3743
core.config['xrootd.pid-file'] = '/var/run/xrootd/xrootd-default.pid'
3844
core.config['certs.xrootdcert'] = '/etc/grid-security/xrd/xrdcert.pem'
3945
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'
4251
core.config['xrootd.multiuser'] = False
4352
core.state['xrootd.started-server'] = False
4453
core.state['xrootd.backups-exist'] = False
@@ -51,27 +60,25 @@ def test_01_start_xrootd(self):
5160
core.install_cert('certs.xrootdcert', 'certs.hostcert', 'xrootd', 0o644)
5261
core.install_cert('certs.xrootdkey', 'certs.hostkey', 'xrootd', 0o400)
5362

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
6066
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)
7582

7683
authfile = '/etc/xrootd/auth_file'
7784
files.write(authfile, AUTHFILE_TEXT, owner="xrootd", chown=(user.pw_uid, user.pw_gid))
@@ -81,28 +88,22 @@ def test_01_start_xrootd(self):
8188
def test_02_configure_hdfs(self):
8289
core.skip_ok_unless_installed('xrootd-hdfs')
8390
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)
8892

8993
def test_03_configure_multiuser(self):
9094
core.skip_ok_unless_installed('xrootd-multiuser', 'globus-proxy-utils', by_dependency=True)
9195
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)
9697
core.config['xrootd.multiuser'] = True
9798

9899
def test_04_start_xrootd(self):
99100
core.skip_ok_unless_installed('xrootd', by_dependency=True)
100101
if core.el_release() < 7:
101102
core.config['xrootd_service'] = "xrootd"
102103
elif core.config['xrootd.multiuser']:
103-
core.config['xrootd_service'] = "xrootd-privileged@clustered"
104+
core.config['xrootd_service'] = "xrootd-privileged@standalone"
104105
else:
105-
core.config['xrootd_service'] = "xrootd@clustered"
106+
core.config['xrootd_service'] = "xrootd@standalone"
106107

107108
service.check_start(core.config['xrootd_service'])
108109
core.state['xrootd.started-server'] = True

osgtest/tests/test_840_xrootd.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ def setUp(self):
1212

1313
def test_01_stop_xrootd(self):
1414
if core.state['xrootd.backups-exist']:
15-
if core.PackageVersion('xrootd') < '1:4.9.0':
16-
files.restore(core.config['xrootd.config'], "xrootd")
17-
else:
18-
files.restore(core.config['xrootd.config-extra'], "xrootd")
15+
files.restore(core.config['xrootd.config'], "xrootd")
1916
files.restore('/etc/xrootd/auth_file', "xrootd")
2017
if not core.rpm_is_installed('xrootd-lcmaps'):
2118
files.restore('/etc/grid-security/xrd/xrdmapfile', "xrootd")

0 commit comments

Comments
 (0)