From 9f945c4f361f65552624b2de61405cd48c061e9a Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 16 Dec 2022 10:18:02 -0500 Subject: [PATCH] test(NODE-4800): update build env scripts (#3487) --- .evergreen/config.in.yml | 15 ++++++++++----- .evergreen/config.yml | 15 ++++++++++----- .evergreen/run-kms-servers.sh | 2 +- test/readme.md | 2 +- test/spec/client-side-encryption/tests/README.rst | 4 ++-- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 5fa63fea91..3ad36514e5 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -527,10 +527,11 @@ functions: type: test params: working_dir: "src" + shell: bash script: | ${PREPARE_SHELL} cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh cd - "run aws auth test with regular aws credentials": @@ -538,10 +539,11 @@ functions: type: test params: working_dir: "src" + shell: bash script: | ${PREPARE_SHELL} cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js - command: shell.exec type: test @@ -568,10 +570,11 @@ functions: type: test params: working_dir: "src" + shell: bash script: | ${PREPARE_SHELL} cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo aws_e2e_assume_role.js - command: shell.exec type: test @@ -602,13 +605,14 @@ functions: type: test params: working_dir: "src" + shell: bash script: | ${PREPARE_SHELL} # Write an empty prepare_mongodb_aws so no auth environment variables # are set. echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo aws_e2e_ec2.js - command: shell.exec type: test @@ -671,6 +675,7 @@ functions: type: test params: working_dir: src + shell: bash script: | ${PREPARE_SHELL} AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws @@ -691,7 +696,7 @@ functions: EOF cat setup.js - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo --nodb setup.js aws_e2e_ecs.js "run-ocsp-test": diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 604c871e24..de7e2b15e7 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -490,20 +490,22 @@ functions: type: test params: working_dir: src + shell: bash script: | ${PREPARE_SHELL} cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh cd - run aws auth test with regular aws credentials: - command: shell.exec type: test params: working_dir: src + shell: bash script: | ${PREPARE_SHELL} cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo aws_e2e_regular_aws.js - command: shell.exec type: test @@ -529,10 +531,11 @@ functions: type: test params: working_dir: src + shell: bash script: | ${PREPARE_SHELL} cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo aws_e2e_assume_role.js - command: shell.exec type: test @@ -562,13 +565,14 @@ functions: type: test params: working_dir: src + shell: bash script: | ${PREPARE_SHELL} # Write an empty prepare_mongodb_aws so no auth environment variables # are set. echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" cd ${DRIVERS_TOOLS}/.evergreen/auth_aws - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo aws_e2e_ec2.js - command: shell.exec type: test @@ -628,6 +632,7 @@ functions: type: test params: working_dir: src + shell: bash script: | ${PREPARE_SHELL} AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws @@ -648,7 +653,7 @@ functions: EOF cat setup.js - . ./activate_venv.sh + . ./activate-authawsvenv.sh ${MONGODB_BINARIES}/mongo --nodb setup.js aws_e2e_ecs.js run-ocsp-test: - command: shell.exec diff --git a/.evergreen/run-kms-servers.sh b/.evergreen/run-kms-servers.sh index 76ef6ac258..44fa5dd7f8 100644 --- a/.evergreen/run-kms-servers.sh +++ b/.evergreen/run-kms-servers.sh @@ -1,5 +1,5 @@ cd ${DRIVERS_TOOLS}/.evergreen/csfle -. ./activate_venv.sh +. ./activate-kmstlsvenv.sh # by default it always runs on port 5698 ./kmstlsvenv/bin/python3 -u kms_kmip_server.py & ./kmstlsvenv/bin/python3 -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000 & diff --git a/test/readme.md b/test/readme.md index a962235d4b..45524039b5 100644 --- a/test/readme.md +++ b/test/readme.md @@ -422,7 +422,7 @@ The following steps will walk you through how to run the tests for CSFLE. #### KMIP FLE support tests 1. Install virtualenv: `pip install virtualenv` -2. Source the ./activate_venv.sh script in driver evergreen tools `.evergreen/csfle/activate_venv.sh` +2. Source the ./activate-kmstlsvenv.sh script in driver evergreen tools `.evergreen/csfle/activate-kmstlsvenv.sh` 1. This will install all the dependencies needed to run a python kms_kmip simulated server 3. In 4 separate terminals launch the following: - `./kmstlsvenv/bin/python3 -u kms_kmip_server.py` # by default it always runs on port 5698 diff --git a/test/spec/client-side-encryption/tests/README.rst b/test/spec/client-side-encryption/tests/README.rst index cf123a0ddb..c350256875 100644 --- a/test/spec/client-side-encryption/tests/README.rst +++ b/test/spec/client-side-encryption/tests/README.rst @@ -1193,14 +1193,14 @@ KMS TLS Tests The following tests that connections to KMS servers with TLS verify peer certificates. The two tests below make use of mock KMS servers which can be run on Evergreen using `the mock KMS server script `_. -Drivers can set up their local Python enviroment for the mock KMS server by running `the virtualenv activation script `_. +Drivers can set up their local Python enviroment for the mock KMS server by running `the virtualenv activation script `_. To start two mock KMS servers, one on port 9000 with `ca.pem`_ as a CA file and `expired.pem`_ as a cert file, and one on port 9001 with `ca.pem`_ as a CA file and `wrong-host.pem`_ as a cert file, run the following commands from the ``.evergreen/csfle`` directory: .. code:: - . ./activate_venv.sh + . ./activate-kmstlsvenv.sh python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 9000 & python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 9001 &