| 1 |
#!/usr/bin/env bash |
| 2 |
# run-enterprise-gssapi-test |
| 3 |
# Runs the enterprise auth tests with gssapi credentials. |
| 4 |
set -eu |
| 5 |
|
| 6 |
. ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/enterprise_auth |
| 7 |
if [ "Windows_NT" = "${OS:-}" ]; then |
| 8 |
export MONGODB_URI="mongodb://${PRINCIPAL/@/%40}:${SASL_PASS}@${SASL_HOST}:${SASL_PORT}/kerberos?authMechanism=GSSAPI" |
| 9 |
else |
| 10 |
echo "${KEYTAB_BASE64}" > /tmp/drivers.keytab.base64 |
| 11 |
base64 --decode /tmp/drivers.keytab.base64 > ${PROJECT_DIRECTORY}/.evergreen/drivers.keytab |
| 12 |
mkdir -p ~/.krb5 |
| 13 |
cat .evergreen/krb5.config | tee -a ~/.krb5/config |
| 14 |
kinit -k -t ${PROJECT_DIRECTORY}/.evergreen/drivers.keytab -p "${PRINCIPAL}" |
| 15 |
export MONGODB_URI="mongodb://${PRINCIPAL/@/%40}@${SASL_HOST}:${SASL_PORT}/kerberos?authMechanism=GSSAPI" |
| 16 |
fi |
| 17 |
export MONGO_GO_DRIVER_COMPRESSOR="${MONGO_GO_DRIVER_COMPRESSOR:-}" |
| 18 |
|
| 19 |
make -s evg-test-enterprise-auth |