Skip to content

Commit

Permalink
PYTHON-2608 Move KMS setup to run-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey committed Jul 9, 2021
1 parent c91d26c commit c77c980
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .evergreen/config.yml
Expand Up @@ -361,32 +361,6 @@ functions:
PYTHON_BINARY=${PYTHON_BINARY} sh ${PROJECT_DIRECTORY}/.evergreen/run-doctests.sh
"run tests":
# If testing encryption start the mock KMS servers.
# First create the virtualenv and install dependencies.
- command: shell.exec
type: setup
params:
working_dir: src
script: |
if [ -n "${test_encryption}" -a "$OS" != "Windows_NT" ]; then
. .evergreen/utils.sh
createvirtualenv ${python3_binary} venvmockkms
python -m pip install boto3
fi
# Start the mock KMS responders.
- command: shell.exec
type: setup
params:
working_dir: src
background: true
script: |
if [ -n "${test_encryption}" -a "$OS" != "Windows_NT" ]; then
${PREPARE_SHELL}
. ./venvmockkms/bin/activate
cd ${DRIVERS_TOOLS}/.evergreen/csfle
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000 &
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001
fi
- command: shell.exec
type: test
params:
Expand Down
8 changes: 8 additions & 0 deletions .evergreen/run-tests.sh
Expand Up @@ -144,6 +144,14 @@ if [ -n "$TEST_ENCRYPTION" ]; then
# Get access to the AWS temporary credentials:
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
. $DRIVERS_TOOLS/.evergreen/csfle/set-temp-creds.sh

# Start the mock KMS servers.
if [ "$OS" != "Windows_NT" ]; then
pushd ${DRIVERS_TOOLS}/.evergreen/csfle
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000 &
python -u lib/kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001 &
popd
fi
fi

if [ -z "$DATA_LAKE" ]; then
Expand Down

0 comments on commit c77c980

Please sign in to comment.