Skip to content

Commit 36df177

Browse files
authored
CDRIVER-4398 use matching db for mongocryptd command (#1020)
1 parent db7e894 commit 36df177

File tree

5 files changed

+131
-81
lines changed

5 files changed

+131
-81
lines changed

.evergreen/compile-unix.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DMONGO_SANITIZE=$SANITIZE"
206206
if ! python3 build/mongodl.py --test -C crypt_shared -V 6.0.0-rc8 -o . > /dev/null; then
207207
echo "No crypt_shared detected for this platform. Disabling MONGOC_TEST_USE_CRYPT_SHARED."
208208
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DMONGOC_TEST_USE_CRYPT_SHARED=OFF"
209+
elif [ "$USE_CRYPT_SHARED" = "OFF" ]; then
210+
echo "Variant requested disabling csfle. Disabling MONGOC_TEST_USE_CRYPT_SHARED."
211+
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DMONGOC_TEST_USE_CRYPT_SHARED=OFF"
209212
fi
210213

211214
CONFIGURE_FLAGS="$CONFIGURE_FLAGS $EXTRA_CONFIGURE_FLAGS"

.evergreen/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,7 @@ tasks:
18671867
export SASL="AUTO"
18681868
export SKIP_MOCK_TESTS="ON"
18691869
export SSL="OPENSSL"
1870+
export USE_CRYPT_SHARED="${USE_CRYPT_SHARED}"
18701871
CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh
18711872
rm CMakeCache.txt
18721873
set -o errexit
@@ -1899,6 +1900,7 @@ tasks:
18991900
export SASL="AUTO"
19001901
export SKIP_MOCK_TESTS="ON"
19011902
export SSL="OPENSSL_STATIC"
1903+
export USE_CRYPT_SHARED="${USE_CRYPT_SHARED}"
19021904
CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh
19031905
rm CMakeCache.txt
19041906
set -o errexit
@@ -1931,6 +1933,7 @@ tasks:
19311933
export SASL="AUTO"
19321934
export SKIP_MOCK_TESTS="ON"
19331935
export SSL="DARWIN"
1936+
export USE_CRYPT_SHARED="${USE_CRYPT_SHARED}"
19341937
CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh
19351938
rm CMakeCache.txt
19361939
set -o errexit
@@ -1963,6 +1966,7 @@ tasks:
19631966
export SASL="AUTO"
19641967
export SKIP_MOCK_TESTS="ON"
19651968
export SSL="WINDOWS"
1969+
export USE_CRYPT_SHARED="${USE_CRYPT_SHARED}"
19661970
CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh
19671971
rm CMakeCache.txt
19681972
set -o errexit
@@ -1995,6 +1999,7 @@ tasks:
19951999
export SANITIZE="address"
19962000
export SKIP_MOCK_TESTS="ON"
19972001
export SSL="OPENSSL"
2002+
export USE_CRYPT_SHARED="${USE_CRYPT_SHARED}"
19982003
CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh
19992004
rm CMakeCache.txt
20002005
set -o errexit
@@ -24674,6 +24679,16 @@ buildvariants:
2467424679
- .debug-compile .asan-clang
2467524680
- .test-asan !.3.6
2467624681
batchtime: 1440
24682+
- name: asan-ubuntu-without-csfle
24683+
display_name: ASAN Tests without csfle (Ubuntu 18.04)
24684+
expansions:
24685+
CC: clang
24686+
USE_CRYPT_SHARED: 'OFF'
24687+
run_on: ubuntu1804-test
24688+
tasks:
24689+
- debug-compile-asan-openssl-cse
24690+
- .test-asan !.3.6 .client-side-encryption
24691+
batchtime: 1440
2467724692
- name: asan-ubuntu-ubuntu1604
2467824693
display_name: ASAN Tests (Ubuntu 16.04)
2467924694
expansions:

build/evergreen_config_lib/tasks.py

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def __init__(self, *args, **kwargs):
112112
extra_script=extra_script,
113113
EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF",
114114
SKIP_MOCK_TESTS="ON",
115+
USE_CRYPT_SHARED="${USE_CRYPT_SHARED}",
115116
**kwargs)
116117
self.add_tags('client-side-encryption', 'special')
117118

@@ -134,10 +135,12 @@ def __init__(self, *args, **kwargs):
134135
CFLAGS="-fno-omit-frame-pointer",
135136
extra_script=extra_script,
136137
CHECK_LOG="ON",
137-
sanitize=['address'],
138+
sanitize=[
139+
'address'],
138140
EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF -DENABLE_EXTRA_ALIGNMENT=OFF",
139141
PATH='/usr/lib/llvm-3.8/bin:$PATH',
140142
SKIP_MOCK_TESTS="ON",
143+
USE_CRYPT_SHARED="${USE_CRYPT_SHARED}",
141144
**kwargs)
142145
self.add_tags('client-side-encryption')
143146

@@ -456,19 +459,23 @@ def __init__(self, task_name, suffix_commands, orchestration=True, **kwargs):
456459
('bucket', 'mongo-c-toolchain'),
457460
('local_file', 'mongo-c-toolchain.tar.gz'),
458461
]))]),
459-
shell_mongoc('sh ./.evergreen/build-and-test-with-toolchain.sh')
460-
])
462+
shell_mongoc(
463+
'sh ./.evergreen/build-and-test-with-toolchain.sh')
464+
])
461465
]
462466

467+
463468
class IntegrationTask(MatrixTask):
464469
axes = OD([('valgrind', ['valgrind', False]),
465470
('sanitizer', ['asan', 'tsan', False]),
466471
('coverage', ['coverage', False]),
467-
('version', ['latest', '6.0', '5.0', '4.4', '4.2', '4.0', '3.6']),
472+
('version', ['latest', '6.0', '5.0',
473+
'4.4', '4.2', '4.0', '3.6']),
468474
('topology', ['server', 'replica_set', 'sharded_cluster']),
469475
('auth', [True, False]),
470476
('sasl', ['sasl', 'sspi', False]),
471-
('ssl', ['openssl', 'openssl-static', 'darwinssl', 'winssl', False]),
477+
('ssl', ['openssl', 'openssl-static',
478+
'darwinssl', 'winssl', False]),
472479
('cse', [True, False])])
473480

474481
def __init__(self, *args, **kwargs):
@@ -562,12 +569,12 @@ def to_dict(self):
562569

563570
def _check_allowed(self):
564571
if self.sanitizer == 'tsan':
565-
require (self.ssl == 'openssl')
566-
prohibit (self.sasl)
567-
prohibit (self.valgrind)
568-
prohibit (self.coverage)
569-
prohibit (self.cse)
570-
prohibit (self.version == "3.0")
572+
require(self.ssl == 'openssl')
573+
prohibit(self.sasl)
574+
prohibit(self.valgrind)
575+
prohibit(self.coverage)
576+
prohibit(self.cse)
577+
prohibit(self.version == "3.0")
571578

572579
if self.valgrind:
573580
prohibit(self.cse)
@@ -613,7 +620,8 @@ def _check_allowed(self):
613620
prohibit(self.ssl)
614621

615622
if self.cse:
616-
require(self.version == 'latest' or parse_version(self.version) >= parse_version("4.2"))
623+
require(self.version == 'latest' or parse_version(
624+
self.version) >= parse_version("4.2"))
617625
if self.version == 'latest' or parse_version(self.version) >= parse_version("6.0"):
618626
# FLE 2.0 Client-Side Encryption tasks on 6.0 require a non-standalone topology.
619627
require(self.topology in ('server', 'replica_set'))
@@ -668,8 +676,9 @@ def to_dict(self):
668676
dns = 'on'
669677
if self.loadbalanced:
670678
dns = 'loadbalanced'
671-
commands.append (func("clone drivers-evergreen-tools"))
672-
commands.append (func("start load balancer", MONGODB_URI="mongodb://localhost:27017,localhost:27018"))
679+
commands.append(func("clone drivers-evergreen-tools"))
680+
commands.append(func(
681+
"start load balancer", MONGODB_URI="mongodb://localhost:27017,localhost:27018"))
673682
elif self.auth:
674683
dns = 'dns-auth'
675684
commands.append(run_tests(SSL='ssl',
@@ -679,9 +688,9 @@ def to_dict(self):
679688
return task
680689

681690
def _check_allowed(self):
682-
prohibit (self.loadbalanced and self.auth)
691+
prohibit(self.loadbalanced and self.auth)
683692
# Load balancer tests only run on some Linux hosts in Evergreen until CDRIVER-4041 is resolved.
684-
prohibit (self.loadbalanced and self.ssl in ["darwinssl", "winssl"])
693+
prohibit(self.loadbalanced and self.ssl in ["darwinssl", "winssl"])
685694

686695

687696
all_tasks = chain(all_tasks, DNSTask.matrix())
@@ -920,7 +929,8 @@ def name(self):
920929
SSLTask('openssl-1.0.2', 'l'),
921930
SSLTask('openssl-1.1.0', 'f'),
922931
SSLTask('libressl-2.5', '.2', require_tls12=True),
923-
SSLTask('libressl-3.0', '.2', require_tls12=True, enable_ssl="AUTO", cflags="-Wno-redundant-decls"),
932+
SSLTask('libressl-3.0', '.2', require_tls12=True,
933+
enable_ssl="AUTO", cflags="-Wno-redundant-decls"),
924934
SSLTask('libressl-3.0', '.2', require_tls12=True),
925935
])
926936

@@ -986,7 +996,8 @@ def __init__(self, *args, **kwargs):
986996
self.add_dependency('debug-compile-aws')
987997
self.commands.extend([
988998
func('fetch build', BUILD_NAME=self.depends_on['name']),
989-
bootstrap(AUTH="auth", ORCHESTRATION_FILE="auth-aws", VERSION=self.version, TOPOLOGY="server"),
999+
bootstrap(AUTH="auth", ORCHESTRATION_FILE="auth-aws",
1000+
VERSION=self.version, TOPOLOGY="server"),
9901001
func('run aws tests', TESTCASE=self.testcase.upper())])
9911002

9921003
@property
@@ -1030,26 +1041,28 @@ def to_dict(self):
10301041
stapling = 'mustStaple-disableStapling'
10311042

10321043
orchestration_file = '%s-basic-tls-ocsp-%s' % (self.cert, stapling)
1033-
orchestration = bootstrap(VERSION=self.version, TOPOLOGY='server', SSL='ssl', OCSP='on', ORCHESTRATION_FILE=orchestration_file)
1044+
orchestration = bootstrap(VERSION=self.version, TOPOLOGY='server',
1045+
SSL='ssl', OCSP='on', ORCHESTRATION_FILE=orchestration_file)
10341046

10351047
# The cache test expects a revoked response from an OCSP responder, exactly like TEST_4.
10361048
test_column = 'TEST_4' if self.test == 'cache' else self.test.upper()
10371049

10381050
commands.append(shell_mongoc(
10391051
'TEST_COLUMN=%s CERT_TYPE=%s USE_DELEGATE=%s sh .evergreen/run-ocsp-responder.sh' % (
1040-
test_column, self.cert, 'on' if self.delegate == 'delegate' else 'off')))
1052+
test_column, self.cert, 'on' if self.delegate == 'delegate' else 'off')))
10411053
commands.append(orchestration)
10421054
if self.depends_on['name'] == 'debug-compile-nosasl-openssl-1.0.1':
10431055
# LD_LIBRARY_PATH is needed so the in-tree OpenSSL 1.0.1 is found at runtime
10441056
if self.test == 'cache':
10451057
commands.append(shell_mongoc('export LD_LIBRARY_PATH=$(pwd)/install-dir/lib\n'
1046-
'CERT_TYPE=%s .evergreen/run-ocsp-cache-test.sh' % self.cert))
1058+
'CERT_TYPE=%s .evergreen/run-ocsp-cache-test.sh' % self.cert))
10471059
else:
10481060
commands.append(shell_mongoc('export LD_LIBRARY_PATH=$(pwd)/install-dir/lib\n'
1049-
'TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' % (self.test.upper(), self.cert)))
1061+
'TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' % (self.test.upper(), self.cert)))
10501062
else:
10511063
if self.test == 'cache':
1052-
commands.append(shell_mongoc('CERT_TYPE=%s .evergreen/run-ocsp-cache-test.sh' % self.cert))
1064+
commands.append(shell_mongoc(
1065+
'CERT_TYPE=%s .evergreen/run-ocsp-cache-test.sh' % self.cert))
10531066
else:
10541067
commands.append(shell_mongoc(
10551068
'TEST_COLUMN=%s CERT_TYPE=%s sh .evergreen/run-ocsp-test.sh' % (self.test.upper(), self.cert)))
@@ -1076,26 +1089,30 @@ def _check_allowed(self):
10761089

10771090
all_tasks = chain(all_tasks, OCSPTask.matrix())
10781091

1092+
10791093
class LoadBalancedTask(MatrixTask):
10801094
axes = OD([
10811095
('asan', [True]),
1082-
('build_ssl', ['openssl']), # The SSL library the C driver is built with.
1083-
('test_ssl', [True, False]), # Whether tests are run with SSL connections.
1096+
# The SSL library the C driver is built with.
1097+
('build_ssl', ['openssl']),
1098+
# Whether tests are run with SSL connections.
1099+
('test_ssl', [True, False]),
10841100
('test_auth', [True, False]),
10851101
('version', ['5.0', 'latest'])
10861102
])
10871103

1088-
def _check_allowed (self):
1104+
def _check_allowed(self):
10891105
# Test with both SSL and auth, or neither.
1090-
prohibit (self.test_ssl != self.test_auth)
1106+
prohibit(self.test_ssl != self.test_auth)
10911107

10921108
def __init__(self, *args, **kwargs):
10931109
super(LoadBalancedTask, self).__init__(*args, **kwargs)
10941110
if self.asan and self.build_ssl == "openssl":
1095-
self.add_dependency ('debug-compile-asan-clang-openssl')
1111+
self.add_dependency('debug-compile-asan-clang-openssl')
10961112
self.add_tags('test-asan')
10971113
else:
1098-
raise RuntimeError ("unimplemented configuration for LoadBalancedTask")
1114+
raise RuntimeError(
1115+
"unimplemented configuration for LoadBalancedTask")
10991116

11001117
self.add_tags(self.version)
11011118
self.options['exec_timeout_secs'] = 3600
@@ -1125,22 +1142,22 @@ def to_dict(self):
11251142
commands.append(
11261143
func('fetch build', BUILD_NAME=self.depends_on['name']))
11271144

1128-
11291145
orchestration = bootstrap(TOPOLOGY='sharded_cluster',
11301146
AUTH='auth' if self.test_auth else 'noauth',
11311147
SSL='ssl' if self.test_ssl else 'nossl',
11321148
VERSION=self.version)
11331149
commands.append(orchestration)
1134-
commands.append (func("clone drivers-evergreen-tools"))
1135-
commands.append (func("start load balancer",
1136-
MONGODB_URI="mongodb://localhost:27017,localhost:27018"))
1150+
commands.append(func("clone drivers-evergreen-tools"))
1151+
commands.append(func("start load balancer",
1152+
MONGODB_URI="mongodb://localhost:27017,localhost:27018"))
11371153
commands.append(run_tests(ASAN='on' if self.asan else 'off',
11381154
SSL='ssl' if self.test_ssl else 'nossl',
11391155
AUTH='auth' if self.test_auth else 'noauth',
11401156
LOADBALANCED='loadbalanced'))
11411157

11421158
return task
11431159

1160+
11441161
all_tasks = chain(all_tasks, LoadBalancedTask.matrix())
11451162

11461163
all_tasks = list(all_tasks)

0 commit comments

Comments
 (0)