Skip to content

Commit

Permalink
test(NODE-4800): update build env scripts (#3487)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Dec 16, 2022
1 parent 6ef11d7 commit 9f945c4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
15 changes: 10 additions & 5 deletions .evergreen/config.in.yml
Expand Up @@ -527,21 +527,23 @@ 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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -671,6 +675,7 @@ functions:
type: test
params:
working_dir: src
shell: bash
script: |
${PREPARE_SHELL}
AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws
Expand All @@ -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":
Expand Down
15 changes: 10 additions & 5 deletions .evergreen/config.yml
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -628,6 +632,7 @@ functions:
type: test
params:
working_dir: src
shell: bash
script: |
${PREPARE_SHELL}
AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .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 &
Expand Down
2 changes: 1 addition & 1 deletion test/readme.md
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/spec/client-side-encryption/tests/README.rst
Expand Up @@ -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 <https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/csfle/kms_http_server.py>`_.
Drivers can set up their local Python enviroment for the mock KMS server by running `the virtualenv activation script <https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/csfle/activate_venv.sh>`_.
Drivers can set up their local Python enviroment for the mock KMS server by running `the virtualenv activation script <https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/csfle/activate-kmstlsvenv.sh>`_.

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 &
Expand Down

0 comments on commit 9f945c4

Please sign in to comment.