Skip to content

Commit 4757f44

Browse files
authored
GODRIVER-3312 Use remaining test secrets from the vault [v1] (#1811)
1 parent 6bcc3dc commit 4757f44

File tree

1 file changed

+13
-37
lines changed

1 file changed

+13
-37
lines changed

.evergreen/config.yml

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,10 +1817,6 @@ tasks:
18171817
echo "Building build-kms-test ... end"
18181818
source $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/secrets-export.sh
18191819
echo "Copying files ... begin"
1820-
export GCPKMS_GCLOUD=${GCPKMS_GCLOUD}
1821-
export GCPKMS_PROJECT=${GCPKMS_PROJECT}
1822-
export GCPKMS_ZONE=${GCPKMS_ZONE}
1823-
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
18241820
tar czf testgcpkms.tgz ./testkms ./install/libmongocrypt/lib64/libmongocrypt.*
18251821
GCPKMS_SRC=testgcpkms.tgz GCPKMS_DST=$GCPKMS_INSTANCENAME: $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/copy-file.sh
18261822
echo "Copying files ... end"
@@ -1837,10 +1833,6 @@ tasks:
18371833
script: |
18381834
${PREPARE_SHELL}
18391835
source $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/secrets-export.sh
1840-
export GCPKMS_GCLOUD=${GCPKMS_GCLOUD}
1841-
export GCPKMS_PROJECT=${GCPKMS_PROJECT}
1842-
export GCPKMS_ZONE=${GCPKMS_ZONE}
1843-
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
18441836
GCPKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib64 MONGODB_URI='mongodb://localhost:27017' PROVIDER='gcp' ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
18451837
18461838
- name: "testgcpkms-fail-task"
@@ -1906,9 +1898,7 @@ tasks:
19061898
echo "Building build-kms-test ... end"
19071899
19081900
echo "Copying files ... begin"
1909-
export AZUREKMS_RESOURCEGROUP=${AZUREKMS_RESOURCEGROUP}
1910-
export AZUREKMS_VMNAME=${AZUREKMS_VMNAME}
1911-
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey
1901+
source $DRIVERS_TOOLS/.evergreen/csfle/azurekms/secrets-export.sh
19121902
tar czf testazurekms.tgz ./testkms ./install/libmongocrypt/lib64/libmongocrypt.*
19131903
AZUREKMS_SRC=testazurekms.tgz AZUREKMS_DST=/tmp $DRIVERS_TOOLS/.evergreen/csfle/azurekms/copy-file.sh
19141904
echo "Copying files ... end"
@@ -1923,11 +1913,8 @@ tasks:
19231913
working_dir: src/go.mongodb.org/mongo-driver
19241914
script: |
19251915
${PREPARE_SHELL}
1926-
source ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup-secrets.sh
1927-
export AZUREKMS_RESOURCEGROUP=${AZUREKMS_RESOURCEGROUP}
1928-
export AZUREKMS_VMNAME=${AZUREKMS_VMNAME}
1929-
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey
1930-
AZUREKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib64 MONGODB_URI='mongodb://localhost:27017' PROVIDER='azure' AZUREKMS_KEY_NAME='${AZUREKMS_KEY_NAME}' AZUREKMS_KEY_VAULT_ENDPOINT='${AZUREKMS_KEY_VAULT_ENDPOINT}' ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh
1916+
source ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/secrets-export.sh
1917+
AZUREKMS_CMD="LD_LIBRARY_PATH=./install/libmongocrypt/lib64 MONGODB_URI='mongodb://localhost:27017' PROVIDER='azure' AZUREKMS_KEY_NAME=$AZUREKMS_KEYNAME AZUREKMS_KEY_VAULT_ENDPOINT=$AZUREKMS_KEYVAULTENDPOINT ./testkms" $DRIVERS_TOOLS/.evergreen/csfle/azurekms/run-command.sh
19311918
19321919
- name: "testazurekms-fail-task"
19331920
# testazurekms-fail-task runs without environment variables.
@@ -1946,10 +1933,12 @@ tasks:
19461933
make build-kms-test
19471934
echo "Building build-kms-test ... end"
19481935
1936+
. ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup-secrets.sh
1937+
19491938
LD_LIBRARY_PATH=./install/libmongocrypt/lib64 \
19501939
MONGODB_URI='mongodb://localhost:27017' \
19511940
EXPECT_ERROR='unable to retrieve azure credentials' \
1952-
PROVIDER='azure' AZUREKMS_KEY_NAME='${AZUREKMS_KEY_NAME}' AZUREKMS_KEY_VAULT_ENDPOINT='${AZUREKMS_KEY_VAULT_ENDPOINT}' \
1941+
PROVIDER='azure' AZUREKMS_KEY_NAME=$AZUREKMS_KEYNAME AZUREKMS_KEY_VAULT_ENDPOINT=$AZUREKMS_KEYVAULTENDPOINT \
19531942
./testkms
19541943
19551944
- name: "test-fuzz"
@@ -2261,18 +2250,14 @@ task_groups:
22612250
shell: "bash"
22622251
script: |
22632252
${PREPARE_SHELL}
2264-
$DRIVERS_TOOLS/.evergreen/csfle/gcpkms/create-and-setup-instance.sh
2265-
# Load the GCPKMS_GCLOUD, GCPKMS_INSTANCE, GCPKMS_REGION, and GCPKMS_ZONE expansions.
2266-
- command: expansions.update
2267-
params:
2268-
file: testgcpkms-expansions.yml
2253+
$DRIVERS_TOOLS/.evergreen/csfle/gcpkms/setup.sh
22692254
teardown_group:
22702255
- command: shell.exec
22712256
params:
22722257
shell: "bash"
22732258
script: |
22742259
${PREPARE_SHELL}
2275-
$DRIVERS_TOOLS/.evergreen/csfle/gcpkms/delete-instance.sh
2260+
$DRIVERS_TOOLS/.evergreen/csfle/gcpkms/teardown.sh
22762261
- func: handle-test-artifacts
22772262
- func: cleanup
22782263
tasks:
@@ -2297,22 +2282,13 @@ task_groups:
22972282
# Get azurekms credentials from the vault.
22982283
. ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/setup-secrets.sh
22992284
${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/create-and-setup-vm.sh
2300-
- command: expansions.update
2301-
params:
2302-
file: testazurekms-expansions.yml
23032285
teardown_group:
2304-
# setup_group may have failed before updating expansions. Try to update again to clean up resources on setup failure.
2305-
- command: expansions.update
2306-
params:
2307-
file: testazurekms-expansions.yml
2308-
- command: shell.exec
2286+
- command: subprocess.exec
23092287
params:
2310-
shell: "bash"
2311-
script: |
2312-
${PREPARE_SHELL}
2313-
export AZUREKMS_SCOPE=${AZUREKMS_SCOPE}
2314-
export AZUREKMS_RESOURCEGROUP=${AZUREKMS_RESOURCEGROUP}
2315-
$DRIVERS_TOOLS/.evergreen/csfle/azurekms/delete-vm.sh
2288+
binary: "bash"
2289+
args:
2290+
- ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/teardown.sh
2291+
23162292
- func: handle-test-artifacts
23172293
- func: cleanup
23182294
tasks:

0 commit comments

Comments
 (0)