Skip to content

Commit f94cda4

Browse files
all changes
1 parent 6b15f20 commit f94cda4

File tree

8 files changed

+90
-195
lines changed

8 files changed

+90
-195
lines changed

.evergreen/config.in.yml

Lines changed: 20 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -152,39 +152,17 @@ functions:
152152
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"
153153
EOT
154154
fi
155-
- command: shell.exec
155+
- command: subprocess.exec
156156
type: test
157157
params:
158+
env:
159+
TEST_CSFLE: "true"
160+
add_expansions_to_env: true
158161
working_dir: "src"
159162
timeout_secs: 300
160-
shell: bash
161-
script: |
162-
${PREPARE_SHELL}
163-
164-
if [ -n "${CLIENT_ENCRYPTION}" ]; then
165-
# Disable xtrace (just in case it was accidentally set).
166-
set +x
167-
. ./prepare_client_encryption.sh
168-
rm -f ./prepare_client_encryption.sh
169-
fi
170-
171-
export VERSION=${VERSION}
172-
export DRIVERS_TOOLS=${DRIVERS_TOOLS}
173-
174-
if [ -z "${RUN_WITH_MONGOCRYPTD}" ]; then
175-
# Set up crypt shared lib if we don't want to use mongocryptd
176-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
177-
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
178-
else
179-
echo "CRYPT_SHARED_LIB_PATH not set; using mongocryptd"
180-
fi
181-
182-
TEST_NPM_SCRIPT="${TEST_NPM_SCRIPT|check:integration-coverage}" \
183-
MONGODB_URI="${MONGODB_URI}" \
184-
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
185-
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
186-
SKIP_DEPS=${SKIP_DEPS|1} \
187-
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
163+
binary: bash
164+
args:
165+
- .evergreen/run-tests.sh
188166

189167
"run serverless tests":
190168
- command: timeout.update
@@ -209,10 +187,9 @@ functions:
209187
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
210188
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"
211189
EOT
212-
- command: shell.exec
190+
- command: subprocess.exec
213191
type: test
214192
params:
215-
working_dir: src
216193
timeout_secs: 300
217194
shell: bash
218195
script: |
@@ -509,27 +486,14 @@ functions:
509486
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
510487
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
511488
EOT
512-
- command: shell.exec
489+
- command: subprocess.exec
513490
type: test
514491
params:
515-
working_dir: "src"
516-
script: |
517-
${PREPARE_SHELL}
518-
519-
export PYTHON_BINARY=$([ "Windows_NT" = "$OS" ] && echo "/cygdrive/c/python/python38/python.exe" || echo "/opt/mongodbtoolchain/v3/bin/python3")
520-
export PROJECT_DIRECTORY="$(pwd)"
521-
export DRIVERS_TOOLS="${DRIVERS_TOOLS}"
522-
export NODE_LTS_VERSION='${NODE_LTS_VERSION}'
523-
export MONGODB_URI="${MONGODB_URI}"
524-
export TEST_SOCKS5_CSFLE="${TEST_SOCKS5_CSFLE}"
525-
export SSL="${SSL}"
526-
527-
# Disable xtrace (just in case it was accidentally set).
528-
set +x
529-
. ./prepare_client_encryption.sh
530-
rm -f ./prepare_client_encryption.sh
531-
532-
bash ${PROJECT_DIRECTORY}/.evergreen/run-socks5-tests.sh
492+
add_expansions_to_env: true
493+
working_dir: src
494+
binary: bash
495+
args:
496+
- .evergreen/run-socks5-tests.sh
533497

534498
"run kerberos tests":
535499
- command: subprocess.exec
@@ -956,29 +920,14 @@ functions:
956920
export AWS_REGION='${AWS_REGION}'
957921
export AWS_CMK_ID='${AWS_CMK_ID}'
958922
EOT
959-
- command: shell.exec
923+
- command: subprocess.exec
960924
type: test
961925
params:
962-
working_dir: "src"
963-
timeout_secs: 60
964-
shell: bash
965-
script: |
966-
${PREPARE_SHELL}
967-
968-
# Disable xtrace (just in case it was accidentally set).
969-
set +x
970-
source ./prepare_client_encryption.sh
971-
rm -f ./prepare_client_encryption.sh
972-
973-
export VERSION=${VERSION}
974-
export DRIVERS_TOOLS=${DRIVERS_TOOLS}
975-
976-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
977-
export MONGODB_URI="${MONGODB_URI}"
978-
979-
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
980-
981-
bash ${PROJECT_DIRECTORY}/.evergreen/run-custom-csfle-tests.sh
926+
working_dir: src
927+
add_expansions_to_env: true
928+
binary: bash
929+
args:
930+
- .evergreen/run-custom-csfle-tests.sh
982931

983932
"run lambda handler example tests":
984933
- command: subprocess.exec

.evergreen/config.yml

Lines changed: 21 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -124,39 +124,17 @@ functions:
124124
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"
125125
EOT
126126
fi
127-
- command: shell.exec
127+
- command: subprocess.exec
128128
type: test
129129
params:
130+
env:
131+
TEST_CSFLE: 'true'
132+
add_expansions_to_env: true
130133
working_dir: src
131134
timeout_secs: 300
132-
shell: bash
133-
script: |
134-
${PREPARE_SHELL}
135-
136-
if [ -n "${CLIENT_ENCRYPTION}" ]; then
137-
# Disable xtrace (just in case it was accidentally set).
138-
set +x
139-
. ./prepare_client_encryption.sh
140-
rm -f ./prepare_client_encryption.sh
141-
fi
142-
143-
export VERSION=${VERSION}
144-
export DRIVERS_TOOLS=${DRIVERS_TOOLS}
145-
146-
if [ -z "${RUN_WITH_MONGOCRYPTD}" ]; then
147-
# Set up crypt shared lib if we don't want to use mongocryptd
148-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
149-
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
150-
else
151-
echo "CRYPT_SHARED_LIB_PATH not set; using mongocryptd"
152-
fi
153-
154-
TEST_NPM_SCRIPT="${TEST_NPM_SCRIPT|check:integration-coverage}" \
155-
MONGODB_URI="${MONGODB_URI}" \
156-
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
157-
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
158-
SKIP_DEPS=${SKIP_DEPS|1} \
159-
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
135+
binary: bash
136+
args:
137+
- .evergreen/run-tests.sh
160138
run serverless tests:
161139
- command: timeout.update
162140
params:
@@ -180,10 +158,9 @@ functions:
180158
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
181159
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"
182160
EOT
183-
- command: shell.exec
161+
- command: subprocess.exec
184162
type: test
185163
params:
186-
working_dir: src
187164
timeout_secs: 300
188165
shell: bash
189166
script: |
@@ -459,40 +436,14 @@ functions:
459436
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
460437
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
461438
EOT
462-
- command: shell.exec
439+
- command: subprocess.exec
463440
type: test
464441
params:
442+
add_expansions_to_env: true
465443
working_dir: src
466-
script: >
467-
${PREPARE_SHELL}
468-
469-
470-
export PYTHON_BINARY=$([ "Windows_NT" = "$OS" ] && echo "/cygdrive/c/python/python38/python.exe" || echo
471-
"/opt/mongodbtoolchain/v3/bin/python3")
472-
473-
export PROJECT_DIRECTORY="$(pwd)"
474-
475-
export DRIVERS_TOOLS="${DRIVERS_TOOLS}"
476-
477-
export NODE_LTS_VERSION='${NODE_LTS_VERSION}'
478-
479-
export MONGODB_URI="${MONGODB_URI}"
480-
481-
export TEST_SOCKS5_CSFLE="${TEST_SOCKS5_CSFLE}"
482-
483-
export SSL="${SSL}"
484-
485-
486-
# Disable xtrace (just in case it was accidentally set).
487-
488-
set +x
489-
490-
. ./prepare_client_encryption.sh
491-
492-
rm -f ./prepare_client_encryption.sh
493-
494-
495-
bash ${PROJECT_DIRECTORY}/.evergreen/run-socks5-tests.sh
444+
binary: bash
445+
args:
446+
- .evergreen/run-socks5-tests.sh
496447
run kerberos tests:
497448
- command: subprocess.exec
498449
type: test
@@ -927,29 +878,14 @@ functions:
927878
export AWS_REGION='${AWS_REGION}'
928879
export AWS_CMK_ID='${AWS_CMK_ID}'
929880
EOT
930-
- command: shell.exec
881+
- command: subprocess.exec
931882
type: test
932883
params:
933884
working_dir: src
934-
timeout_secs: 60
935-
shell: bash
936-
script: |
937-
${PREPARE_SHELL}
938-
939-
# Disable xtrace (just in case it was accidentally set).
940-
set +x
941-
source ./prepare_client_encryption.sh
942-
rm -f ./prepare_client_encryption.sh
943-
944-
export VERSION=${VERSION}
945-
export DRIVERS_TOOLS=${DRIVERS_TOOLS}
946-
947-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
948-
export MONGODB_URI="${MONGODB_URI}"
949-
950-
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
951-
952-
bash ${PROJECT_DIRECTORY}/.evergreen/run-custom-csfle-tests.sh
885+
add_expansions_to_env: true
886+
binary: bash
887+
args:
888+
- .evergreen/run-custom-csfle-tests.sh
953889
run lambda handler example tests:
954890
- command: subprocess.exec
955891
params:
@@ -3733,6 +3669,7 @@ tasks:
37333669
- {key: NPM_VERSION, value: '9'}
37343670
- {key: VERSION, value: '5.0'}
37353671
- {key: TOPOLOGY, value: replica_set}
3672+
- {key: CLIENT_ENCRYPTION, value: 'true'}
37363673
- func: install dependencies
37373674
- func: bootstrap mongo-orchestration
37383675
- func: bootstrap kms servers
@@ -3750,6 +3687,7 @@ tasks:
37503687
- {key: NPM_VERSION, value: '9'}
37513688
- {key: VERSION, value: rapid}
37523689
- {key: TOPOLOGY, value: replica_set}
3690+
- {key: CLIENT_ENCRYPTION, value: 'true'}
37533691
- func: install dependencies
37543692
- func: bootstrap mongo-orchestration
37553693
- func: bootstrap kms servers
@@ -3767,6 +3705,7 @@ tasks:
37673705
- {key: NPM_VERSION, value: '9'}
37683706
- {key: VERSION, value: latest}
37693707
- {key: TOPOLOGY, value: replica_set}
3708+
- {key: CLIENT_ENCRYPTION, value: 'true'}
37703709
- func: install dependencies
37713710
- func: bootstrap mongo-orchestration
37723711
- func: bootstrap kms servers

.evergreen/generate_evergreen_tasks.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ for (const version of ['5.0', 'rapid', 'latest']) {
668668
NODE_LTS_VERSION: LOWEST_LTS,
669669
NPM_VERSION: 9,
670670
VERSION: version,
671-
TOPOLOGY: 'replica_set'
671+
TOPOLOGY: 'replica_set',
672+
CLIENT_ENCRYPTION: true
672673
}),
673674
{ func: 'install dependencies' },
674675
{ func: 'bootstrap mongo-orchestration' },

.evergreen/run-custom-csfle-tests.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
#! /usr/bin/env bash
22
set +o xtrace # Do not write AWS credentials to stderr
33

4+
export CLIENT_ENCRYPTION=true
5+
source .evergreen/setup-fle.sh
6+
47
# Initiail checks for running these tests
58
if [ -z ${AWS_ACCESS_KEY_ID+omitted} ]; then echo "AWS_ACCESS_KEY_ID is unset" && exit 1; fi
69
if [ -z ${AWS_SECRET_ACCESS_KEY+omitted} ]; then echo "AWS_SECRET_ACCESS_KEY is unset" && exit 1; fi
710
if [ -z ${CSFLE_KMS_PROVIDERS+omitted} ]; then echo "CSFLE_KMS_PROVIDERS is unset" && exit 1; fi
811

9-
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
10-
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
11-
export CSFLE_KMS_PROVIDERS=${CSFLE_KMS_PROVIDERS}
12-
export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH}
13-
echo "csfle CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
14-
1512
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
1613

1714
set -o xtrace # Write all commands first to stderr
1815
set -o errexit # Exit the script with error if any of the commands fail
1916

20-
# Get access to the AWS temporary credentials:
21-
echo "adding temporary AWS credentials to environment"
22-
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
23-
pushd "$DRIVERS_TOOLS"/.evergreen/csfle
24-
. ./activate-kmstlsvenv.sh
25-
. ./set-temp-creds.sh
26-
popd
2717

2818
export MONGODB_URI=${MONGODB_URI}
2919
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"

.evergreen/run-serverless-tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/bin/env bash
22

3+
source secrets-export.sh
4+
source serverless.env
5+
6+
# next, set up FLE
7+
export CLIENT_ENCRYPTION=true
8+
export TEST_CSFLE=true
9+
source .evergreen/setup-fle.sh
10+
311
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
412

513
if [ -z ${SERVERLESS+omitted} ]; then echo "SERVERLESS is unset" && exit 1; fi

.evergreen/run-socks5-tests.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,11 @@ set -o errexit # Exit the script with error if any of the commands fail
66
set -o xtrace # For debuggability, no external credentials are used here
77

88
function setup_fle() {
9-
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
10-
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
11-
export CSFLE_KMS_PROVIDERS=${CSFLE_KMS_PROVIDERS}
12-
export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH}
13-
echo "csfle CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
14-
159
set -o xtrace # Write all commands first to stderr
1610
set -o errexit # Exit the script with error if any of the commands fail
17-
18-
# Get access to the AWS temporary credentials:
19-
echo "adding temporary AWS credentials to environment"
20-
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
21-
pushd "$DRIVERS_TOOLS"/.evergreen/csfle
22-
. ./activate-kmstlsvenv.sh
23-
. ./set-temp-creds.sh
24-
popd
11+
12+
export CLIENT_ENCRYPTION=true
13+
source .evergreen/setup-fle.sh
2514

2615
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
2716
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"

0 commit comments

Comments
 (0)