Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/connectivity-tests/test/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export TEST_TMPDIR="$PWD"
git clone git@github.com:mongodb-js/devtools-docker-test-envs.git test-envs
cd test-envs

git checkout fb075fd36a834bcd8a1695aeef691e766ca6bba6
git checkout f029f9e3a9cc006a6aeb60d941b4f8d87ae4bc95

source "$CONNECTIVITY_TEST_SOURCE_DIR/ldap.sh"
source "$CONNECTIVITY_TEST_SOURCE_DIR/localhost.sh"
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity-tests/test/kerberos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -x

FAILED=no
docker-compose \
-f "$TEST_TMPDIR/test-envs/kerberos/docker-compose.yaml" \
-f "$TEST_TMPDIR/test-envs/docker/kerberos/docker-compose.yaml" \
-f "$CONNECTIVITY_TEST_SOURCE_DIR/kerberos/docker-compose.kerberos.yaml" \
--no-ansi \
up --exit-code-from kerberos_jumphost --abort-on-container-exit || FAILED=yes

docker-compose \
-f "$TEST_TMPDIR/test-envs/kerberos/docker-compose.yaml" \
-f "$TEST_TMPDIR/test-envs/docker/kerberos/docker-compose.yaml" \
-f "$CONNECTIVITY_TEST_SOURCE_DIR/kerberos/docker-compose.kerberos.yaml" \
--no-ansi \
down -v
Expand Down
12 changes: 6 additions & 6 deletions packages/connectivity-tests/test/kerberos/kerberos-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ function get_domain_ip() {
function resolve_hosts() {
MONGODB_1_IP=$(get_domain_ip "mongodb-kerberos-1.example.com")
MONGODB_2_IP=$(get_domain_ip "mongodb-kerberos-2.example.com")
MONGODB_3_IP=$(get_domain_ip "mongodb-kerberos-3.examplewrong.com")
MONGODB_3_IP=$(get_domain_ip "mongodb-kerberos-3.examplecrossrealm.com")
echo "$MONGODB_1_IP mongodb-kerberos-1.example.com" >> /etc/hosts
echo "$MONGODB_2_IP mongodb-kerberos-2.example.com" >> /etc/hosts
echo "$MONGODB_3_IP mongodb-kerberos-3.examplewrong.com" >> /etc/hosts
echo "$MONGODB_3_IP mongodb-kerberos-3.examplecrossrealm.com" >> /etc/hosts
}

function setup_kerberos() {
Expand All @@ -33,7 +33,7 @@ function setup_kerberos() {
}

function update_kerberos_cross_realm() {
printf "\n[domain_realm]\n .examplewrong.com = EXAMPLE2.COM\n" >> /etc/krb5.conf
printf "\n[domain_realm]\n .examplecrossrealm.com = EXAMPLE2.COM\n" >> /etc/krb5.conf
}

function check_failed() {
Expand Down Expand Up @@ -94,7 +94,7 @@ function test_alternate_gssapi_uri() {
function test_cross_gssapi_explicit_expect_fail() {
printf "test_cross_gssapi_explicit_expect_fail ... "

$MONGOSH --host mongodb-kerberos-3.examplewrong.com --port 27017 --username 'mongodb.user@EXAMPLE.COM' --authenticationMechanism GSSAPI --quiet --eval "${CONNECTION_STATUS_COMMAND}" |
$MONGOSH --host mongodb-kerberos-3.examplecrossrealm.com --port 27017 --username 'mongodb.user@EXAMPLE.COM' --authenticationMechanism GSSAPI --quiet --eval "${CONNECTION_STATUS_COMMAND}" |
grep -Fq "${CONNECTION_STATUS_CHECK_STRING}" && FAILED="Can't connect to mongodb-kerberos-3 using explicit parameters"

check_failed
Expand All @@ -103,7 +103,7 @@ function test_cross_gssapi_explicit_expect_fail() {
function test_cross_gssapi_explicit() {
printf "test_cross_gssapi_explicit ... "

$MONGOSH --host mongodb-kerberos-3.examplewrong.com --port 27017 --username 'mongodb.user@EXAMPLE.COM' --authenticationMechanism GSSAPI --quiet --eval "${CONNECTION_STATUS_COMMAND}" |
$MONGOSH --host mongodb-kerberos-3.examplecrossrealm.com --port 27017 --username 'mongodb.user@EXAMPLE.COM' --authenticationMechanism GSSAPI --quiet --eval "${CONNECTION_STATUS_COMMAND}" |
grep -Fq "${CONNECTION_STATUS_CHECK_STRING}" ||
FAILED="Can't connect to mongodb-kerberos-3 using explicit parameters"

Expand All @@ -113,7 +113,7 @@ function test_cross_gssapi_explicit() {
function test_cross_gssapi_uri() {
printf "test_cross_gssapi_uri ... "

CONNECTION_STRING="mongodb://mongodb.user%40EXAMPLE.COM@mongodb-kerberos-3.examplewrong.com:27017/?authMechanism=GSSAPI"
CONNECTION_STRING="mongodb://mongodb.user%40EXAMPLE.COM@mongodb-kerberos-3.examplecrossrealm.com:27017/?authMechanism=GSSAPI"

$MONGOSH "${CONNECTION_STRING}" --quiet --eval "${CONNECTION_STATUS_COMMAND}" |
grep -Fq "${CONNECTION_STATUS_CHECK_STRING}" ||
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity-tests/test/ldap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ function try_connect_connection_string() {
}

function test_for_version() {
MONGODB_VERSION="$1" docker-compose -f ldap/docker-compose.yaml up -d
MONGODB_VERSION="$1" docker-compose -f docker/ldap/docker-compose.yaml up -d

sleep 10 # let mongod start up
FAILED_EXPLICIT=$(try_connect_explicit 'writer@EXAMPLE.COM' 'Password1!')
FAILED_CONNECTION_STRING=$(try_connect_connection_string 'mongodb://writer%40EXAMPLE.COM:Password1!@localhost:30017/$external?authMechanism=PLAIN' 'writer@EXAMPLE.COM')

MONGODB_VERSION="$1" docker-compose -f ldap/docker-compose.yaml down
MONGODB_VERSION="$1" docker-compose -f docker/ldap/docker-compose.yaml down

if [ $FAILED_EXPLICIT = yes ]; then
ANY_FAILED=yes
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity-tests/test/localhost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ function try_connect_connection_string() {
}

function test_for_version() {
MONGODB_VERSION="$1" docker-compose -f enterprise/docker-compose.yaml up -d
MONGODB_VERSION="$1" docker-compose -f docker/enterprise/docker-compose.yaml up -d

sleep 10 # let mongod start up
FAILED_EXPLICIT=$(try_connect_explicit)
FAILED_CONNECTION_STRING=$(try_connect_connection_string)

MONGODB_VERSION="$1" docker-compose -f enterprise/docker-compose.yaml down
MONGODB_VERSION="$1" docker-compose -f docker/enterprise/docker-compose.yaml down

if [ $FAILED_EXPLICIT = yes ]; then
ANY_FAILED=yes
Expand Down