Skip to content

Commit 2bb94a1

Browse files
committed
CSHARP-2965: Minimize chances of cert removal timing out in tests
1 parent b1b5d2c commit 2bb94a1

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

evergreen/add-certs.sh renamed to evergreen/add-certs-if-needed.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33
set -o xtrace # Write all commands first to stderr
44
set -o errexit # Exit the script with an error if any of the commands fail
55

6+
# Supported/used environment variables:
7+
# SSL Set to enable SSL. Values are "ssl" / "nossl" (default)
8+
# OCSP_TLS_SHOULD_SUCCEED Set to test OCSP. Values are true/false/nil
9+
# OCSP_ALGORITHM Set to test OCSP. Values are rsa/ecdsa/nil
10+
11+
SSL=${SSL:-nossl}
612
OCSP_TLS_SHOULD_SUCCEED=${OCSP_TLS_SHOULD_SUCCEED:-nil}
713
OCSP_ALGORITHM=${OCSP_ALGORITHM:-nil}
814

15+
if [[ "$SSL" != "ssl" ]]; then
16+
exit 0
17+
fi
18+
919
if [[ "$OS" =~ Windows|windows ]]; then
1020
certutil.exe -addstore "Root" ${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem
1121

12-
if [ "$OCSP_TLS_SHOULD_SUCCEED" != "nil" ] && [ "$OCSP_ALGORITHM" != "nil" ]; then
22+
if [[ "$OCSP_TLS_SHOULD_SUCCEED" != "nil" && "$OCSP_ALGORITHM" != "nil" ]]; then
1323
certutil.exe -addstore "Root" ${DRIVERS_TOOLS}/.evergreen/ocsp/${OCSP_ALGORITHM}/ca.pem
1424
fi
1525
fi

evergreen/evergreen.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ functions:
239239
export FLE_AWS_ACCESS_KEY_ID=${FLE_AWS_ACCESS_KEY_ID}
240240
export FLE_AWS_SECRET_ACCESS_KEY=${FLE_AWS_SECRET_ACCESS_KEY}
241241
${PREPARE_SHELL}
242-
evergreen/add-certs.sh
242+
SSL=${SSL} evergreen/add-certs-if-needed.sh
243243
AUTH=${AUTH} SSL=${SSL} MONGODB_URI="${MONGODB_URI}" TOPOLOGY=${TOPOLOGY} OS=${OS} COMPRESSOR=${COMPRESSOR} evergreen/run-tests.sh
244-
evergreen/remove-certs.sh
244+
echo "Skipping certificate removal..."
245245
246246
run-atlas-connectivity-tests:
247247
- command: shell.exec
@@ -417,15 +417,16 @@ functions:
417417
${PREPARE_SHELL}
418418
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
419419
OCSP_ALGORITHM=${OCSP_ALGORITHM} \
420-
evergreen/add-certs.sh
420+
SSL="ssl" \
421+
evergreen/add-certs-if-needed.sh
421422
set +o xtrace
422423
AUTH="${AUTH}" \
423424
SSL="ssl" \
424425
TOPOLOGY="${TOPOLOGY}" \
425426
MONGODB_URI="${MONGODB_URI}" \
426427
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
427428
evergreen/run-tests.sh
428-
evergreen/remove-certs.sh
429+
echo "Skipping certificate removal..."
429430
430431
run-valid-ocsp-server-ca-responder:
431432
- command: shell.exec

evergreen/remove-certs.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)