Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Poliakov committed May 16, 2024
1 parent 7025955 commit 5c534e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions evergreen/run-mongodb-oidc-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ if [ $OIDC_ENV == "test" ]; then
fi

source ${DRIVERS_TOOLS}/.evergreen/auth_oidc/secrets-export.sh
if [[ ! $OS =~ ubuntu.* ]]; then
# Ubuntu uses local server with already build admin credentials in connection string
MONGODB_URI="mongodb+srv://${OIDC_ADMIN_USER}:${OIDC_ADMIN_PWD}@${MONGODB_URI:14}?authSource=admin"
if [[ "$MONGODB_URI" =~ ^mongodb:.* ]]; then
MONGODB_URI="mongodb://${OIDC_ADMIN_USER}:${OIDC_ADMIN_PWD}@${MONGODB_URI:10}&authSource=admin"
elif [[ "$MONGODB_URI" =~ ^mongodb\+srv:.* ]]; then
MONGODB_URI="mongodb+srv://${OIDC_ADMIN_USER}:${OIDC_ADMIN_PWD}@${MONGODB_URI:14}&authSource=admin"
else
echo "Unexpected MONGODB_URI format: $MONGODB_URI"
exit 1
fi
elif [ $OIDC_ENV == "azure" ]; then
source ./env.sh
Expand Down

0 comments on commit 5c534e7

Please sign in to comment.