Skip to content

Commit afb9986

Browse files
committed
CDRIVER-4427 Test with consistent versions of crypt_shared and server. (#1119)
1 parent f0ca54c commit afb9986

File tree

8 files changed

+56
-52
lines changed

8 files changed

+56
-52
lines changed

.evergreen/compile-unix.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,6 @@ if [ "darwin" = "$OS" -a "arm64" = "$MARCH" ]; then
210210
fi
211211

212212
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DMONGO_SANITIZE=$SANITIZE"
213-
214-
if ! python3 build/mongodl.py --test -C crypt_shared -V 6.0.0-rc8 -o . > /dev/null; then
215-
echo "No crypt_shared detected for this platform. Disabling MONGOC_TEST_USE_CRYPT_SHARED."
216-
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DMONGOC_TEST_USE_CRYPT_SHARED=OFF"
217-
elif [ "$USE_CRYPT_SHARED" = "OFF" ]; then
218-
echo "Variant requested disabling csfle. Disabling MONGOC_TEST_USE_CRYPT_SHARED."
219-
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DMONGOC_TEST_USE_CRYPT_SHARED=OFF"
220-
fi
221-
222213
CONFIGURE_FLAGS="$CONFIGURE_FLAGS $EXTRA_CONFIGURE_FLAGS"
223214
export MONGOC_TEST_FUTURE_TIMEOUT_MS=30000
224215
export MONGOC_TEST_SKIP_LIVE=on

.evergreen/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ functions:
408408
export OCSP=${OCSP}
409409
export REQUIRE_API_VERSION=${REQUIRE_API_VERSION}
410410
sh .evergreen/integration-tests.sh
411+
- command: expansions.update
412+
params:
413+
file: mongoc/mo-expansion.yml
411414
run tests:
412415
- command: shell.exec
413416
type: test
@@ -448,6 +451,7 @@ functions:
448451
export LOADBALANCED=${LOADBALANCED}
449452
export SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}"
450453
export MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}"
454+
export CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH}"
451455
set -o errexit
452456
sh .evergreen/run-tests.sh
453457
run tests bson:

.evergreen/download-mongodb.sh

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ get_mongodb_download_url_for ()
5353
_VERSION=$2
5454

5555
# Set VERSION_RAPID to the latest rapid release each quarter.
56-
VERSION_RAPID="5.3.1"
56+
VERSION_RAPID="6.1.0"
5757
VERSION_60_LATEST="v6.0-latest"
58-
VERSION_60="6.0.0"
59-
VERSION_50="5.0.9"
60-
VERSION_44="4.4.15"
61-
VERSION_42="4.2.21"
58+
VERSION_60="6.0.2"
59+
VERSION_50="5.0.13"
60+
VERSION_44="4.4.17"
61+
VERSION_42="4.2.23"
6262
VERSION_40="4.0.28"
6363
VERSION_36="3.6.23"
6464
VERSION_34="3.4.24"
@@ -71,7 +71,23 @@ get_mongodb_download_url_for ()
7171
# getdata matrix on:
7272
# https://evergreen.mongodb.com/version/5797f0493ff12235e5001f05
7373
case "$_DISTRO" in
74-
darwin*)
74+
darwin--arm64)
75+
MONGODB_LATEST="http://downloads.10gen.com/osx/mongodb-macos-arm64-enterprise-latest.tgz"
76+
MONGODB_RAPID="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-${VERSION_RAPID}.tgz"
77+
MONGODB_60_LATEST="http://downloads.10gen.com/osx/mongodb-macos-arm64-enterprise-${VERSION_60_LATEST}.tgz"
78+
MONGODB_60="http://downloads.10gen.com/osx/mongodb-macos-arm64-enterprise-${VERSION_60}.tgz"
79+
MONGODB_50="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-${VERSION_50}.tgz"
80+
MONGODB_44="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-${VERSION_44}.tgz"
81+
MONGODB_42="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-${VERSION_42}.tgz"
82+
MONGODB_40="http://downloads.10gen.com/osx/mongodb-osx-x86_64-enterprise-${VERSION_40}.tgz"
83+
MONGODB_36="http://downloads.10gen.com/osx/mongodb-osx-x86_64-enterprise-${VERSION_36}.tgz"
84+
MONGODB_34="http://downloads.10gen.com/osx/mongodb-osx-x86_64-enterprise-${VERSION_34}.tgz"
85+
MONGODB_32="http://downloads.10gen.com/osx/mongodb-osx-x86_64-enterprise-${VERSION_32}.tgz"
86+
MONGODB_30="https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-${VERSION_30}.tgz"
87+
MONGODB_26="https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-${VERSION_26}.tgz"
88+
MONGODB_24="https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-${VERSION_24}.tgz"
89+
;;
90+
darwin--x86_64)
7591
MONGODB_LATEST="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-latest.tgz"
7692
MONGODB_RAPID="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-${VERSION_RAPID}.tgz"
7793
MONGODB_60_LATEST="http://downloads.10gen.com/osx/mongodb-macos-x86_64-enterprise-${VERSION_60_LATEST}.tgz"
@@ -128,6 +144,9 @@ get_mongodb_download_url_for ()
128144
MONGODB_60="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel80-${VERSION_60}.tgz"
129145
MONGODB_50="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel80-${VERSION_50}.tgz"
130146
MONGODB_44="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel80-${VERSION_44}.tgz"
147+
MONGODB_42="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel80-${VERSION_42}.tgz"
148+
MONGODB_40="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel80-${VERSION_40}.tgz"
149+
MONGODB_36="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-rhel80-${VERSION_36}.tgz"
131150
;;
132151
linux-rhel-7*-s390x)
133152
MONGODB_LATEST="http://downloads.10gen.com/linux/mongodb-linux-s390x-enterprise-rhel72-latest.tgz"
@@ -267,9 +286,7 @@ get_mongodb_download_url_for ()
267286
;;
268287
linux-debian-9*)
269288
MONGODB_LATEST="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-latest.tgz"
270-
MONGODB_RAPID="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-${VERSION_RAPID}.tgz"
271-
MONGODB_60_LATEST="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-${VERSION_60_LATEST}.tgz"
272-
MONGODB_60="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-${VERSION_60}.tgz"
289+
# SERVER-62308 Removed support for Debian 9 in server version 6.0.0-rc5.
273290
MONGODB_50="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-${VERSION_50}.tgz"
274291
MONGODB_44="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-${VERSION_44}.tgz"
275292
MONGODB_42="http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-debian92-${VERSION_42}.tgz"

.evergreen/integration-tests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,22 @@ echo $MONGO_SHELL_CONNECTION_FLAGS
183183

184184
`pwd`/mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.serverBuildInfo())' admin
185185
`pwd`/mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.isMaster())' admin
186+
187+
# Create mo-expansion.yml. expansions.update expects the file to exist.
188+
touch mo-expansion.yml
189+
190+
if [ -z "$MONGO_CRYPT_SHARED_DOWNLOAD_URL" ]; then
191+
echo "There is no crypt_shared library for distro='$DISTRO' and version='$MONGODB_VERSION'".
192+
else
193+
echo "Downloading crypt_shared package from $MONGO_CRYPT_SHARED_DOWNLOAD_URL"
194+
download_and_extract_crypt_shared "$MONGO_CRYPT_SHARED_DOWNLOAD_URL" "$EXTRACT" "CRYPT_SHARED_LIB_PATH"
195+
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
196+
if [ -z "$CRYPT_SHARED_LIB_PATH" ]; then
197+
echo "CRYPT_SHARED_LIB_PATH must be assigned, but wasn't" 1>&2 # write to stderr"
198+
exit 1
199+
fi
200+
cat >>mo-expansion.yml <<EOT
201+
CRYPT_SHARED_LIB_PATH: "$CRYPT_SHARED_LIB_PATH"
202+
EOT
203+
204+
fi

.evergreen/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ if [ "$CLIENT_SIDE_ENCRYPTION" = "on" ]; then
112112
echo "Waiting for mock KMS servers to start... done."
113113
if ! test -d /cygdrive/c; then
114114
# We have trouble with this test on Windows. only set cryptSharedLibPath on other platforms
115-
export MONGOC_TEST_CRYPT_SHARED_LIB_PATH="$(find . -wholename '*src/libmongoc/mongo_crypt_v1.*' -and -regex '.*\(.dll\|.dylib\|.so\)' | head -n1)"
115+
export MONGOC_TEST_CRYPT_SHARED_LIB_PATH="$CRYPT_SHARED_LIB_PATH"
116116
echo "Setting env cryptSharedLibPath: [$MONGOC_TEST_CRYPT_SHARED_LIB_PATH]"
117117
fi
118118
fi

build/evergreen_config_lib/functions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@
282282
export REQUIRE_API_VERSION=${REQUIRE_API_VERSION}
283283
sh .evergreen/integration-tests.sh
284284
''', test=False),
285+
OD([
286+
("command", "expansions.update"),
287+
("params", OD([("file", "mongoc/mo-expansion.yml")]))
288+
])
285289
)),
286290
('run tests', Function(
287291
shell_mongoc(r'''
@@ -320,6 +324,7 @@
320324
export LOADBALANCED=${LOADBALANCED}
321325
export SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}"
322326
export MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}"
327+
export CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH}"
323328
set -o errexit
324329
sh .evergreen/run-tests.sh
325330
'''),

mo-expansions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ooar

src/libmongoc/CMakeLists.txt

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -856,39 +856,6 @@ if (ENABLE_SHM_COUNTERS STREQUAL "ON")
856856
)
857857
endif ()
858858

859-
cmake_dependent_option (
860-
MONGOC_TEST_USE_CRYPT_SHARED "If TRUE, download and use a crypt_shared library for client-side-encryption testing. Otherwise will rely on mongocryptd"
861-
TRUE ENABLE_TESTS FALSE
862-
)
863-
864-
if (MONGOC_TEST_USE_CRYPT_SHARED)
865-
find_program (_PYTHON3_EXE NAMES python3 py python)
866-
mark_as_advanced (_PYTHON3_EXE)
867-
if (NOT _PYTHON3_EXE)
868-
message (SEND_ERROR
869-
"MONGOC_TEST_USE_CRYPT_SHARED is enabled, but we were unable to find a Python 3 interpreter to use mongodl.py. "
870-
"Install a Python 3 or set MONGOC_TEST_USE_CRYPT_SHARED to FALSE"
871-
)
872-
endif ()
873-
874-
get_filename_component (crypt_shared_dest "${CMAKE_CURRENT_BINARY_DIR}/mongo_crypt_v1${CMAKE_SHARED_LIBRARY_SUFFIX}" ABSOLUTE)
875-
# If updating the "--version" for crypt_shared, update the version in compile-unix.sh to match.
876-
add_custom_command (
877-
OUTPUT "${crypt_shared_dest}"
878-
COMMAND
879-
"${_PYTHON3_EXE}" -u "${mongo-c-driver_SOURCE_DIR}/build/mongodl.py"
880-
--component crypt_shared
881-
--version 6.0.0
882-
--edition enterprise
883-
--out "${CMAKE_CURRENT_BINARY_DIR}"
884-
--only "**/mongo_crypt_v1.*"
885-
--strip-path-components 1
886-
COMMENT "Downloading crypt_shared"
887-
VERBATIM
888-
)
889-
add_custom_target (get-crypt_shared ALL DEPENDS "${crypt_shared_dest}")
890-
endif ()
891-
892859
function (mongoc_add_test test use_shared)
893860
if (ENABLE_TESTS)
894861
add_executable (${test} ${ARGN})

0 commit comments

Comments
 (0)