Skip to content

Commit f538115

Browse files
fix missing file
1 parent f539cf3 commit f538115

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
@@ -1211,9 +1211,10 @@ tasks:
12111211
type: setup
12121212
params:
12131213
binary: bash
1214-
add_expansions_to_env: true
1214+
env:
1215+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
12151216
args:
1216-
- src/.evergreen/copy-driver-to-azure-and-run.sh
1217+
- src/.evergreen/run-deployed-azure-kms-tests.sh
12171218

12181219
- name: "test-azurekms-fail-task"
12191220
commands:
@@ -1448,21 +1449,11 @@ task_groups:
14481449
binary: bash
14491450
args:
14501451
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
1451-
- command: expansions.update
1452-
# Load the GCPKMS_GCLOUD, GCPKMS_INSTANCE, GCPKMS_REGION, and GCPKMS_ZONE expansions.
1453-
params:
1454-
file: src/testgcpkms-expansions.yml
14551452

14561453
teardown_group:
14571454
- command: subprocess.exec
14581455
params:
14591456
binary: bash
1460-
add_expansions_to_env: true
1461-
env:
1462-
GCPKMS_GCLOUD: ${GCPKMS_GCLOUD}
1463-
GCPKMS_PROJECT: ${GCPKMS_PROJECT}
1464-
GCPKMS_ZONE: ${GCPKMS_ZONE}
1465-
GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME}
14661457
args:
14671458
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh
14681459
tasks:
@@ -1481,10 +1472,6 @@ task_groups:
14811472
AZUREKMS_VMNAME_PREFIX: "NODE_DRIVER"
14821473
args:
14831474
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup.sh
1484-
- command: expansions.update
1485-
# Load AZUREKMS_VMNAME into the expansions.
1486-
params:
1487-
file: src/testazurekms-expansions.yml
14881475

14891476
teardown_group:
14901477
# Load expansions again. The setup task may have failed before running `expansions.update`.
@@ -1494,7 +1481,6 @@ task_groups:
14941481
- command: subprocess.exec
14951482
params:
14961483
binary: bash
1497-
add_expansions_to_env: true
14981484
args:
14991485
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh
15001486
tasks:

.evergreen/config.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,9 +1166,10 @@ tasks:
11661166
type: setup
11671167
params:
11681168
binary: bash
1169-
add_expansions_to_env: true
1169+
env:
1170+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
11701171
args:
1171-
- src/.evergreen/copy-driver-to-azure-and-run.sh
1172+
- src/.evergreen/run-deployed-azure-kms-tests.sh
11721173
- name: test-azurekms-fail-task
11731174
commands:
11741175
- command: expansions.update
@@ -4479,19 +4480,10 @@ task_groups:
44794480
binary: bash
44804481
args:
44814482
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
4482-
- command: expansions.update
4483-
params:
4484-
file: src/testgcpkms-expansions.yml
44854483
teardown_group:
44864484
- command: subprocess.exec
44874485
params:
44884486
binary: bash
4489-
add_expansions_to_env: true
4490-
env:
4491-
GCPKMS_GCLOUD: ${GCPKMS_GCLOUD}
4492-
GCPKMS_PROJECT: ${GCPKMS_PROJECT}
4493-
GCPKMS_ZONE: ${GCPKMS_ZONE}
4494-
GCPKMS_INSTANCENAME: ${GCPKMS_INSTANCENAME}
44954487
args:
44964488
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/teardown.sh
44974489
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)
@@ -652,6 +655,63 @@ The following steps will walk you through how to run the tests for CSFLE.
652655
npx mocha --config test/mocha_mongodb.json test/integration/client-side-encryption/
653656
```
654657

658+
### Deployed KMS Tests
659+
660+
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.
661+
662+
The basic idea is to
663+
664+
1. Provision an Azure or GCP server.
665+
2. Set up a cluster on the server.
666+
3. Copy the driver and tests to the server and run the tests on the server.
667+
4. Copy the results back.
668+
669+
All of this is handled in the csfle/azurekms and csfle/gcpkms folders in drivers-evergreen-tools.
670+
671+
> [!IMPORTANT]
672+
> Azure VMs and GCP VMs must be destroyed with their corresponding `teardown.sh` scripts.
673+
674+
#### Azure KMS
675+
676+
1. Provision an Azure server. You must set the `AZUREKMS_VMNAME_PREFIX` variable:
677+
678+
```bash
679+
export AZUREKMS_VMNAME_PREFIX: "NODE_DRIVER"
680+
bash ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup.sh
681+
```
682+
683+
2. Comment out the following line in `run-deployed-azure-kms-tests.sh`:
684+
685+
```bash
686+
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
687+
```
688+
689+
3. Run the tests:
690+
691+
```bash
692+
bash .evergreen/run-deployed-azure-kms-tests.sh
693+
```
694+
695+
#### GCP KMS
696+
697+
1. Provision an GCP server.
698+
699+
```bash
700+
bash ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
701+
```
702+
703+
1. Comment out the following line in `run-deployed-gcp-kms-tests.sh`:
704+
705+
```bash
706+
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
707+
```
708+
709+
3. Run the tests:
710+
711+
```bash
712+
bash .evergreen/run-deployed-gcp-kms-tests.sh
713+
```
714+
655715
### Deployed Atlas Tests
656716

657717
#### Launching an Atlas Cluster

0 commit comments

Comments
 (0)