Skip to content

Commit e2ae558

Browse files
committed
CDRIVER-2162 Automate Atlas connectivity tests
1 parent b402d86 commit e2ae558

File tree

3 files changed

+115
-150
lines changed

3 files changed

+115
-150
lines changed

.evergreen/compile-unix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ install_openssl () {
5252
./config --prefix=$INSTALL_DIR $SSL_EXTRA_FLAGS shared -fPIC
5353
cpus=$(grep -c '^processor' /proc/cpuinfo)
5454
make -j${cpus} || true
55-
make install_sw || true
55+
make install_sw install_ssldirs || true
5656
cd ..
5757

5858
# x505_vfy.h has issues in 1.1.0e

.evergreen/config.yml

Lines changed: 86 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ functions:
289289
silent: true
290290
working_dir: "mongoc"
291291
script: |
292-
AUTH_HOST='${auth_host}' AUTH_PLAIN='${auth_plain}' AUTH_MONGODBCR='${auth_mongodbcr}' AUTH_GSSAPI='${auth_gssapi}' AUTH_CROSSREALM='${auth_crossrealm}' AUTH_GSSAPI_UTF8='${auth_gssapi_utf8}' sh .evergreen/run-auth-tests.sh
292+
AUTH_HOST='${auth_host}' AUTH_PLAIN='${auth_plain}' AUTH_MONGODBCR='${auth_mongodbcr}' AUTH_GSSAPI='${auth_gssapi}' AUTH_CROSSREALM='${auth_crossrealm}' AUTH_GSSAPI_UTF8='${auth_gssapi_utf8}' ATLAS_FREE='${atlas_free}' ATLAS_REPLSET='${atlas_replset}' ATLAS_SHARD='${atlas_shard}' sh .evergreen/run-auth-tests.sh
293293
294294
"cleanup":
295295
- command: shell.exec
@@ -757,90 +757,6 @@ tasks:
757757
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl sh .evergreen/compile.sh
758758
- func: "upload build"
759759

760-
- name: debug-compile-nosasl-openssl-0.9.8
761-
commands:
762-
- command: shell.exec
763-
type: test
764-
params:
765-
working_dir: "mongoc"
766-
script: |
767-
set -o errexit
768-
set -o xtrace
769-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-0.9.8zh sh .evergreen/compile.sh
770-
- func: "upload build"
771-
772-
- name: debug-compile-nosasl-openssl-1.0.0
773-
commands:
774-
- command: shell.exec
775-
type: test
776-
params:
777-
working_dir: "mongoc"
778-
script: |
779-
set -o errexit
780-
set -o xtrace
781-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.0t sh .evergreen/compile.sh
782-
- func: "upload build"
783-
784-
- name: debug-compile-nosasl-openssl-1.0.1
785-
commands:
786-
- command: shell.exec
787-
type: test
788-
params:
789-
working_dir: "mongoc"
790-
script: |
791-
set -o errexit
792-
set -o xtrace
793-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.1u sh .evergreen/compile.sh
794-
- func: "upload build"
795-
796-
- name: debug-compile-nosasl-openssl-1.0.2
797-
commands:
798-
- command: shell.exec
799-
type: test
800-
params:
801-
working_dir: "mongoc"
802-
script: |
803-
set -o errexit
804-
set -o xtrace
805-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.2k sh .evergreen/compile.sh
806-
- func: "upload build"
807-
808-
- name: debug-compile-nosasl-openssl-1.1.0
809-
commands:
810-
- command: shell.exec
811-
type: test
812-
params:
813-
working_dir: "mongoc"
814-
script: |
815-
set -o errexit
816-
set -o xtrace
817-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.1.0e sh .evergreen/compile.sh
818-
- func: "upload build"
819-
820-
- name: debug-compile-nosasl-openssl-1.0.1-fips
821-
commands:
822-
- command: shell.exec
823-
type: test
824-
params:
825-
working_dir: "mongoc"
826-
script: |
827-
set -o errexit
828-
set -o xtrace
829-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.1u-fips sh .evergreen/compile.sh
830-
- func: "upload build"
831-
832-
- name: debug-compile-nosasl-libressl-2.5
833-
commands:
834-
- command: shell.exec
835-
type: test
836-
params:
837-
working_dir: "mongoc"
838-
script: |
839-
set -o errexit
840-
set -o xtrace
841-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=libressl-2.5.2 sh .evergreen/compile.sh
842-
- func: "upload build"
843-
844760
- name: debug-compile-nosasl-darwinssl
845761
tags: ["debug-compile", "nosasl", "darwinssl"]
846762
commands:
@@ -6336,88 +6252,116 @@ tasks:
63366252
BUILD_NAME: "debug-compile-nosasl-openssl"
63376253
- func: "run auth tests"
63386254

6339-
- name: authentication-tests-openssl-0.9.8
6255+
- name: authentication-tests-darwinssl
6256+
tags: ["authentication-tests", "nosasl", "ssl", "darwinssl"]
63406257
depends_on:
6341-
- name: "debug-compile-nosasl-openssl-0.9.8"
6258+
- name: "debug-compile-nosasl-darwinssl"
63426259
commands:
63436260
- func: "fetch build"
63446261
vars:
6345-
BUILD_NAME: "debug-compile-nosasl-openssl-0.9.8"
6262+
BUILD_NAME: "debug-compile-nosasl-darwinssl"
63466263
- func: "run auth tests"
63476264

6348-
- name: authentication-tests-openssl-1.0.0
6265+
- name: authentication-tests-winssl
6266+
tags: ["authentication-tests", "nosasl", "ssl", "winssl"]
63496267
depends_on:
6350-
- name: "debug-compile-nosasl-openssl-1.0.0"
6268+
- name: "debug-compile-nosasl-winssl"
63516269
commands:
63526270
- func: "fetch build"
63536271
vars:
6354-
BUILD_NAME: "debug-compile-nosasl-openssl-1.0.0"
6272+
BUILD_NAME: "debug-compile-nosasl-winssl"
63556273
- func: "run auth tests"
63566274

6357-
- name: authentication-tests-openssl-1.0.1
6358-
depends_on:
6359-
- name: "debug-compile-nosasl-openssl-1.0.1"
6275+
- name: build-and-run-authentication-tests-openssl-0.9.8
63606276
commands:
6361-
- func: "fetch build"
6362-
vars:
6363-
BUILD_NAME: "debug-compile-nosasl-openssl-1.0.1"
6277+
- command: shell.exec
6278+
type: test
6279+
params:
6280+
working_dir: "mongoc"
6281+
script: |
6282+
set -o errexit
6283+
set -o xtrace
6284+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-0.9.8zh sh .evergreen/compile.sh
63646285
- func: "run auth tests"
6286+
- func: "upload build"
63656287

6366-
- name: authentication-tests-openssl-1.0.2
6367-
depends_on:
6368-
- name: "debug-compile-nosasl-openssl-1.0.2"
6288+
- name: build-and-run-authentication-tests-openssl-1.0.0
63696289
commands:
6370-
- func: "fetch build"
6371-
vars:
6372-
BUILD_NAME: "debug-compile-nosasl-openssl-1.0.2"
6290+
- command: shell.exec
6291+
type: test
6292+
params:
6293+
working_dir: "mongoc"
6294+
script: |
6295+
set -o errexit
6296+
set -o xtrace
6297+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.0t sh .evergreen/compile.sh
63736298
- func: "run auth tests"
6299+
- func: "upload build"
63746300

6375-
- name: authentication-tests-openssl-1.1.0
6376-
depends_on:
6377-
- name: "debug-compile-nosasl-openssl-1.1.0"
6301+
- name: build-and-run-authentication-tests-openssl-1.0.1
63786302
commands:
6379-
- func: "fetch build"
6380-
vars:
6381-
BUILD_NAME: "debug-compile-nosasl-openssl-1.1.0"
6303+
- command: shell.exec
6304+
type: test
6305+
params:
6306+
working_dir: "mongoc"
6307+
script: |
6308+
set -o errexit
6309+
set -o xtrace
6310+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.1u sh .evergreen/compile.sh
63826311
- func: "run auth tests"
6312+
- func: "upload build"
63836313

6384-
- name: authentication-tests-openssl-1.0.1-fips
6385-
depends_on:
6386-
- name: "debug-compile-nosasl-openssl-1.0.1-fips"
6314+
- name: build-and-run-authentication-tests-openssl-1.0.2
63876315
commands:
6388-
- func: "fetch build"
6389-
vars:
6390-
BUILD_NAME: "debug-compile-nosasl-openssl-1.0.1-fips"
6316+
- command: shell.exec
6317+
type: test
6318+
params:
6319+
working_dir: "mongoc"
6320+
script: |
6321+
set -o errexit
6322+
set -o xtrace
6323+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.2k sh .evergreen/compile.sh
63916324
- func: "run auth tests"
6325+
- func: "upload build"
63926326

6393-
- name: authentication-tests-libressl-2.5
6394-
depends_on:
6395-
- name: "debug-compile-nosasl-libressl-2.5"
6327+
- name: build-and-run-authentication-tests-openssl-1.1.0
63966328
commands:
6397-
- func: "fetch build"
6398-
vars:
6399-
BUILD_NAME: "debug-compile-nosasl-libressl-2.5"
6329+
- command: shell.exec
6330+
type: test
6331+
params:
6332+
working_dir: "mongoc"
6333+
script: |
6334+
set -o errexit
6335+
set -o xtrace
6336+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.1.0e sh .evergreen/compile.sh
64006337
- func: "run auth tests"
6338+
- func: "upload build"
64016339

6402-
- name: authentication-tests-darwinssl
6403-
tags: ["authentication-tests", "nosasl", "ssl", "darwinssl"]
6404-
depends_on:
6405-
- name: "debug-compile-nosasl-darwinssl"
6340+
- name: build-and-run-authentication-tests-openssl-1.0.1-fips
64066341
commands:
6407-
- func: "fetch build"
6408-
vars:
6409-
BUILD_NAME: "debug-compile-nosasl-darwinssl"
6342+
- command: shell.exec
6343+
type: test
6344+
params:
6345+
working_dir: "mongoc"
6346+
script: |
6347+
set -o errexit
6348+
set -o xtrace
6349+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.1u-fips sh .evergreen/compile.sh
64106350
- func: "run auth tests"
6351+
- func: "upload build"
64116352

6412-
- name: authentication-tests-winssl
6413-
tags: ["authentication-tests", "nosasl", "ssl", "winssl"]
6414-
depends_on:
6415-
- name: "debug-compile-nosasl-winssl"
6353+
- name: build-and-run-authentication-tests-libressl-2.5
64166354
commands:
6417-
- func: "fetch build"
6418-
vars:
6419-
BUILD_NAME: "debug-compile-nosasl-winssl"
6355+
- command: shell.exec
6356+
type: test
6357+
params:
6358+
working_dir: "mongoc"
6359+
script: |
6360+
set -o errexit
6361+
set -o xtrace
6362+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=libressl-2.5.2 sh .evergreen/compile.sh
64206363
- func: "run auth tests"
6364+
- func: "upload build"
64216365

64226366
# }}}
64236367

@@ -6510,20 +6454,13 @@ buildvariants:
65106454
- archlinux-build
65116455
- archlinux-test
65126456
tasks:
6513-
- "debug-compile-nosasl-openssl-0.9.8"
6514-
- "debug-compile-nosasl-openssl-1.0.0"
6515-
- "debug-compile-nosasl-openssl-1.0.1"
6516-
- "debug-compile-nosasl-openssl-1.0.2"
6517-
- "debug-compile-nosasl-openssl-1.1.0"
6518-
- "debug-compile-nosasl-openssl-1.0.1-fips"
6519-
- "debug-compile-nosasl-libressl-2.5"
6520-
- "authentication-tests-openssl-0.9.8"
6521-
- "authentication-tests-openssl-1.0.0"
6522-
- "authentication-tests-openssl-1.0.1"
6523-
- "authentication-tests-openssl-1.0.2"
6524-
- "authentication-tests-openssl-1.1.0"
6525-
- "authentication-tests-openssl-1.0.1-fips"
6526-
- "authentication-tests-libressl-2.5"
6457+
- "build-and-run-authentication-tests-openssl-0.9.8"
6458+
- "build-and-run-authentication-tests-openssl-1.0.0"
6459+
- "build-and-run-authentication-tests-openssl-1.0.1"
6460+
- "build-and-run-authentication-tests-openssl-1.0.2"
6461+
- "build-and-run-authentication-tests-openssl-1.1.0"
6462+
- "build-and-run-authentication-tests-openssl-1.0.1-fips"
6463+
- "build-and-run-authentication-tests-libressl-2.5"
65276464

65286465

65296466
- name: clang37

.evergreen/run-auth-tests.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ set -o errexit # Exit the script with error if any of the commands fail
66
# AUTH_GSSAPI=${auth_gssapi} # Evergreen variable
77
# AUTH_CROSSREALM=${auth_crossrealm} # Evergreen variable
88
# AUTH_GSSAPI_UTF8=${auth_gssapi_utf8} # Evergreen variable
9+
# ATLAS_FREE=${atlas_free} # Evergreen variable
10+
# ATLAS_REPLSET=${atlas_replset} # Evergreen variable
11+
# ATLAS_SHARD=${atlas_shard} # Evergreen variable
912

1013

1114
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
@@ -50,23 +53,48 @@ esac
5053
if test -f /tmp/drivers.keytab; then
5154
kinit -k -t /tmp/drivers.keytab -p [email protected] || true
5255
fi
56+
57+
# Archlinux (which we use for testing various self-installed OpenSSL versions)
58+
# Stores their trust list here. We need to copy it to our custom installed
59+
# OpenSSL trust store.
60+
# LibreSSL bundle their own trust store (in install-dir/etc/ssl/cert.pem)
61+
cp /etc/ca-certificates/extracted/tls-ca-bundle.pem install-dir/ssl/cert.pem || true
62+
# OpenSSL fips enabled path
63+
cp /etc/ca-certificates/extracted/tls-ca-bundle.pem install-dir/cert.pem || true
64+
# Solaris CSW OpenSSL install need to copy the OS trust store
65+
sudo mkdir -p /etc/opt/csw/ssl/ || true
66+
sudo cp /etc/ssl/cert.pem /etc/opt/csw/ssl/ || true
67+
5368
export PATH=install-dir/bin:$PATH
5469
openssl version || true
5570

5671
if [ $SSL -eq 1 ]; then
5772
# FIXME: CDRIVER-2008
5873
if [ "${OS%_*}" != "cygwin" ]; then
74+
echo "Authenticating using X.509"
5975
$PING "mongodb://CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US@${AUTH_HOST}/?ssl=true&authMechanism=MONGODB-X509&sslClientCertificateKeyFile=./tests/x509gen/legacy-x509.pem&sslCertificateAuthorityFile=tests/x509gen/legacy-ca.crt&sslAllowInvalidHostnames=true"
6076
fi
77+
echo "Connecting to Atlas Free Tier"
78+
$PING "$ATLAS_FREE"
79+
echo "Connecting to Atlas Replica Set"
80+
$PING "$ATLAS_REPLSET"
81+
echo "Connecting to Atlas Sharded Cluster"
82+
$PING "$ATLAS_SHARD"
6183
fi
6284

85+
echo "Authenticating using PLAIN"
6386
$PING "mongodb://${AUTH_PLAIN}@${AUTH_HOST}/?authMechanism=PLAIN"
87+
88+
echo "Authenticating using MONGODB-CR"
6489
$PING "mongodb://${AUTH_MONGODBCR}@${AUTH_HOST}/mongodb-cr?authMechanism=MONGODB-CR"
6590

6691
if [ $SASL -eq 1 ]; then
92+
echo "Authenticating using GSSAPI"
6793
$PING "mongodb://${AUTH_GSSAPI}@${AUTH_HOST}/?authMechanism=GSSAPI"
6894
if [ "${OS%_*}" = "cygwin" ]; then
95+
echo "Authenticating using GSSAPI (service realm: LDAPTEST.10GEN.CC)"
6996
$PING "mongodb://${AUTH_CROSSREALM}@${AUTH_HOST}/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_REALM:LDAPTEST.10GEN.CC"
97+
echo "Authenticating using GSSAPI (UTF-8 credentials)"
7098
$PING "mongodb://${AUTH_GSSAPI_UTF8}@${AUTH_HOST}/?authMechanism=GSSAPI"
7199
fi
72100
fi

0 commit comments

Comments
 (0)