Skip to content

Commit a964150

Browse files
fix missing file
1 parent 27ae3a5 commit a964150

File tree

4 files changed

+67
-30
lines changed

4 files changed

+67
-30
lines changed

.evergreen/config.in.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,10 @@ tasks:
11971197
type: setup
11981198
params:
11991199
binary: bash
1200-
add_expansions_to_env: true
1200+
env:
1201+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
12011202
args:
1202-
- src/.evergreen/copy-driver-to-azure-and-run.sh
1203+
- src/.evergreen/run-deployed-azure-kms-tests.sh
12031204

12041205
- name: "test-azurekms-fail-task"
12051206
commands:
@@ -1426,21 +1427,11 @@ task_groups:
14261427
binary: bash
14271428
args:
14281429
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
1429-
- command: expansions.update
1430-
# Load the GCPKMS_GCLOUD, GCPKMS_INSTANCE, GCPKMS_REGION, and GCPKMS_ZONE expansions.
1431-
params:
1432-
file: src/testgcpkms-expansions.yml
14331430

14341431
teardown_group:
14351432
- command: subprocess.exec
14361433
params:
14371434
binary: bash
1438-
add_expansions_to_env: true
1439-
env:
1440-
GCPKMS_GCLOUD: ${GCPKMS_GCLOUD}
1441-
GCPKMS_PROJECT: ${GCPKMS_PROJECT}
1442-
GCPKMS_ZONE: ${GCPKMS_ZONE}
1443-
GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME}
14441435
args:
14451436
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh
14461437
tasks:
@@ -1459,10 +1450,6 @@ task_groups:
14591450
AZUREKMS_VMNAME_PREFIX: "NODE_DRIVER"
14601451
args:
14611452
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup.sh
1462-
- command: expansions.update
1463-
# Load AZUREKMS_VMNAME into the expansions.
1464-
params:
1465-
file: src/testazurekms-expansions.yml
14661453

14671454
teardown_group:
14681455
# Load expansions again. The setup task may have failed before running `expansions.update`.
@@ -1472,7 +1459,6 @@ task_groups:
14721459
- command: subprocess.exec
14731460
params:
14741461
binary: bash
1475-
add_expansions_to_env: true
14761462
args:
14771463
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh
14781464
tasks:

.evergreen/config.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,9 +1152,10 @@ tasks:
11521152
type: setup
11531153
params:
11541154
binary: bash
1155-
add_expansions_to_env: true
1155+
env:
1156+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
11561157
args:
1157-
- src/.evergreen/copy-driver-to-azure-and-run.sh
1158+
- src/.evergreen/run-deployed-azure-kms-tests.sh
11581159
- name: test-azurekms-fail-task
11591160
commands:
11601161
- command: expansions.update
@@ -4455,19 +4456,10 @@ task_groups:
44554456
binary: bash
44564457
args:
44574458
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
4458-
- command: expansions.update
4459-
params:
4460-
file: src/testgcpkms-expansions.yml
44614459
teardown_group:
44624460
- command: subprocess.exec
44634461
params:
44644462
binary: bash
4465-
add_expansions_to_env: true
4466-
env:
4467-
GCPKMS_GCLOUD: ${GCPKMS_GCLOUD}
4468-
GCPKMS_PROJECT: ${GCPKMS_PROJECT}
4469-
GCPKMS_ZONE: ${GCPKMS_ZONE}
4470-
GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME}
44714463
args:
44724464
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh
44734465
tasks:

.evergreen/copy-driver-to-azure-and-run.sh renamed to .evergreen/run-deployed-azure-kms-tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
set -o errexit
44
source "${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/secrets-export.sh"
5+
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
56

67
if [ -z ${AZUREKMS_RESOURCEGROUP+omitted} ]; then echo "AZUREKMS_RESOURCEGROUP is unset" && exit 1; fi
78
if [ -z ${AZUREKMS_VMNAME+omitted} ]; then echo "AZUREKMS_VMNAME is unset" && exit 1; fi
89

9-
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
10-
1110
export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey
1211
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey
1312

test/readme.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ about the types of tests and how to run them.
3131
- [Load Balanced](#load-balanced)
3232
- [Client-Side Field-Level Encryption (CSFLE)](#client-side-field-level-encryption-csfle)
3333
- [KMIP FLE support tests](#kmip-fle-support-tests)
34+
- [Deployed KMS Tests](#deployed-kms-tests)
35+
- [Azure KMS](#azure-kms)
36+
- [GCP KMS](#gcp-kms)
3437
- [Deployed Atlas Tests](#deployed-atlas-tests)
3538
- [Launching an Atlas Cluster](#launching-an-atlas-cluster)
3639
- [Search Indexes](#search-indexes)
@@ -635,6 +638,63 @@ The following steps will walk you through how to run the tests for CSFLE.
635638
npx mocha --config test/mocha_mongodb.json test/integration/client-side-encryption/
636639
```
637640
641+
### Deployed KMS Tests
642+
643+
CSFLE supports automatic KMS credential fetching for Azure, GCP and AWS. In order to e2e test GCP and Azure, we must run the tests on an actual GCP or Azure host (our ). This is supported by drivers-evergreen-tools.
644+
645+
The basic idea is to
646+
647+
1. Provision an Azure or GCP server.
648+
2. Set up a cluster on the server.
649+
3. Copy the driver and tests to the server and run the tests on the server.
650+
4. Copy the results back.
651+
652+
All of this is handled in the csfle/azurekms and csfle/gcpkms folders in drivers-evergreen-tools.
653+
654+
> [!IMPORTANT]
655+
> Azure VMs and GCP VMs must be destroyed with their corresponding `teardown.sh` scripts.
656+
657+
#### Azure KMS
658+
659+
1. Provision an Azure server. You must set the `AZUREKMS_VMNAME_PREFIX` variable:
660+
661+
```bash
662+
export AZUREKMS_VMNAME_PREFIX: "NODE_DRIVER"
663+
bash ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup.sh
664+
```
665+
666+
2. Comment out the following line in `run-deployed-azure-kms-tests.sh`:
667+
668+
```bash
669+
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
670+
```
671+
672+
3. Run the tests:
673+
674+
```bash
675+
bash .evergreen/run-deployed-azure-kms-tests.sh
676+
```
677+
678+
#### GCP KMS
679+
680+
1. Provision an GCP server.
681+
682+
```bash
683+
bash ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
684+
```
685+
686+
1. Comment out the following line in `run-deployed-gcp-kms-tests.sh`:
687+
688+
```bash
689+
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
690+
```
691+
692+
3. Run the tests:
693+
694+
```bash
695+
bash .evergreen/run-deployed-gcp-kms-tests.sh
696+
```
697+
638698
### Deployed Atlas Tests
639699
640700
#### Launching an Atlas Cluster

0 commit comments

Comments
 (0)