From 76b1465d91a17700e938abc9a263a8785cb82f3d Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 13 Oct 2021 16:48:31 -0400 Subject: [PATCH 1/5] test(NODE-3606): legacy and new versions of the CSFLE library --- .evergreen/run-tests.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 60649bc1c1..101007125e 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # set -o xtrace # Write all commands first to stderr set -o errexit # Exit the script with error if any of the commands fail @@ -52,8 +52,11 @@ if [[ -z "${CLIENT_ENCRYPTION}" ]]; then unset AWS_ACCESS_KEY_ID; unset AWS_SECRET_ACCESS_KEY; else - npm install mongodb-client-encryption@latest - + if [[ $NODE_VERSION -ge 12 ]]; then + npm install mongodb-client-encryption@">=2.0.0-beta.0" + else + npm install mongodb-client-encryption@"^1.2.7" + fi # Get access to the AWS temporary credentials: echo "adding temporary AWS credentials to environment" # CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN From 2dc14dbd2b15bca57675769fe301877f42579681 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 13 Oct 2021 16:52:40 -0400 Subject: [PATCH 2/5] test legacy and Node-API kerberos versions --- .evergreen/run-kerberos-tests.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.evergreen/run-kerberos-tests.sh b/.evergreen/run-kerberos-tests.sh index 665d520efc..a7e08f7d90 100644 --- a/.evergreen/run-kerberos-tests.sh +++ b/.evergreen/run-kerberos-tests.sh @@ -22,8 +22,13 @@ fi echo "Running kinit" kinit -k -t "$(pwd)/.evergreen/drivers.keytab" -p ${KRB5_PRINCIPAL} -npm install kerberos +set -o xtrace +npm install kerberos@">=2.0.0-beta.0" npm run check:kerberos +npm install kerberos@"^1.1.7" +npm run check:kerberos +set +o xtrace + # destroy ticket kdestroy From 0c92dc3f250492455184fd371ee1258cbca1d4ac Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 13 Oct 2021 16:57:05 -0400 Subject: [PATCH 3/5] fix version parsing --- .evergreen/run-tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 101007125e..61ccc6ea81 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -52,7 +52,8 @@ if [[ -z "${CLIENT_ENCRYPTION}" ]]; then unset AWS_ACCESS_KEY_ID; unset AWS_SECRET_ACCESS_KEY; else - if [[ $NODE_VERSION -ge 12 ]]; then + NODE_MAJOR_VERSION=$(echo $NODE_VERSION | cut -d. -f1) + if [[ $NODE_MAJOR_VERSION -ge 12 ]]; then npm install mongodb-client-encryption@">=2.0.0-beta.0" else npm install mongodb-client-encryption@"^1.2.7" From 7a53f6a23340f6c297d700ec6e87a0808bd853b5 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Thu, 14 Oct 2021 15:17:27 -0400 Subject: [PATCH 4/5] chore: gate kerberos version on nodejs version --- .evergreen/run-kerberos-tests.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.evergreen/run-kerberos-tests.sh b/.evergreen/run-kerberos-tests.sh index a7e08f7d90..747421eae0 100644 --- a/.evergreen/run-kerberos-tests.sh +++ b/.evergreen/run-kerberos-tests.sh @@ -23,12 +23,16 @@ echo "Running kinit" kinit -k -t "$(pwd)/.evergreen/drivers.keytab" -p ${KRB5_PRINCIPAL} set -o xtrace -npm install kerberos@">=2.0.0-beta.0" -npm run check:kerberos +if [ -z ${NODE_VERSION+omitted} ]; then echo "NODE_VERSION is unset" && exit 1; fi +NODE_MAJOR_VERSION=$(echo "$NODE_VERSION" | cut -d. -f1) +if [[ $NODE_MAJOR_VERSION -ge 12 ]]; then + npm install kerberos@">=2.0.0-beta.0" +else + npm install kerberos@"^1.1.7" +fi +set +o xtrace -npm install kerberos@"^1.1.7" npm run check:kerberos -set +o xtrace # destroy ticket kdestroy From 19ba8998d603781068c6a8d534d3825e24998bd2 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Thu, 14 Oct 2021 15:23:24 -0400 Subject: [PATCH 5/5] fix: add env variable --- .evergreen/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 32f96e9501..8aa647666a 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -206,7 +206,7 @@ functions: script: | KRB5_KEYTAB='${gssapi_auth_keytab_base64}' KRB5_PRINCIPAL='${gssapi_auth_principal}' \ MONGODB_URI='${gssapi_auth_mongodb_uri}' UNIFIED=${UNIFIED} \ - NODE_LTS_NAME='${NODE_LTS_NAME}' bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh + NODE_LTS_NAME='${NODE_LTS_NAME}' NODE_VERSION=${NODE_VERSION} bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh run ldap tests: - command: shell.exec type: test