Skip to content

Commit 805de7c

Browse files
committed
JAVA-2349: Add Evergreen configuration for testing the PLAIN authentication mechanism
1 parent 3a5175c commit 805de7c

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.evergreen/.evg.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,15 @@ functions:
216216
${PREPARE_SHELL}
217217
AUTH=${AUTH} SSL=${SSL} MONGODB_URI="${MONGODB_URI}" TOPOLOGY=${TOPOLOGY} JDK="${JDK}" .evergreen/run-tests.sh
218218
219+
"run plain auth test":
220+
- command: shell.exec
221+
type: test
222+
params:
223+
working_dir: "src"
224+
script: |
225+
${PREPARE_SHELL}
226+
JDK="jdk8" MONGODB_URI="${plain_auth_mongodb_uri}" .evergreen/run-plain-auth-test.sh
227+
219228
"publish snapshot":
220229
- command: shell.exec
221230
type: test
@@ -318,6 +327,13 @@ tasks:
318327
- func: "bootstrap mongo-orchestration"
319328
- func: "run tests"
320329

330+
- name: "plain-auth-test"
331+
depends_on:
332+
- variant: "static-checks"
333+
name: "static-analysis"
334+
commands:
335+
- func: "run plain auth test"
336+
321337
- name: publish-snapshot
322338
depends_on:
323339
- variant: ".tests-variant"
@@ -435,6 +451,13 @@ buildvariants:
435451
tasks:
436452
- name: "test"
437453

454+
- name: plain-auth-test
455+
display_name: "PLAIN (LDAP) Auth test"
456+
run_on:
457+
- rhel62-test
458+
tasks:
459+
- name: "plain-auth-test"
460+
438461
- name: publish-snapshot
439462
display_name: "Publish Snapshot"
440463
run_on:

.evergreen/run-plain-auth-test.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Don't trace since the URI contains a password that shouldn't show up in the logs
4+
set -o errexit # Exit the script with error if any of the commands fail
5+
6+
# Supported/used environment variables:
7+
# MONGODB_URI Set the URI, including username/password to use to connect to the server via PLAIN authentication mechanism
8+
# JDK Set the version of java to be used. Java versions can be set from the java toolchain /opt/java
9+
# "jdk5", "jdk6", "jdk7", "jdk8"
10+
11+
JDK=${JDK:-jdk}
12+
JAVA_HOME="/opt/java/${JDK}"
13+
14+
############################################
15+
# Main Program #
16+
############################################
17+
18+
echo "Running PLAIN authentication tests"
19+
20+
echo "Compiling java driver with jdk8"
21+
# We always compile with the latest version of java
22+
export JAVA_HOME="/opt/java/jdk8"
23+
./gradlew -version
24+
./gradlew --info classes testClasses
25+
26+
echo "Running tests with ${JDK}"
27+
JAVA_HOME="/opt/java/${JDK}"
28+
./gradlew -version
29+
./gradlew -Dorg.mongodb.test.uri=${MONGODB_URI} --stacktrace --info -Dtest.single=PlainAuthenticationSpecification -x classes -x testClasses --rerun-tasks driver-core:test

0 commit comments

Comments
 (0)