| 1 |
#!/usr/bin/env bash |
| 2 |
# run-oidc-test |
| 3 |
# Runs oidc auth tests. |
| 4 |
set -eu |
| 5 |
|
| 6 |
echo "Running MONGODB-OIDC authentication tests" |
| 7 |
|
| 8 |
OIDC_ENV="${OIDC_ENV:-"test"}" |
| 9 |
|
| 10 |
if [ $OIDC_ENV == "test" ]; then |
| 11 |
# Make sure DRIVERS_TOOLS is set. |
| 12 |
if [ -z "$DRIVERS_TOOLS" ]; then |
| 13 |
echo "Must specify DRIVERS_TOOLS" |
| 14 |
exit 1 |
| 15 |
fi |
| 16 |
source ${DRIVERS_TOOLS}/.evergreen/auth_oidc/secrets-export.sh |
| 17 |
|
| 18 |
elif [ $OIDC_ENV == "azure" ]; then |
| 19 |
source ./env.sh |
| 20 |
|
| 21 |
elif [ $OIDC_ENV == "gcp" ]; then |
| 22 |
source ./secrets-export.sh |
| 23 |
|
| 24 |
else |
| 25 |
echo "Unrecognized OIDC_ENV $OIDC_ENV" |
| 26 |
exit 1 |
| 27 |
fi |
| 28 |
|
| 29 |
export TEST_AUTH_OIDC=1 |
| 30 |
export COVERAGE=1 |
| 31 |
export AUTH="auth" |
| 32 |
|
| 33 |
$1 |