Skip to content

Commit a4c90ae

Browse files
authored
PYTHON-3466 Test crypt_shared with older server versions (#1133)
1 parent eaea70b commit a4c90ae

File tree

2 files changed

+8
-51
lines changed

2 files changed

+8
-51
lines changed

.evergreen/config.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ functions:
452452
fi
453453
if [ -n "${test_crypt_shared}" ]; then
454454
export TEST_CRYPT_SHARED=1
455+
export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH}
455456
fi
456457
if [ -n "${test_pyopenssl}" ]; then
457458
export TEST_PYOPENSSL=1
@@ -2497,6 +2498,7 @@ axes:
24972498
variables:
24982499
test_encryption: true
24992500
batchtime: 10080 # 7 days
2501+
# The path to crypt_shared is stored in the $CRYPT_SHARED_LIB_PATH expansion.
25002502
- id: "encryption_crypt_shared"
25012503
display_name: "Encryption shared lib"
25022504
tags: ["encryption_tag"]
@@ -2634,19 +2636,6 @@ buildvariants:
26342636
- ".4.4"
26352637
- ".4.2"
26362638
- ".4.0"
2637-
rules: &encryption-exclude-rules
2638-
- if:
2639-
platform: "*"
2640-
auth: "*"
2641-
ssl: "*"
2642-
encryption: [ "encryption_crypt_shared" ]
2643-
then:
2644-
remove_tasks:
2645-
- ".rapid"
2646-
- ".5.0"
2647-
- ".4.4"
2648-
- ".4.2"
2649-
- ".4.0"
26502639

26512640
# Test one server version with zSeries, POWER8, and ARM.
26522641
- matrix_name: "test-different-cpu-architectures"
@@ -2729,19 +2718,6 @@ buildvariants:
27292718
encryption: "*"
27302719
display_name: "${encryption} ${python-version} ${platform} ${auth-ssl}"
27312720
tasks: *encryption-server-versions
2732-
rules:
2733-
- if:
2734-
platform: "*"
2735-
python-version: "*"
2736-
auth-ssl: "*"
2737-
encryption: [ "encryption_crypt_shared" ]
2738-
then:
2739-
remove_tasks:
2740-
- ".rapid"
2741-
- ".5.0"
2742-
- ".4.4"
2743-
- ".4.2"
2744-
- ".4.0"
27452721

27462722

27472723
- matrix_name: "tests-python-version-ubuntu18-without-c-extensions"
@@ -2853,19 +2829,6 @@ buildvariants:
28532829
encryption: "*"
28542830
display_name: "${encryption} ${platform} ${python-version-windows} ${auth-ssl}"
28552831
tasks: *encryption-server-versions
2856-
rules:
2857-
- if:
2858-
platform: "*"
2859-
python-version-windows: "*"
2860-
auth-ssl: "*"
2861-
encryption: [ "encryption_crypt_shared" ]
2862-
then:
2863-
remove_tasks:
2864-
- ".rapid"
2865-
- ".5.0"
2866-
- ".4.4"
2867-
- ".4.2"
2868-
- ".4.0"
28692832

28702833
# Storage engine tests on Ubuntu 18.04 (x86_64) with Python 3.7.
28712834
- matrix_name: "tests-storage-engines"

.evergreen/run-tests.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COMPRESSORS=${COMPRESSORS:-}
2929
MONGODB_VERSION=${MONGODB_VERSION:-}
3030
MONGODB_API_VERSION=${MONGODB_API_VERSION:-}
3131
TEST_ENCRYPTION=${TEST_ENCRYPTION:-}
32-
TEST_CRYPT_SHARED=${TEST_CRYPT_SHARED:-}
32+
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH:-}
3333
LIBMONGOCRYPT_URL=${LIBMONGOCRYPT_URL:-}
3434
DATA_LAKE=${DATA_LAKE:-}
3535
TEST_ARGS=""
@@ -158,17 +158,11 @@ if [ -n "$TEST_ENCRYPTION" ]; then
158158
. $DRIVERS_TOOLS/.evergreen/csfle/set-temp-creds.sh
159159

160160
if [ -n "$TEST_CRYPT_SHARED" ]; then
161-
REAL_VERSION=$(mongod --version | head -n1 | cut -d v -f3 | tr -d "\r")
162-
if [ "$MONGODB_VERSION" = "latest" ]; then
163-
REAL_VERSION="latest"
164-
fi
165-
echo "Testing CSFLE with crypt_shared lib"
166-
$PYTHON $DRIVERS_TOOLS/.evergreen/mongodl.py --component crypt_shared \
167-
--version "$REAL_VERSION" \
168-
--out ../crypt_shared/
169-
export DYLD_FALLBACK_LIBRARY_PATH=../crypt_shared/lib/:$DYLD_FALLBACK_LIBRARY_PATH
170-
export LD_LIBRARY_PATH=../crypt_shared/lib:$LD_LIBRARY_PATH
171-
export PATH=../crypt_shared/bin:$PATH
161+
CRYPT_SHARED_DIR=`dirname $CRYPT_SHARED_LIB_PATH`
162+
echo "using crypt_shared_dir $CRYPT_SHARED_DIR"
163+
export DYLD_FALLBACK_LIBRARY_PATH=$CRYPT_SHARED_DIR:$DYLD_FALLBACK_LIBRARY_PATH
164+
export LD_LIBRARY_PATH=$CRYPT_SHARED_DIR:$LD_LIBRARY_PATH
165+
export PATH=$CRYPT_SHARED_DIR:$PATH
172166
fi
173167
# Only run the encryption tests.
174168
TEST_ARGS="-s test.test_encryption"

0 commit comments

Comments
 (0)