Skip to content

Commit 2b4dc77

Browse files
vbabaninstIncMalekatcharovjyeminashni-mehta
authored
CSOT: Master into csot merge (#1397)
Co-authored-by: Valentin Kovalenko <[email protected]> Co-authored-by: Maxim Katcharov <[email protected]> Co-authored-by: Jeff Yemin <[email protected]> Co-authored-by: ashni <[email protected]>
1 parent 0d2d8e8 commit 2b4dc77

File tree

184 files changed

+28998
-19323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+28998
-19323
lines changed

.evergreen/.evg.yml

Lines changed: 166 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ stepback: true
1212
# Actual testing tasks are marked with `type: test`
1313
command_type: system
1414

15-
# Protect ourself against rogue test case, or curl gone wild, that runs forever
16-
# 12 minutes is the longest we'll ever run
17-
exec_timeout_secs: 3600 # 12 minutes is the longest we'll ever run
15+
# Protect ourselves against rogue test case, or curl gone wild, that runs forever
16+
exec_timeout_secs: 3600
1817

1918
# What to do when evergreen hits the timeout (`post:` tasks are run automatically)
2019
timeout:
@@ -968,6 +967,60 @@ tasks:
968967
- func: "run load-balancer"
969968
- func: "run load-balancer tests"
970969

970+
- name: "oidc-auth-test"
971+
commands:
972+
- command: subprocess.exec
973+
type: test
974+
params:
975+
working_dir: "src"
976+
binary: bash
977+
include_expansions_in_env: ["DRIVERS_TOOLS", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
978+
env:
979+
OIDC_ENV: "test"
980+
args:
981+
- .evergreen/run-mongodb-oidc-test.sh
982+
983+
- name: "oidc-auth-test-azure"
984+
commands:
985+
- command: shell.exec
986+
params:
987+
shell: bash
988+
env:
989+
JAVA_HOME: ${JAVA_HOME}
990+
script: |-
991+
set -o errexit
992+
${PREPARE_SHELL}
993+
cd src
994+
git add .
995+
git commit --allow-empty -m "add files"
996+
# uncompressed tar used to allow appending .git folder
997+
export AZUREOIDC_DRIVERS_TAR_FILE=/tmp/mongo-java-driver.tar
998+
git archive -o $AZUREOIDC_DRIVERS_TAR_FILE HEAD
999+
tar -rf $AZUREOIDC_DRIVERS_TAR_FILE .git
1000+
export AZUREOIDC_TEST_CMD="OIDC_ENV=azure ./.evergreen/run-mongodb-oidc-test.sh"
1001+
bash $DRIVERS_TOOLS/.evergreen/auth_oidc/azure/run-driver-test.sh
1002+
1003+
- name: "oidc-auth-test-gcp"
1004+
commands:
1005+
- command: shell.exec
1006+
params:
1007+
shell: bash
1008+
script: |-
1009+
set -o errexit
1010+
${PREPARE_SHELL}
1011+
cd src
1012+
git add .
1013+
git commit --allow-empty -m "add files"
1014+
# uncompressed tar used to allow appending .git folder
1015+
export GCPOIDC_DRIVERS_TAR_FILE=/tmp/mongo-java-driver.tar
1016+
git archive -o $GCPOIDC_DRIVERS_TAR_FILE HEAD
1017+
tar -rf $GCPOIDC_DRIVERS_TAR_FILE .git
1018+
# Define the command to run on the VM.
1019+
# Ensure that we source the environment file created for us, set up any other variables we need,
1020+
# and then run our test suite on the vm.
1021+
export GCPOIDC_TEST_CMD="OIDC_ENV=gcp ./.evergreen/run-mongodb-oidc-test.sh"
1022+
bash $DRIVERS_TOOLS/.evergreen/auth_oidc/gcp/run-driver-test.sh
1023+
9711024
- name: serverless-test
9721025
commands:
9731026
- func: "run serverless"
@@ -1710,6 +1763,13 @@ axes:
17101763
# Multiple mongos instances can be specified in the connection string
17111764
# for this version.
17121765
SAFE_FOR_MULTI_MONGOS: true
1766+
- id: "8.0"
1767+
display_name: "8.0"
1768+
variables:
1769+
VERSION: "8.0"
1770+
# Multiple mongos instances can be specified in the connection string
1771+
# for this version.
1772+
SAFE_FOR_MULTI_MONGOS: true
17131773
- id: "7.0"
17141774
display_name: "7.0"
17151775
variables:
@@ -1749,10 +1809,6 @@ axes:
17491809
display_name: "4.0"
17501810
variables:
17511811
VERSION: "4.0"
1752-
- id: "3.6"
1753-
display_name: "3.6"
1754-
variables:
1755-
VERSION: "3.6"
17561812
- id: os
17571813
display_name: OS
17581814
values:
@@ -2065,6 +2121,78 @@ task_groups:
20652121
tasks:
20662122
- test-aws-lambda-deployed
20672123

2124+
- name: testoidc_task_group
2125+
setup_group:
2126+
- func: fetch source
2127+
- func: prepare resources
2128+
- func: fix absolute paths
2129+
- command: ec2.assume_role
2130+
params:
2131+
role_arn: ${aws_test_secrets_role}
2132+
- command: subprocess.exec
2133+
params:
2134+
binary: bash
2135+
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
2136+
args:
2137+
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/setup.sh
2138+
teardown_task:
2139+
- command: subprocess.exec
2140+
params:
2141+
binary: bash
2142+
args:
2143+
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/teardown.sh
2144+
setup_group_can_fail_task: true
2145+
setup_group_timeout_secs: 1800
2146+
tasks:
2147+
- oidc-auth-test
2148+
2149+
- name: testazureoidc_task_group
2150+
setup_group:
2151+
- func: fetch source
2152+
- func: prepare resources
2153+
- func: fix absolute paths
2154+
- command: subprocess.exec
2155+
params:
2156+
binary: bash
2157+
env:
2158+
AZUREOIDC_VMNAME_PREFIX: "JAVA_DRIVER"
2159+
args:
2160+
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/azure/create-and-setup-vm.sh
2161+
teardown_task:
2162+
- command: subprocess.exec
2163+
params:
2164+
binary: bash
2165+
args:
2166+
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/azure/delete-vm.sh
2167+
setup_group_can_fail_task: true
2168+
setup_group_timeout_secs: 1800
2169+
tasks:
2170+
- oidc-auth-test-azure
2171+
2172+
- name: testgcpoidc_task_group
2173+
setup_group:
2174+
- func: fetch source
2175+
- func: prepare resources
2176+
- func: fix absolute paths
2177+
- command: subprocess.exec
2178+
params:
2179+
binary: bash
2180+
env:
2181+
GCPOIDC_VMNAME_PREFIX: "JAVA_DRIVER"
2182+
GCPKMS_MACHINETYPE: "e2-medium" # comparable elapsed time to Azure; default was starved, caused timeouts
2183+
args:
2184+
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/gcp/setup.sh
2185+
teardown_task:
2186+
- command: subprocess.exec
2187+
params:
2188+
binary: bash
2189+
args:
2190+
- ${DRIVERS_TOOLS}/.evergreen/auth_oidc/gcp/teardown.sh
2191+
setup_group_can_fail_task: true
2192+
setup_group_timeout_secs: 1800
2193+
tasks:
2194+
- oidc-auth-test-gcp
2195+
20682196
buildvariants:
20692197

20702198
# Test packaging and other release related routines
@@ -2090,15 +2218,15 @@ buildvariants:
20902218

20912219
- matrix_name: "tests-zstd-compression"
20922220
matrix_spec: { compressor : "zstd", auth: "noauth", ssl: "nossl", jdk: "jdk8",
2093-
version: ["4.2", "4.4", "5.0", "6.0", "7.0", "latest"],
2221+
version: ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest"],
20942222
topology: "standalone", os: "linux" }
20952223
display_name: "${version} ${compressor} ${topology} ${auth} ${ssl} ${jdk} ${os} "
20962224
tags: ["tests-variant"]
20972225
tasks:
20982226
- name: "test"
20992227

21002228
- matrix_name: "tests-jdk8-unsecure"
2101-
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["3.6", "4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "latest"],
2229+
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest"],
21022230
topology: "*", os: "linux" }
21032231
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21042232
tags: ["tests-variant"]
@@ -2107,7 +2235,7 @@ buildvariants:
21072235

21082236
- matrix_name: "tests-jdk-secure"
21092237
matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"],
2110-
version: [ "3.6", "4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "latest" ],
2238+
version: ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest" ],
21112239
topology: "*", os: "linux" }
21122240
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
21132241
tags: ["tests-variant"]
@@ -2122,15 +2250,15 @@ buildvariants:
21222250
- name: "test"
21232251

21242252
- matrix_name: "tests-require-api-version"
2125-
matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "latest"],
2253+
matrix_spec: { api-version: "required", auth: "auth", ssl: "nossl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "8.0", "latest"],
21262254
topology: "standalone", os: "linux" }
21272255
display_name: "${version} ${topology} ${api-version} "
21282256
tags: ["tests-variant"]
21292257
tasks:
21302258
- name: "test"
21312259

21322260
- matrix_name: "tests-load-balancer-secure"
2133-
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "latest"], topology: "sharded-cluster",
2261+
matrix_spec: { auth: "auth", ssl: "ssl", jdk: ["jdk21"], version: ["5.0", "6.0", "7.0", "8.0", "latest"], topology: "sharded-cluster",
21342262
os: "ubuntu" }
21352263
display_name: "Load Balancer ${version} ${auth} ${ssl} ${jdk} ${os}"
21362264
tasks:
@@ -2216,8 +2344,29 @@ buildvariants:
22162344
tasks:
22172345
- name: "test_atlas_task_group_search_indexes"
22182346

2347+
- name: "oidc-auth-test"
2348+
display_name: "OIDC Auth"
2349+
run_on: ubuntu2204-small
2350+
tasks:
2351+
- name: testoidc_task_group
2352+
batchtime: 20160 # 14 days
2353+
2354+
- name: testazureoidc-variant
2355+
display_name: "OIDC Auth Azure"
2356+
run_on: ubuntu2204-small
2357+
tasks:
2358+
- name: testazureoidc_task_group
2359+
batchtime: 20160 # 14 days
2360+
2361+
- name: testgcpoidc-variant
2362+
display_name: "OIDC Auth GCP"
2363+
run_on: ubuntu2204-small
2364+
tasks:
2365+
- name: testgcpoidc_task_group
2366+
batchtime: 20160 # 14 days
2367+
22192368
- matrix_name: "aws-auth-test"
2220-
matrix_spec: { ssl: "nossl", jdk: ["jdk8", "jdk17", "jdk21"], version: ["4.4", "5.0", "6.0", "7.0", "latest"], os: "ubuntu",
2369+
matrix_spec: { ssl: "nossl", jdk: ["jdk8", "jdk17", "jdk21"], version: ["4.4", "5.0", "6.0", "7.0", "8.0", "latest"], os: "ubuntu",
22212370
aws-credential-provider: "*" }
22222371
display_name: "MONGODB-AWS Basic Auth test ${version} ${jdk} ${aws-credential-provider}"
22232372
run_on: ubuntu2004-small
@@ -2236,14 +2385,15 @@ buildvariants:
22362385
- name: "aws-auth-test-with-web-identity-credentials"
22372386

22382387
- matrix_name: "accept-api-version-2-test"
2239-
matrix_spec: { ssl: "nossl", auth: "noauth", jdk: "jdk21", version: ["5.0", "6.0", "7.0", "latest"], topology: "standalone", os: "linux" }
2388+
matrix_spec: { ssl: "nossl", auth: "noauth", jdk: "jdk21", version: ["5.0", "6.0", "7.0", "8.0", "latest"], topology: "standalone",
2389+
os: "linux" }
22402390
display_name: "Accept API Version 2 ${version}"
22412391
run_on: ubuntu2004-small
22422392
tasks:
22432393
- name: "accept-api-version-2-test"
22442394

22452395
- matrix_name: "ocsp-test"
2246-
matrix_spec: { auth: "noauth", ssl: "ssl", jdk: "jdk21", version: ["4.4", "5.0", "6.0", "7.0", "latest"], os: "ubuntu" }
2396+
matrix_spec: { auth: "noauth", ssl: "ssl", jdk: "jdk21", version: ["4.4", "5.0", "6.0", "7.0", "8.0", "latest"], os: "ubuntu" }
22472397
display_name: "OCSP test ${version} ${os}"
22482398
tasks:
22492399
- name: ".ocsp"
@@ -2318,7 +2468,7 @@ buildvariants:
23182468
- name: ".csfle-aws-from-environment"
23192469

23202470
- matrix_name: "csfle-tests-with-mongocryptd"
2321-
matrix_spec: { os: "linux", version: [ "4.2", "4.4", "5.0", "6.0", "7.0", "latest" ], topology: ["replicaset"] }
2471+
matrix_spec: { os: "linux", version: [ "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest" ], topology: ["replicaset"] }
23222472
display_name: "CSFLE with mongocryptd: ${version}"
23232473
tasks:
23242474
- name: "csfle-tests-with-mongocryptd"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
set -o xtrace
4+
set -o errexit # Exit the script with error if any of the commands fail
5+
6+
############################################
7+
# Main Program #
8+
############################################
9+
10+
# Supported/used environment variables:
11+
# DRIVERS_TOOLS The path to evergreeen tools
12+
# OIDC_AWS_* Required OIDC_AWS_* env variables must be configured
13+
#
14+
# Environment variables used as output:
15+
# OIDC_TESTS_ENABLED Allows running OIDC tests
16+
# OIDC_TOKEN_DIR The path to generated OIDC AWS tokens
17+
# AWS_WEB_IDENTITY_TOKEN_FILE The path to AWS token for device workflow
18+
19+
if [ -z ${DRIVERS_TOOLS+x} ]; then
20+
echo "DRIVERS_TOOLS. is not set";
21+
exit 1
22+
fi
23+
24+
if [ -z ${OIDC_AWS_ROLE_ARN+x} ]; then
25+
echo "OIDC_AWS_ROLE_ARN. is not set";
26+
exit 1
27+
fi
28+
29+
if [ -z ${OIDC_AWS_SECRET_ACCESS_KEY+x} ]; then
30+
echo "OIDC_AWS_SECRET_ACCESS_KEY. is not set";
31+
exit 1
32+
fi
33+
34+
if [ -z ${OIDC_AWS_ACCESS_KEY_ID+x} ]; then
35+
echo "OIDC_AWS_ACCESS_KEY_ID. is not set";
36+
exit 1
37+
fi
38+
39+
export AWS_ROLE_ARN=${OIDC_AWS_ROLE_ARN}
40+
export AWS_SECRET_ACCESS_KEY=${OIDC_AWS_SECRET_ACCESS_KEY}
41+
export AWS_ACCESS_KEY_ID=${OIDC_AWS_ACCESS_KEY_ID}
42+
export OIDC_FOLDER=${DRIVERS_TOOLS}/.evergreen/auth_oidc
43+
export OIDC_TOKEN_DIR=${OIDC_FOLDER}/test_tokens
44+
export AWS_WEB_IDENTITY_TOKEN_FILE=${OIDC_TOKEN_DIR}/test1
45+
export OIDC_TESTS_ENABLED=true
46+
47+
echo "Configuring OIDC server for local authentication tests"
48+
49+
cd ${OIDC_FOLDER}
50+
DRIVERS_TOOLS=${DRIVERS_TOOLS} ./oidc_get_tokens.sh
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
set -o xtrace
4+
set -o errexit # Exit the script with error if any of the commands fail
5+
6+
############################################
7+
# Main Program #
8+
############################################
9+
10+
# Supported/used environment variables:
11+
# DRIVERS_TOOLS The path to evergreeen tools
12+
# OIDC_AWS_* OIDC_AWS_* env variables must be configured
13+
#
14+
# Environment variables used as output:
15+
# OIDC_TESTS_ENABLED Allows running OIDC tests
16+
# OIDC_TOKEN_DIR The path to generated tokens
17+
# AWS_WEB_IDENTITY_TOKEN_FILE The path to AWS token for device workflow
18+
19+
if [ -z ${DRIVERS_TOOLS+x} ]; then
20+
echo "DRIVERS_TOOLS. is not set";
21+
exit 1
22+
fi
23+
24+
if [ -z ${OIDC_AWS_ROLE_ARN+x} ]; then
25+
echo "OIDC_AWS_ROLE_ARN. is not set";
26+
exit 1
27+
fi
28+
29+
if [ -z ${OIDC_AWS_SECRET_ACCESS_KEY+x} ]; then
30+
echo "OIDC_AWS_SECRET_ACCESS_KEY. is not set";
31+
exit 1
32+
fi
33+
34+
if [ -z ${OIDC_AWS_ACCESS_KEY_ID+x} ]; then
35+
echo "OIDC_AWS_ACCESS_KEY_ID. is not set";
36+
exit 1
37+
fi
38+
39+
export AWS_ROLE_ARN=${OIDC_AWS_ROLE_ARN}
40+
export AWS_SECRET_ACCESS_KEY=${OIDC_AWS_SECRET_ACCESS_KEY}
41+
export AWS_ACCESS_KEY_ID=${OIDC_AWS_ACCESS_KEY_ID}
42+
export OIDC_FOLDER=${DRIVERS_TOOLS}/.evergreen/auth_oidc
43+
export OIDC_TOKEN_DIR=${OIDC_FOLDER}/test_tokens
44+
export AWS_WEB_IDENTITY_TOKEN_FILE=${OIDC_TOKEN_DIR}/test1
45+
export OIDC_TESTS_ENABLED=true
46+
47+
echo "Configuring OIDC server for local authentication tests"
48+
49+
cd ${OIDC_FOLDER}
50+
DRIVERS_TOOLS=${DRIVERS_TOOLS} ./start_local_server.sh

0 commit comments

Comments
 (0)