Skip to content

RUBY-3333 Update AWS auth tests #2803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Nov 2, 2023
Merged
9 changes: 6 additions & 3 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ functions:
IAM_AUTH_ECS_SECURITY_GROUP="${iam_auth_ecs_security_group}"
IAM_AUTH_ECS_SUBNET_A="${iam_auth_ecs_subnet_a}"
IAM_AUTH_ECS_SUBNET_B="${iam_auth_ecs_subnet_b}"
IAM_AUTH_ECS_TASK_DEFINITION="${iam_auth_ecs_task_definition}"
IAM_AUTH_ECS_TASK_DEFINITION="${iam_auth_ecs_task_definition_ubuntu2004}"

IAM_WEB_IDENTITY_ISSUER="${iam_web_identity_issuer}"
IAM_WEB_IDENTITY_JWKS_URI="${iam_web_identity_jwks_uri}"
Expand Down Expand Up @@ -972,7 +972,7 @@ axes:
display_name: jruby-9.4
variables:
RVM_RUBY: "jruby-9.4"

- id: "os"
display_name: OS
values:
Expand All @@ -982,6 +982,9 @@ axes:
- id: ubuntu2204
display_name: "Ubuntu 22.04"
run_on: ubuntu2204-small
- id: ubuntu2004
display_name: "Ubuntu 20.04"
run_on: ubuntu2004-small
- id: rhel8
display_name: "RHEL 8"
run_on: rhel80-small
Expand Down Expand Up @@ -1530,7 +1533,7 @@ buildvariants:
# (depending on server version and what's available), we can bump this to
# the latest stable db version.
mongodb-version: "5.3"
os: rhel8
os: ubuntu2004
display_name: "AWS ${auth-and-ssl} ${mongodb-version} ${ruby}"
tasks:
- name: "test-aws-auth"
Expand Down
5 changes: 4 additions & 1 deletion .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ axes:
display_name: jruby-9.4
variables:
RVM_RUBY: "jruby-9.4"

- id: "os"
display_name: OS
values:
Expand All @@ -196,6 +196,9 @@ axes:
- id: ubuntu2204
display_name: "Ubuntu 22.04"
run_on: ubuntu2204-small
- id: ubuntu2004
display_name: "Ubuntu 20.04"
run_on: ubuntu2004-small
- id: rhel8
display_name: "RHEL 8"
run_on: rhel80-small
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config/common.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ functions:
IAM_AUTH_ECS_SECURITY_GROUP="${iam_auth_ecs_security_group}"
IAM_AUTH_ECS_SUBNET_A="${iam_auth_ecs_subnet_a}"
IAM_AUTH_ECS_SUBNET_B="${iam_auth_ecs_subnet_b}"
IAM_AUTH_ECS_TASK_DEFINITION="${iam_auth_ecs_task_definition}"
IAM_AUTH_ECS_TASK_DEFINITION="${iam_auth_ecs_task_definition_ubuntu2004}"

IAM_WEB_IDENTITY_ISSUER="${iam_web_identity_issuer}"
IAM_WEB_IDENTITY_JWKS_URI="${iam_web_identity_jwks_uri}"
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config/standard.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ buildvariants:
# (depending on server version and what's available), we can bump this to
# the latest stable db version.
mongodb-version: <%= latest_5x_mdb %>
os: rhel8
os: ubuntu2004
display_name: "AWS ${auth-and-ssl} ${mongodb-version} ${ruby}"
tasks:
- name: "test-aws-auth"
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/provision-local
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ sudo env DEBIAN_FRONTEND=noninteractive \
# Need binutils for `strings` utility per
# https://aws.amazon.com/premiumsupport/knowledge-center/ecs-iam-task-roles-config-errors/
sudo env DEBIAN_FRONTEND=noninteractive \
apt-get install -y libsnmp30 libyaml-0-2 gcc make git lsb-release \
krb5-user bzip2 libgmp-dev python-pip python2.7-dev binutils
apt-get install -y libsnmp35 libyaml-0-2 gcc make git lsb-release \
krb5-user bzip2 libgmp-dev python3-pip python2.7-dev binutils
5 changes: 4 additions & 1 deletion .evergreen/run-tests-aws-auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ case "$AUTH" in
aws-web-identity)
cd `dirname "$0"`/auth_aws

. ./activate_venv.sh
echo "Activating virtual environment 'authawsvenv'..."
. ./activate-authawsvenv.sh
export AWS_ACCESS_KEY_ID="`get_var IAM_AUTH_EC2_INSTANCE_ACCOUNT`"
export AWS_SECRET_ACCESS_KEY="`get_var IAM_AUTH_EC2_INSTANCE_SECRET_ACCESS_KEY`"
echo "Unassigning instance profile..."
python -u lib/aws_unassign_instance_profile.py
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
Expand All @@ -113,6 +115,7 @@ case "$AUTH" in
unset IDP_JWKS_URI
unset IDP_RSA_KEY

deactivate
cd -
export MONGO_RUBY_DRIVER_AWS_AUTH_ACCESS_KEY_ID="`get_var IAM_AUTH_EC2_INSTANCE_ACCOUNT`"
export MONGO_RUBY_DRIVER_AWS_AUTH_SECRET_ACCESS_KEY="`get_var IAM_AUTH_EC2_INSTANCE_SECRET_ACCESS_KEY`"
Expand Down
2 changes: 1 addition & 1 deletion spec/shared