-
Notifications
You must be signed in to change notification settings - Fork 456
CDRIVER-4548 Support ENVIRONMENT:azure for MONGODB-OIDC.
#2166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 10 commits
73a9caa
a031652
f848d34
373d1d0
95df9b4
df70d96
435ec48
d525dfe
7e7678c
4499785
465f6e8
b5c446e
f12e802
5c7edae
90d62f8
dddaad4
847a80f
e90adf6
5059177
6f4867e
2e24796
58fb40a
7382b6a
7f82240
6bb4c9d
7cc4ecc
b7b7cec
612a8dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,6 +35,30 @@ def task_groups(): | |||||
| script='./drivers-evergreen-tools/.evergreen/auth_oidc/teardown.sh', | ||||||
| ) | ||||||
| ], | ||||||
| ), | ||||||
| EvgTaskGroup( | ||||||
| name='test-oidc-azure-task-group', | ||||||
| tasks=['oidc-azure-auth-test-task'], | ||||||
| setup_group_can_fail_task=True, | ||||||
| setup_group_timeout_secs=60 * 60, # 1 hour | ||||||
| teardown_group_can_fail_task=True, | ||||||
| teardown_group_timeout_secs=180, # 3 minutes | ||||||
| setup_group=[ | ||||||
| FetchDET.call(), | ||||||
| ec2_assume_role(role_arn='${aws_test_secrets_role}'), | ||||||
| bash_exec( | ||||||
| command_type=EvgCommandType.SETUP, | ||||||
| include_expansions_in_env=['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_SESSION_TOKEN'], | ||||||
| env={"AZUREOIDC_VMNAME_PREFIX": "CDRIVER"}, | ||||||
|
||||||
| env={"AZUREOIDC_VMNAME_PREFIX": "CDRIVER"}, | |
| env={'AZUREOIDC_VMNAME_PREFIX': 'CDRIVER'}, |
Formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatted file with Ruff formatter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ) | |
| ), |
Formatting.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| #!/usr/bin/env bash | ||||||
| set -o errexit | ||||||
| set -o pipefail | ||||||
| set -o nounset | ||||||
|
|
||||||
| # shellcheck source=.evergreen/scripts/use-tools.sh | ||||||
| . "$(dirname "${BASH_SOURCE[0]}")/use-tools.sh" paths # Sets MONGOC_DIR | ||||||
|
|
||||||
| cd "$MONGOC_DIR" | ||||||
eramongodb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| if [[ "${distro_id:?}" == "debian11-small" ]]; then | ||||||
| # Temporary workaround for lack of uv on `debian11`. TODO: remove after DEVPROD-23011 is resolved. | ||||||
| uv_dir="$(mktemp -d)" | ||||||
| python3 -m virtualenv "${uv_dir:?}" | ||||||
| # shellcheck source=/dev/null | ||||||
| (. "${uv_dir:?}/bin/activate" && python -m pip install uv) | ||||||
| PATH="${uv_dir:?}/bin:${PATH:-}" | ||||||
| command -V uv >/dev/null | ||||||
| fi | ||||||
|
|
||||||
| . .evergreen/scripts/install-build-tools.sh | ||||||
| install_build_tools | ||||||
| export CMAKE_GENERATOR="Ninja" | ||||||
|
|
||||||
| # Use ccache if able. | ||||||
| . .evergreen/scripts/find-ccache.sh | ||||||
| find_ccache_and_export_vars "$(pwd)" || true | ||||||
|
|
||||||
| echo "Compile test-libmongoc ... begin" | ||||||
| # Disable unnecessary dependencies. test-libmongoc is copied to a remote host for testing, which may not have all dependent libraries. | ||||||
| cmake \ | ||||||
| -DENABLE_SASL=OFF \ | ||||||
| -DENABLE_SNAPPY=OFF \ | ||||||
| -DENABLE_ZSTD=OFF \ | ||||||
| -DENABLE_ZLIB=OFF \ | ||||||
| -DENABLE_SRV=OFF \ | ||||||
| -DENABLE_CLIENT_SIDE_ENCRYPTION=OFF \ | ||||||
| -DENABLE_EXAMPLES=OFF \ | ||||||
| -DENABLE_SRV=OFF \ | ||||||
| -S. -Bcmake-build | ||||||
eramongodb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| cmake --build cmake-build --target test-libmongoc --parallel | ||||||
eramongodb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| echo "Compile test-libmongoc ... end" | ||||||
|
|
||||||
| # Create tarball for remote testing. | ||||||
| echo "Creating test-libmongoc tarball ... begin" | ||||||
|
|
||||||
| # Copy test binary and JSON test files. All JSON test files are needed to start test-libmongoc. | ||||||
| tar -czf test-libmongoc.tar.gz \ | ||||||
| .evergreen/scripts/oidc-azure-test.sh \ | ||||||
| ./cmake-build/src/libmongoc/test-libmongoc \ | ||||||
| src/libmongoc/tests/json \ | ||||||
| src/libbson/tests/json | ||||||
eramongodb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| echo "Creating test-libmongoc tarball ... end" | ||||||
|
|
||||||
| cat <<EOT > oidc-remote-test-expansion.yml | ||||||
|
||||||
| cat <<EOT > oidc-remote-test-expansion.yml | |
| cat <<EOT >oidc-remote-test-expansion.yml |
Formatting.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
| set -o errexit | ||
| set -o pipefail | ||
| set -o nounset | ||
|
|
||
| export MONGOC_TEST_OIDC="ON" | ||
| export MONGOC_TEST_USER="$OIDC_ADMIN_USER" | ||
| export MONGOC_TEST_PASSWORD="$OIDC_ADMIN_PWD" | ||
| export MONGOC_AZURE_RESOURCE="$AZUREOIDC_RESOURCE" | ||
|
|
||
| # Install required OpenSSL runtime library. | ||
| sudo apt install -y libssl-dev | ||
|
|
||
| ./cmake-build/src/libmongoc/test-libmongoc -d --match '/auth/unified/*' --match '/oidc/*' | ||
eramongodb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.