-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2465 from htcondor/V23_8-HTCONDOR-2153_issue_cred…
…entials_for-branch (HTCONDOR-2153) issue_credentials()
- Loading branch information
Showing
7 changed files
with
184 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# One platform per line. Comments (starting with #) and blank lines are ignored. | ||
|
||
# Officially supported platforms | ||
docker://htcondor/nmi-build:aarch64_AlmaLinux8-23070101 | ||
docker://htcondor/nmi-build:aarch64_AlmaLinux9-23070101 | ||
docker://htcondor/nmi-build:ppc64le_AlmaLinux8-23070101 | ||
docker://htcondor/nmi-build:ppc64le_Ubuntu20-23070101 | ||
docker://htcondor/nmi-build:x86_64_AlmaLinux8-23070101 | ||
docker://htcondor/nmi-build:x86_64_AlmaLinux9-23070101 | ||
docker://htcondor/nmi-build:x86_64_AmazonLinux2023-23070101 | ||
docker://htcondor/nmi-build:x86_64_CentOS7-23070101 | ||
docker://htcondor/nmi-build:x86_64_Debian11-23070101 | ||
docker://htcondor/nmi-build:x86_64_Debian12-23070101 | ||
docker://htcondor/nmi-build:x86_64_openSUSE15-23070101 | ||
docker://htcondor/nmi-build:x86_64_Ubuntu20-23070101 | ||
docker://htcondor/nmi-build:x86_64_Ubuntu22-23070101 | ||
docker://htcondor/nmi-build:x86_64_Ubuntu24-23070101 | ||
docker://htcondor/nmi-build:aarch64_AlmaLinux8-23070200 | ||
docker://htcondor/nmi-build:aarch64_AlmaLinux9-23070200 | ||
docker://htcondor/nmi-build:ppc64le_AlmaLinux8-23070200 | ||
docker://htcondor/nmi-build:ppc64le_Ubuntu20-23070200 | ||
docker://htcondor/nmi-build:x86_64_AlmaLinux8-23070200 | ||
docker://htcondor/nmi-build:x86_64_AlmaLinux9-23070200 | ||
docker://htcondor/nmi-build:x86_64_AmazonLinux2023-23070200 | ||
docker://htcondor/nmi-build:x86_64_CentOS7-23070100 | ||
docker://htcondor/nmi-build:x86_64_Debian11-23070200 | ||
docker://htcondor/nmi-build:x86_64_Debian12-23070200 | ||
docker://htcondor/nmi-build:x86_64_openSUSE15-23070200 | ||
docker://htcondor/nmi-build:x86_64_Ubuntu20-23070200 | ||
docker://htcondor/nmi-build:x86_64_Ubuntu22-23070200 | ||
docker://htcondor/nmi-build:x86_64_Ubuntu24-23070200 | ||
x86_64_macOS13 | ||
# Windows 9 is really Windows 10 in disquise | ||
x86_64_Windows9 | ||
x86_64_Windows10 | ||
|
||
# We want to build on Fedora because it is our "warning check" platform | ||
docker://htcondor/nmi-build:x86_64_Fedora40-23070101 | ||
docker://htcondor/nmi-build:x86_64_Fedora40-23070200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/usr/bin/env pytest | ||
|
||
from pathlib import Path | ||
from getpass import getuser | ||
|
||
from ornithology import ( | ||
config, | ||
standup, | ||
action, | ||
Condor, | ||
) | ||
|
||
import htcondor2 | ||
htcondor2.enable_debug() | ||
|
||
import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
|
||
|
||
TEST_CASES = { | ||
"local_issuer": { | ||
"config": { | ||
"SEC_CREDENTIAL_DIRECTORY_OAUTH": "$(LOCAL_DIR)/oauth_credentials", | ||
"CREDMON_OAUTH_LOG": "$(LOG)/CredMonOAuthLog", | ||
"DAEMON_LIST": "$(DAEMON_LIST),CREDMON_OAUTH", | ||
"AUTO_INCLUDE_CREDD_IN_DAEMON_LIST": "True", | ||
"TRUST_CREDENTIAL_DIRECTORY": "True", | ||
"LOCAL_CREDMON_PROVIDER_NAME": "scitokens", | ||
"LOCAL_CREDMON_TOKEN_AUDIENCE": "https://localhost", | ||
"CREDD_PORT": "-1", | ||
"ALLOW_DAEMON": "*", | ||
"LOCAL_CREDMON_PRIVATE_KEY": "$(LOCAL_DIR)/trust_domain_ca_privkey.pem", | ||
"CREDD_DEBUG": "D_FULLDEBUG", | ||
}, | ||
"the_directory": "{local_dir}/oauth_credentials", | ||
"the_filename": "scitokens.top", | ||
}, | ||
} | ||
|
||
|
||
@action(params={name: name for name in TEST_CASES}) | ||
def the_test_tuple(request): | ||
return (request.param, TEST_CASES[request.param]) | ||
|
||
|
||
@action | ||
def the_test_name(the_test_tuple): | ||
return the_test_tuple[0] | ||
|
||
|
||
@action | ||
def the_test_case(the_test_tuple): | ||
return the_test_tuple[1] | ||
|
||
|
||
@action | ||
def the_local_dir(the_test_name, test_dir): | ||
return Path(str(test_dir)) / the_test_name | ||
|
||
|
||
@action | ||
def the_directory(the_test_case, the_local_dir): | ||
return the_test_case['the_directory'].format(local_dir=the_local_dir) | ||
|
||
|
||
@action | ||
def the_username(): | ||
# Seems like we should have a way to get this from HTCondor. | ||
return getuser() | ||
|
||
|
||
@action | ||
def the_filename(the_test_case): | ||
return the_test_case['the_filename'] | ||
|
||
|
||
@action | ||
def the_condor(the_test_case, the_local_dir): | ||
with Condor( | ||
local_dir=the_local_dir, | ||
config=the_test_case['config'] | ||
) as the_condor: | ||
yield the_condor | ||
|
||
|
||
class TestIssueCredentials: | ||
|
||
def test_top_file_created(self, the_test_name, the_condor, the_directory, the_username, the_filename): | ||
# Strictly speaking, this would be a set-up error. | ||
assert not (Path(the_directory) / the_username / the_filename).exists() | ||
|
||
# Strictly speaking, this should be an @action. | ||
submit = htcondor2.Submit( | ||
f""" | ||
executable = /bin/sleep | ||
transfer_executable = false | ||
arguments = 5 | ||
log = {the_test_name}.log | ||
""" | ||
) | ||
with the_condor.use_config(): | ||
submit.issue_credentials() | ||
|
||
# Check for a .use file as well? | ||
assert (Path(the_directory) / the_username / the_filename).exists() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters