Skip to content

test(NODE-4800): update build env scripts #3487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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