Skip to content

Commit c77c980

Browse files
committed
PYTHON-2608 Move KMS setup to run-test
1 parent c91d26c commit c77c980

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -361,32 +361,6 @@ functions:
361361
PYTHON_BINARY=${PYTHON_BINARY} sh ${PROJECT_DIRECTORY}/.evergreen/run-doctests.sh
362362
363363
"run tests":
364-
# If testing encryption start the mock KMS servers.
365-
# First create the virtualenv and install dependencies.
366-
- command: shell.exec
367-
type: setup
368-
params:
369-
working_dir: src
370-
script: |
371-
if [ -n "${test_encryption}" -a "$OS" != "Windows_NT" ]; then
372-
. .evergreen/utils.sh
373-
createvirtualenv ${python3_binary} venvmockkms
374-
python -m pip install boto3
375-
fi
376-
# Start the mock KMS responders.
377-
- command: shell.exec
378-
type: setup
379-
params:
380-
working_dir: src
381-
background: true
382-
script: |
383-
if [ -n "${test_encryption}" -a "$OS" != "Windows_NT" ]; then
384-
${PREPARE_SHELL}
385-
. ./venvmockkms/bin/activate
386-
cd ${DRIVERS_TOOLS}/.evergreen/csfle
387-
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000 &
388-
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001
389-
fi
390364
- command: shell.exec
391365
type: test
392366
params:

.evergreen/run-tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ if [ -n "$TEST_ENCRYPTION" ]; then
144144
# Get access to the AWS temporary credentials:
145145
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
146146
. $DRIVERS_TOOLS/.evergreen/csfle/set-temp-creds.sh
147+
148+
# Start the mock KMS servers.
149+
if [ "$OS" != "Windows_NT" ]; then
150+
pushd ${DRIVERS_TOOLS}/.evergreen/csfle
151+
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000 &
152+
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001 &
153+
popd
154+
fi
147155
fi
148156

149157
if [ -z "$DATA_LAKE" ]; then

0 commit comments

Comments
 (0)