Skip to content

Commit 1b8033a

Browse files
Merge pull request #215 from brianhlin/new-condor-mapfile-syntax
Add new condor mapfile syntax
2 parents 0ef3ac8 + 03e313e commit 1b8033a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

osgtest/tests/test_190_condorce.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,24 @@ def test_02_scitoken_mapping(self):
4242
'HTCondor version does not support SciToken submission')
4343

4444
condorce_version = core.PackageVersion('htcondor-ce')
45-
scitoken_mapping = f'SCITOKENS "https://demo.scitokens.org" {core.options.username}\n'
45+
scitoken_mapping = 'SCITOKENS {issuer} {local_user}\n'
4646

47-
# Write the mapfile to the admin mapfile directory
47+
# Write the mapfile to the admin mapfile directory with the regex format for the issuer
48+
# required by 'CERTIFICATE_MAPFILE_ASSUME_HASH_KEYS = True'
4849
# https://github.com/htcondor/htcondor-ce/pull/425
49-
if condorce_version >= '5.1.0':
50+
# We apply this to HTCondor-CE 5 as a whole for the benefit of the HTCondor-CE CI tests
51+
# This is ok even though these changes will only make it into 5.1.0 because 5.0.0 will not be released
52+
if condorce_version >= '5.0.0':
53+
match_str = r'/https:\/\/demo.scitokens.org,.*/'
5054
core.config['condor-ce.mapfile'] = '/etc/condor-ce/mapfiles.d/01-osg-test.conf'
5155
else:
56+
match_str = '"https://demo.scitokens.org"'
5257
core.config['condor-ce.mapfile'] = '/etc/condor-ce/condor_mapfile'
5358
mapfile_contents = files.read(core.config['condor-ce.mapfile'], as_single_string=True)
5459
scitoken_mapping += mapfile_contents
5560

5661
files.write(core.config['condor-ce.mapfile'],
57-
scitoken_mapping,
62+
scitoken_mapping.format(issuer=match_str, local_user=core.options.username),
5863
owner='condor-ce',
5964
chmod=0o644)
6065
core.state['condor-ce.wrote-mapfile'] = True

0 commit comments

Comments
 (0)