Skip to content

Commit 324ed17

Browse files
authored
DRIVERS-3119 Add options to provide certificate and CA files (mongodb#2159)
1 parent 2b667df commit 324ed17

File tree

4 files changed

+41
-53
lines changed

4 files changed

+41
-53
lines changed

.evergreen/scripts/bootstrap-mongo-orchestration.sh

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,21 @@
22

33
set -eu
44

5-
6-
# Enable core dumps if enabled on the machine
7-
# Copied from https://github.com/mongodb/mongo/blob/master/etc/evergreen.yml
8-
if [ -f /proc/self/coredump_filter ]; then
9-
# Set the shell process (and its children processes) to dump ELF headers (bit 4),
10-
# anonymous shared mappings (bit 1), and anonymous private mappings (bit 0).
11-
echo 0x13 >/proc/self/coredump_filter
12-
13-
if [ -f /sbin/sysctl ]; then
14-
# Check that the core pattern is set explicitly on our distro image instead
15-
# of being the OS's default value. This ensures that coredump names are consistent
16-
# across distros and can be picked up by Evergreen.
17-
core_pattern=$(/sbin/sysctl -n "kernel.core_pattern")
18-
if [ "$core_pattern" = "dump_%e.%p.core" ]; then
19-
echo "Enabling coredumps"
20-
ulimit -c unlimited
21-
fi
22-
fi
23-
fi
24-
25-
if [ "$(uname -s)" = "Darwin" ]; then
26-
core_pattern_mac=$(/usr/sbin/sysctl -n "kern.corefile")
27-
if [ "$core_pattern_mac" = "dump_%N.%P.core" ]; then
28-
echo "Enabling coredumps"
29-
ulimit -c unlimited
30-
fi
31-
fi
5+
HERE=$(dirname ${BASH_SOURCE:-$0})
6+
HERE="$( cd -- "$HERE" > /dev/null 2>&1 && pwd )"
7+
ROOT=$(dirname "$(dirname $HERE)")
328

339
if [ -z "${TEST_CRYPT_SHARED:-}" ]; then
3410
export SKIP_CRYPT_SHARED=1
3511
fi
3612

13+
# Override the tls files if applicable.
14+
if [ "${SSL:-}" == "ssl" ]; then
15+
export TLS_CERT_KEY_FILE=${ROOT}/test/certificates/client.pem
16+
export TLS_PEM_KEY_FILE=${ROOT}/test/certificates/server.pem
17+
export TLS_CA_FILE=${ROOT}/test/certificates/ca.pem
18+
fi
19+
3720
MONGODB_VERSION=${VERSION:-} \
3821
TOPOLOGY=${TOPOLOGY:-} \
3922
AUTH=${AUTH:-} \

.evergreen/scripts/configure-env.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ EOT
7676

7777
# Write the .env file for drivers-tools.
7878
rm -rf $DRIVERS_TOOLS
79-
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
79+
BRANCH=master
80+
ORG=mongodb-labs
81+
git clone --branch $BRANCH https://github.com/$ORG/drivers-evergreen-tools.git $DRIVERS_TOOLS
8082

8183
cat <<EOT > ${DRIVERS_TOOLS}/.env
8284
SKIP_LEGACY_SHELL=1

.evergreen/scripts/prepare-resources.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

.evergreen/scripts/setup-system.sh

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,35 @@ pushd "$(dirname "$(dirname $HERE)")"
77
echo "Setting up system..."
88
bash .evergreen/scripts/configure-env.sh
99
source .evergreen/scripts/env.sh
10-
bash .evergreen/scripts/prepare-resources.sh
1110
bash $DRIVERS_TOOLS/.evergreen/setup.sh
1211
bash .evergreen/scripts/install-dependencies.sh
1312
popd
13+
14+
# Enable core dumps if enabled on the machine
15+
# Copied from https://github.com/mongodb/mongo/blob/master/etc/evergreen.yml
16+
if [ -f /proc/self/coredump_filter ]; then
17+
# Set the shell process (and its children processes) to dump ELF headers (bit 4),
18+
# anonymous shared mappings (bit 1), and anonymous private mappings (bit 0).
19+
echo 0x13 >/proc/self/coredump_filter
20+
21+
if [ -f /sbin/sysctl ]; then
22+
# Check that the core pattern is set explicitly on our distro image instead
23+
# of being the OS's default value. This ensures that coredump names are consistent
24+
# across distros and can be picked up by Evergreen.
25+
core_pattern=$(/sbin/sysctl -n "kernel.core_pattern")
26+
if [ "$core_pattern" = "dump_%e.%p.core" ]; then
27+
echo "Enabling coredumps"
28+
ulimit -c unlimited
29+
fi
30+
fi
31+
fi
32+
33+
if [ "$(uname -s)" = "Darwin" ]; then
34+
core_pattern_mac=$(/usr/sbin/sysctl -n "kern.corefile")
35+
if [ "$core_pattern_mac" = "dump_%N.%P.core" ]; then
36+
echo "Enabling coredumps"
37+
ulimit -c unlimited
38+
fi
39+
fi
40+
1441
echo "Setting up system... done."

0 commit comments

Comments
 (0)