@@ -68,6 +68,59 @@ functions:
6868 - .evergreen/run-kms-servers.sh
6969 env :
7070 DRIVERS_TOOLS : ${DRIVERS_TOOLS}
71+ bootstrap oidc :
72+ - command : ec2.assume_role
73+ params :
74+ role_arn : ${OIDC_AWS_ROLE_ARN}
75+ - command : shell.exec
76+ type : test
77+ params :
78+ working_dir : src
79+ shell : bash
80+ script : |
81+ ${PREPARE_SHELL}
82+
83+ # TODO(NODE-5035): Remove when merged - need to replace with branch just for OIDC.
84+ rm -rf "${DRIVERS_TOOLS}"
85+ git clone --branch DRIVERS-2415 https://github.com/blink1073/drivers-evergreen-tools.git "${DRIVERS_TOOLS}"
86+
87+ cd "${DRIVERS_TOOLS}"/.evergreen/auth_oidc
88+
89+ # This is a bit confusing but the ec2.assume_role command before
90+ # this task will overwrite these variables to a different value
91+ # than we have set in our evergreen project config. As these are
92+ # now specific to the OIDC ARN, we re-export for the python
93+ # scripts.
94+ export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
95+ export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
96+ export AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}
97+ export AWS_TOKEN_DIR=/tmp/tokens
98+
99+ . ./activate_venv.sh
100+ python oidc_write_orchestration.py
101+ python oidc_get_tokens.py
102+ setup oidc roles :
103+ - command : subprocess.exec
104+ params :
105+ working_dir : src
106+ binary : bash
107+ args :
108+ - .evergreen/setup-oidc-roles.sh
109+ env :
110+ DRIVERS_TOOLS : ${DRIVERS_TOOLS}
111+ run oidc tests aws :
112+ - command : shell.exec
113+ type : test
114+ params :
115+ working_dir : src
116+ timeout_secs : 300
117+ shell : bash
118+ script : |
119+ ${PREPARE_SHELL}
120+
121+ AWS_WEB_IDENTITY_TOKEN_FILE="/tmp/tokens/test1" \
122+ PROJECT_DIRECTORY="${PROJECT_DIRECTORY}" \
123+ bash ${PROJECT_DIRECTORY}/.evergreen/run-oidc-tests.sh
71124 run tests :
72125 - command : shell.exec
73126 type : test
@@ -1380,6 +1433,22 @@ tasks:
13801433 commands :
13811434 - func : install dependencies
13821435 - func : run ldap tests
1436+ - name : test-auth-oidc
1437+ tags :
1438+ - latest
1439+ - replica_set
1440+ - oidc
1441+ commands :
1442+ - func : install dependencies
1443+ - func : bootstrap oidc
1444+ - func : bootstrap mongo-orchestration
1445+ vars :
1446+ VERSION : latest
1447+ TOPOLOGY : replica_set
1448+ AUTH : auth
1449+ ORCHESTRATION_FILE : auth-oidc.json
1450+ - func : setup oidc roles
1451+ - func : run oidc tests aws
13831452 - name : test-socks5
13841453 tags : []
13851454 commands :
@@ -3005,6 +3074,7 @@ buildvariants:
30053074 - test-latest-load-balanced
30063075 - test-auth-kerberos
30073076 - test-auth-ldap
3077+ - test-auth-oidc
30083078 - test-socks5
30093079 - test-socks5-csfle
30103080 - test-socks5-tls
@@ -3054,6 +3124,7 @@ buildvariants:
30543124 - test-latest-load-balanced
30553125 - test-auth-kerberos
30563126 - test-auth-ldap
3127+ - test-auth-oidc
30573128 - test-socks5
30583129 - test-socks5-csfle
30593130 - test-socks5-tls
@@ -3101,6 +3172,7 @@ buildvariants:
31013172 - test-latest-load-balanced
31023173 - test-auth-kerberos
31033174 - test-auth-ldap
3175+ - test-auth-oidc
31043176 - test-socks5
31053177 - test-socks5-csfle
31063178 - test-socks5-tls
@@ -3147,6 +3219,7 @@ buildvariants:
31473219 - test-6.0-load-balanced
31483220 - test-latest-load-balanced
31493221 - test-auth-ldap
3222+ - test-auth-oidc
31503223 - test-socks5-csfle
31513224 - test-socks5-tls
31523225 - test-tls-support-latest
0 commit comments