@@ -213,13 +213,12 @@ functions:
213
213
script : |
214
214
set -o errexit
215
215
set -o pipefail
216
- cd drivers-evergreen-tools/.evergreen/orchestration
217
- if [ -f venv/bin/activate ]; then
218
- . venv/bin/activate
219
- elif [ -f venv/Scripts/activate ]; then
220
- . venv/Scripts/activate
216
+ if cd drivers-evergreen-tools/.evergreen/orchestration; then
217
+ . ../venv-utils.sh
218
+ if venvactivate venv; then
219
+ mongo-orchestration stop
220
+ fi
221
221
fi
222
- mongo-orchestration stop
223
222
224
223
" install_c_driver " :
225
224
- command : expansions.update
@@ -293,12 +292,22 @@ functions:
293
292
set -o errexit
294
293
echo "Preparing CSFLE venv environment..."
295
294
cd ./drivers-evergreen-tools/.evergreen/csfle
296
- # This function ensures future invocations of activate_venv .sh conducted in
295
+ # This function ensures future invocations of activate-kmstlsvenv .sh conducted in
297
296
# parallel do not race to setup a venv environment; it has already been prepared.
298
297
# This primarily addresses the situation where the "test" and "run_kms_servers"
299
- # functions invoke 'activate_venv.sh' simultaneously.
300
- . ./activate_venv.sh
301
- deactivate
298
+ # functions invoke 'activate-kmstlsvenv.sh' simultaneously.
299
+ if [[ "$OSTYPE" =~ cygwin && ! -d kmstlsvenv ]]; then
300
+ # Avoid using Python 3.10 on Windows due to incompatible cipher suites.
301
+ # See CXX-2628.
302
+ . ../venv-utils.sh
303
+ venvcreate "C:/python/Python39/python.exe" kmstlsvenv || # windows-2017
304
+ venvcreate "C:/python/Python38/python.exe" kmstlsvenv # windows-2015
305
+ python -m pip install --upgrade boto3~=1.19 pykmip~=0.10.0
306
+ deactivate
307
+ else
308
+ . ./activate-kmstlsvenv.sh
309
+ deactivate
310
+ fi
302
311
echo "Preparing CSFLE venv environment... done."
303
312
- command : shell.exec
304
313
params :
@@ -308,7 +317,7 @@ functions:
308
317
set -o errexit
309
318
echo "Starting mock KMS servers..."
310
319
cd ./drivers-evergreen-tools/.evergreen/csfle
311
- . ./activate_venv .sh
320
+ . ./activate-kmstlsvenv .sh
312
321
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8999 &
313
322
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 9000 &
314
323
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 9001 &
@@ -346,21 +355,14 @@ functions:
346
355
fi
347
356
export CMAKE=${cmake}
348
357
349
- if [ "x$(lsb_release -cs)" = "xtrusty" -a -f /opt/mongodbtoolchain/v2/bin/python ]; then
350
- /opt/mongodbtoolchain/v2/bin/python -m virtualenv venv
351
- elif ! python -m virtualenv venv 2>/dev/null; then
352
- /opt/mongodbtoolchain/v3/bin/python3 -m venv venv
358
+ if [ ! -d ../drivers-evergreen-tools ]; then
359
+ git clone --depth 1 [email protected] :mongodb-labs/drivers-evergreen-tools.git ../drivers-evergreen-tools
353
360
fi
361
+ . ../drivers-evergreen-tools/.evergreen/find-python3.sh
362
+ . ../drivers-evergreen-tools/.evergreen/venv-utils.sh
354
363
355
- cd venv
356
- if [ -f bin/activate ]; then
357
- . bin/activate
358
- ./bin/pip install GitPython
359
- elif [ -f Scripts/activate ]; then
360
- . Scripts/activate
361
- ./Scripts/pip install GitPython
362
- fi
363
- cd ..
364
+ venvcreate "$(find_python3)" venv
365
+ python -m pip install GitPython
364
366
365
367
export GENERATOR="${generator}"
366
368
@@ -444,11 +446,11 @@ functions:
444
446
export AWS_SECRET_ACCESS_KEY="${cse_aws_secret_access_key}"
445
447
export AWS_ACCESS_KEY_ID="${cse_aws_access_key_id}"
446
448
export AWS_DEFAULT_REGION="us-east-1"
447
- echo "Running activate_venv .sh..."
448
- . ./activate_venv .sh
449
- echo "Running activate_venv .sh... done."
449
+ echo "Running activate-kmstlsvenv .sh..."
450
+ . ./activate-kmstlsvenv .sh
451
+ echo "Running activate-kmstlsvenv .sh... done."
450
452
echo "Running set-temp-creds.sh..."
451
- PYTHON="$(type -P python)" . ./set-temp-creds.sh
453
+ . ./set-temp-creds.sh
452
454
echo "Running set-temp-creds.sh... done."
453
455
deactivate
454
456
popd # "$DRIVERS_TOOLS/.evergreen/csfle"
@@ -460,14 +462,8 @@ functions:
460
462
exit 1
461
463
fi
462
464
463
- if [ "Windows_NT" == "$OS"]; then
464
- export MONGOCXX_TEST_CSFLE_TLS_CA_FILE=$DRIVERS_TOOLS\.evergreen\x509gen\ca.pem
465
- export MONGOCXX_TEST_CSFLE_TLS_CERTIFICATE_KEY_FILE=$DRIVERS_TOOLS\.evergreen\x509gen\client.pem
466
- else
467
- export MONGOCXX_TEST_CSFLE_TLS_CA_FILE=$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem
468
- export MONGOCXX_TEST_CSFLE_TLS_CERTIFICATE_KEY_FILE=$DRIVERS_TOOLS/.evergreen/x509gen/client.pem
469
- fi
470
-
465
+ export MONGOCXX_TEST_CSFLE_TLS_CA_FILE=$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem
466
+ export MONGOCXX_TEST_CSFLE_TLS_CERTIFICATE_KEY_FILE=$DRIVERS_TOOLS/.evergreen/x509gen/client.pem
471
467
export MONGOCXX_TEST_AWS_TEMP_ACCESS_KEY_ID="$CSFLE_AWS_TEMP_ACCESS_KEY_ID"
472
468
export MONGOCXX_TEST_AWS_TEMP_SECRET_ACCESS_KEY="$CSFLE_AWS_TEMP_SECRET_ACCESS_KEY"
473
469
export MONGOCXX_TEST_AWS_TEMP_SESSION_TOKEN="$CSFLE_AWS_TEMP_SESSION_TOKEN"
0 commit comments