Skip to content

Commit a918acc

Browse files
Merge pull request #184 from efajardo/SOFTWARE3936
Software3936
2 parents 2de52c2 + 97c1cdd commit a918acc

File tree

4 files changed

+52
-57
lines changed

4 files changed

+52
-57
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pyc
2+
*.rpm

osgtest/tests/test_158_xrootd_tpc.py

Lines changed: 46 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,58 @@
1010
HTTP_PORT2 = 9002
1111

1212
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)
4638
fi
47-
http.exthandler xrdmacaroons libXrdMacaroons.so
48-
all.sitename VDTTESTSITE
4939
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
5051
"""
5152

5253
class TestStartXrootdTPC(osgunittest.OSGTestCase):
5354
@core.elrelease(7,8)
5455
def setUp(self):
55-
core.skip_ok_unless_installed("xrootd",
56+
core.skip_ok_unless_installed("osg-xrootd-standalone",
5657
by_dependency=True)
5758
if core.rpm_is_installed("xcache"):
5859
self.skip_ok_if(core.PackageVersion("xcache") >= "1.0.2", "xcache 1.0.2+ configs conflict with xrootd tests")
5960

6061
def test_01_configure_xrootd(self):
6162
core.config['xrootd.tpc.config-1'] = '/etc/xrootd/xrootd-third-party-copy-1.cfg'
6263
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'
6565
core.state['xrootd.started-http-server-1'] = False
6666
core.state['xrootd.started-http-server-2'] = False
6767
core.state['xrootd.tpc.backups-exist'] = False
@@ -71,21 +71,18 @@ def test_01_configure_xrootd(self):
7171

7272
user = pwd.getpwnam("xrootd")
7373

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-
8374
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,
8576
owner='xrootd', backup=True, chown=(user.pw_uid, user.pw_gid))
8677
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,
8879
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+
8986
core.state['xrootd.tpc.backups-exist'] = True
9087

9188
def test_02_create_secrets(self):
@@ -95,12 +92,6 @@ def test_02_create_secrets(self):
9592
core.config['xrootd.tpc.macaroon-secret-1'], "64"], "Creating symmetric key")
9693
core.check_system(["openssl", "rand", "-base64", "-out",
9794
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)
10495

10596
def test_03_start_xrootd(self):
10697
core.config['xrootd_tpc_service_1'] = "xrootd@third-party-copy-1"

osgtest/tests/test_465_xrootd_tpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class TestXrootdTPC(osgunittest.OSGTestCase):
1111
@core.elrelease(7,8)
1212
def setUp(self):
13-
core.skip_ok_unless_installed("xrootd",
13+
core.skip_ok_unless_installed("osg-xrootd-standalone",
1414
by_dependency=True)
1515
if core.rpm_is_installed("xcache"):
1616
self.skip_ok_if(core.PackageVersion("xcache") >= "1.0.2", "xcache 1.0.2+ configs conflict with xrootd tests")

osgtest/tests/test_838_xrootd_tpc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class TestStopXrootdTPC(osgunittest.OSGTestCase):
77
@core.elrelease(7,8)
88
def setUp(self):
9-
core.skip_ok_unless_installed("xrootd",
9+
core.skip_ok_unless_installed("osg-xrootd-standalone",
1010
by_dependency=True)
1111
if core.rpm_is_installed("xcache"):
1212
self.skip_ok_if(core.PackageVersion("xcache") >= "1.0.2", "xcache 1.0.2+ configs conflict with xrootd tests")
@@ -15,6 +15,8 @@ def test_01_stop_xrootd(self):
1515
if core.state['xrootd.tpc.backups-exist']:
1616
files.restore(core.config['xrootd.tpc.config-1'], "xrootd")
1717
files.restore(core.config['xrootd.tpc.config-2'], "xrootd")
18+
files.restore(core.config['xrootd.tpc.basic-config'], "xrootd")
19+
files.restore('/etc/xrootd/config.d/40-osg-standalone.cfg', "xrootd")
1820

1921
self.skip_ok_if(not core.state['xrootd.started-http-server-1'] and
2022
not core.state['xrootd.started-http-server-2'],

0 commit comments

Comments
 (0)