Skip to content

Commit 10a5001

Browse files
committed
encryption
1 parent 8651f13 commit 10a5001

File tree

7 files changed

+93
-257
lines changed

7 files changed

+93
-257
lines changed

.evergreen/build-nextest-archive.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ FEATURE_FLAGS+=("${STANDARD_FEATURES[@]}")
1010

1111
add_conditional_features
1212

13+
if [[ "$IN_USE_ENCRYPTION" = true ]]; then
14+
FEATURE_FLAGS+=("in-use-encryption" "azure-kms" "text-indexes-unstable" "aws-auth")
15+
fi
16+
1317
cargo nextest archive --workspace $(features_option) --archive-file nextest-archive.tar.zst

.evergreen/cargo-test.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,22 @@ CARGO_RESULT=0
66

77
. .evergreen/features.sh
88

9+
if [[ "$USE_NEXTEST_ARCHIVE" = true ]]; then
10+
WORKSPACE_ROOT="$(pwd)"
11+
if [[ "Windows_NT" = "$OS" ]]; then
12+
WORKSPACE_ROOT="$(cygpath -w ${WORKSPACE_ROOT})"
13+
fi
14+
CARGO_OPTIONS+=("--archive-file" "nextest-archive.tar.zst" "--workspace-remap" "${WORKSPACE_ROOT}")
15+
fi
16+
17+
918
cargo_test_options() {
10-
echo $1 ${CARGO_OPTIONS[@]} $(features_option) -- ${TEST_OPTIONS[@]}
19+
FEATURES="$(features_option)"
20+
if [[ "$USE_NEXTEST_ARCHIVE" = true ]]; then
21+
# Feature flags are set when the archive is built
22+
FEATURES=""
23+
fi
24+
echo $1 ${CARGO_OPTIONS[@]} "${FEATURES}" -- ${TEST_OPTIONS[@]}
1125
}
1226

1327
cargo_test() {

.evergreen/config.yml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,9 @@ buildvariants:
363363
LIBMONGOCRYPT_OS: rhel-80-64-bit
364364
AUTH: auth
365365
SSL: ssl
366+
IN_USE_ENCRYPTION: true
366367
tasks:
368+
- name: build-nextest-archive
367369
- .in-use-encryption
368370

369371
- name: in-use-encryption-disable-crypt-shared
@@ -376,7 +378,9 @@ buildvariants:
376378
AUTH: auth
377379
SSL: ssl
378380
DISABLE_CRYPT_SHARED: true
381+
IN_USE_ENCRYPTION: true
379382
tasks:
383+
- name: build-nextest-archive
380384
- .in-use-encryption
381385

382386
- name: in-use-encryption-openssl
@@ -388,8 +392,10 @@ buildvariants:
388392
AUTH: auth
389393
SSL: ssl
390394
OPENSSL: true
395+
IN_USE_ENCRYPTION: true
391396
tasks:
392-
- test-in-use-encryption-openssl
397+
- name: build-nextest-archive
398+
- test-in-use-encryption-rapid
393399

394400
- name: load-balancer
395401
display_name: "Load Balancer"
@@ -1084,7 +1090,10 @@ tasks:
10841090

10851091
- name: test-in-use-encryption-4.2
10861092
tags: [in-use-encryption]
1093+
depends_on:
1094+
- name: build-nextest-archive
10871095
commands:
1096+
- func: "fetch nextest archive"
10881097
- func: "install libmongocrypt"
10891098
- func: "bootstrap mongo-orchestration"
10901099
vars:
@@ -1095,7 +1104,10 @@ tasks:
10951104

10961105
- name: test-in-use-encryption-4.4
10971106
tags: [in-use-encryption]
1107+
depends_on:
1108+
- name: build-nextest-archive
10981109
commands:
1110+
- func: "fetch nextest archive"
10991111
- func: "install libmongocrypt"
11001112
- func: "bootstrap mongo-orchestration"
11011113
vars:
@@ -1106,7 +1118,10 @@ tasks:
11061118

11071119
- name: test-in-use-encryption-5.0
11081120
tags: [in-use-encryption]
1121+
depends_on:
1122+
- name: build-nextest-archive
11091123
commands:
1124+
- func: "fetch nextest archive"
11101125
- func: "install libmongocrypt"
11111126
- func: "bootstrap mongo-orchestration"
11121127
vars:
@@ -1117,7 +1132,10 @@ tasks:
11171132

11181133
- name: test-in-use-encryption-6.0
11191134
tags: [in-use-encryption]
1135+
depends_on:
1136+
- name: build-nextest-archive
11201137
commands:
1138+
- func: "fetch nextest archive"
11211139
- func: "install libmongocrypt"
11221140
- func: "bootstrap mongo-orchestration"
11231141
vars:
@@ -1128,7 +1146,10 @@ tasks:
11281146

11291147
- name: test-in-use-encryption-7.0
11301148
tags: [in-use-encryption]
1149+
depends_on:
1150+
- name: build-nextest-archive
11311151
commands:
1152+
- func: "fetch nextest archive"
11321153
- func: "install libmongocrypt"
11331154
- func: "bootstrap mongo-orchestration"
11341155
vars:
@@ -1139,7 +1160,10 @@ tasks:
11391160

11401161
- name: test-in-use-encryption-rapid
11411162
tags: [in-use-encryption]
1163+
depends_on:
1164+
- name: build-nextest-archive
11421165
commands:
1166+
- func: "fetch nextest archive"
11431167
- func: "install libmongocrypt"
11441168
- func: "bootstrap mongo-orchestration"
11451169
vars:
@@ -1150,7 +1174,10 @@ tasks:
11501174

11511175
- name: test-in-use-encryption-latest
11521176
tags: [in-use-encryption]
1177+
depends_on:
1178+
- name: build-nextest-archive
11531179
commands:
1180+
- func: "fetch nextest archive"
11541181
- func: "install libmongocrypt"
11551182
- func: "bootstrap mongo-orchestration"
11561183
vars:
@@ -1159,16 +1186,6 @@ tasks:
11591186
- func: "start csfle servers"
11601187
- func: "run csfle tests"
11611188

1162-
- name: test-in-use-encryption-openssl
1163-
commands:
1164-
- func: "install libmongocrypt"
1165-
- func: "bootstrap mongo-orchestration"
1166-
vars:
1167-
MONGODB_VERSION: rapid
1168-
TOPOLOGY: replica_set
1169-
- func: "start csfle servers"
1170-
- func: "run csfle tests"
1171-
11721189
- name: test-load-balancer-5.0
11731190
tags: [load-balancer]
11741191
commands:
@@ -1326,6 +1343,7 @@ tasks:
13261343

13271344
- name: build-nextest-archive
13281345
commands:
1346+
- func: "install libmongocrypt"
13291347
- command: subprocess.exec
13301348
type: setup
13311349
params:
@@ -1339,6 +1357,9 @@ tasks:
13391357
- ZSTD
13401358
- ZLIB
13411359
- SNAPPY
1360+
- IN_USE_ENCRYPTION
1361+
- MONGOCRYPT_LIB_DIR
1362+
- LD_LIBRARY_PATH
13421363
- command: s3.put
13431364
type: setup
13441365
params:
@@ -1603,6 +1624,7 @@ functions:
16031624
16041625
"bootstrap mongo-orchestration":
16051626
- command: subprocess.exec
1627+
type: setup
16061628
params:
16071629
binary: sh
16081630
args:
@@ -1735,6 +1757,8 @@ functions:
17351757
binary: bash
17361758
args:
17371759
- .evergreen/run-csfle-tests.sh
1760+
env:
1761+
USE_NEXTEST_ARCHIVE: "true"
17381762
include_expansions_in_env:
17391763
- DRIVERS_TOOLS
17401764
- PROJECT_DIRECTORY
@@ -2022,3 +2046,14 @@ functions:
20222046
- AWS_ACCESS_KEY_ID
20232047
- AWS_SECRET_ACCESS_KEY
20242048
- AWS_SESSION_TOKEN
2049+
2050+
"fetch nextest archive":
2051+
- command: s3.get
2052+
type: setup
2053+
params:
2054+
aws_key: ${aws_key}
2055+
aws_secret: ${aws_secret}
2056+
remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${build_id}-nextest-archive.tar.zst
2057+
bucket: mciuploads
2058+
local_file: src/nextest-archive.tar.zst
2059+
optional: true

.evergreen/generate-tasks/src/main.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,7 @@ tasks:"
2323
- name: build-nextest-archive
2424
patch_optional: true
2525
commands:
26-
- command: s3.get
27-
type: setup
28-
params:
29-
aws_key: ${{aws_key}}
30-
aws_secret: ${{aws_secret}}
31-
remote_file: \
32-
${{UPLOAD_BUCKET}}/${{build_variant}}/${{revision}}/\
33-
${{build_id}}-nextest-archive.tar.zst
34-
bucket: mciuploads
35-
local_file: src/nextest-archive.tar.zst
36-
optional: true
26+
- func: \"fetch nextest archive\"
3727
- func: \"bootstrap mongo-orchestration\"
3828
type: setup
3929
vars:

.evergreen/run-csfle-tests.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ set -o xtrace
1010

1111
export CSFLE_TLS_CERT_DIR="${DRIVERS_TOOLS}/.evergreen/x509gen"
1212

13-
FEATURE_FLAGS+=("in-use-encryption" "azure-kms" "text-indexes-unstable")
1413
CARGO_OPTIONS+=("--ignore-default-filter")
1514

16-
if [[ "$OPENSSL" = true ]]; then
17-
FEATURE_FLAGS+=("openssl-tls")
18-
fi
19-
2015
if [ "$OS" = "Windows_NT" ]; then
2116
export CSFLE_TLS_CERT_DIR=$(cygpath ${CSFLE_TLS_CERT_DIR} --windows)
2217
export SSL_CERT_FILE=$(cygpath /etc/ssl/certs/ca-bundle.crt --windows)
@@ -28,16 +23,16 @@ fi
2823
# Add mongodb binaries to path for mongocryptd
2924
PATH=${PATH}:${DRIVERS_TOOLS}/mongodb/bin
3025

26+
set -o xtrace
3127
set +o errexit
3228

29+
TEST_OPTIONS=("--skip" "on_demand_aws::failure")
3330
cargo_test test::csfle
3431

35-
FEATURE_FLAGS+=("aws-auth")
36-
cargo_test on_demand_aws::success
37-
3832
# Unset variables for on-demand credential failure tests.
3933
unset AWS_ACCESS_KEY_ID
4034
unset AWS_SECRET_ACCESS_KEY
35+
TEST_OPTIONS=()
4136
cargo_test on_demand_aws::failure
4237

4338
exit ${CARGO_RESULT}

.evergreen/run-tests.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ FEATURE_FLAGS+=("${STANDARD_FEATURES[@]}")
1010

1111
add_conditional_features
1212

13-
if [ "$USE_NEXTEST_ARCHIVE" = true ]; then
14-
# Feature flags are set when the archive is built
15-
WORKSPACE_ROOT="$(pwd)"
16-
if [ "Windows_NT" == "$OS" ]; then
17-
WORKSPACE_ROOT="$(cygpath -w ${WORKSPACE_ROOT})"
18-
fi
19-
FEATURE_FLAGS=()
20-
CARGO_OPTIONS+=("--archive-file" "nextest-archive.tar.zst" "--workspace-remap" "${WORKSPACE_ROOT}")
21-
fi
22-
2313
echo "cargo test options: $(cargo_test_options)"
2414

2515
set +o errexit

0 commit comments

Comments
 (0)