@@ -193,7 +193,7 @@ functions:
193193 ${PREPARE_SHELL}
194194 REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
195195 AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
196- INSTALL_LEGACY_SHELL=${INSTALL_LEGACY_SHELL} bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
196+ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
197197 # run-orchestration generates expansion file with the MONGODB_URI for the cluster
198198 - command : expansions.update
199199 params :
@@ -385,241 +385,108 @@ functions:
385385 JAVA_VERSION="8" MONGODB_URI="${plain_auth_mongodb_uri}" .evergreen/run-plain-auth-test.sh
386386
387387 " add aws auth variables to file " :
388+ - command : ec2.assume_role
389+ params :
390+ role_arn : ${aws_test_secrets_role}
388391 - command : shell.exec
389392 type : test
390393 params :
394+ include_expansions_in_env : [ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN" ]
395+ shell : " bash"
391396 working_dir : " src"
392- silent : true
393397 script : |
394- cat <<EOF > ${DRIVERS_TOOLS}/.evergreen/auth_aws/aws_e2e_setup.json
395- {
396- "iam_auth_ecs_account" : "${iam_auth_ecs_account}",
397- "iam_auth_ecs_secret_access_key" : "${iam_auth_ecs_secret_access_key}",
398- "iam_auth_ecs_account_arn": "arn:aws:iam::557821124784:user/authtest_fargate_user",
399- "iam_auth_ecs_cluster": "${iam_auth_ecs_cluster}",
400- "iam_auth_ecs_task_definition": "${iam_auth_ecs_task_definition}",
401- "iam_auth_ecs_subnet_a": "${iam_auth_ecs_subnet_a}",
402- "iam_auth_ecs_subnet_b": "${iam_auth_ecs_subnet_b}",
403- "iam_auth_ecs_security_group": "${iam_auth_ecs_security_group}",
404-
405- "iam_auth_assume_aws_account" : "${iam_auth_assume_aws_account}",
406- "iam_auth_assume_aws_secret_access_key" : "${iam_auth_assume_aws_secret_access_key}",
407- "iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
408-
409- "iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
410- "iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
411- "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}",
412-
413- "iam_auth_assume_web_role_name": "${iam_auth_assume_web_role_name}",
414- "iam_web_identity_issuer": "${iam_web_identity_issuer}",
415- "iam_web_identity_rsa_key": "${iam_web_identity_rsa_key}",
416- "iam_web_identity_jwks_uri": "${iam_web_identity_jwks_uri}",
417- "iam_web_identity_token_file": "${iam_web_identity_token_file}"
418- }
419- EOF
398+ ${PREPARE_SHELL}
399+ cd $DRIVERS_TOOLS/.evergreen/auth_aws
400+ ./setup_secrets.sh drivers/aws_auth
420401
421402 " run aws auth test with regular aws credentials " :
422403 - command : shell.exec
423404 type : test
424405 params :
425- working_dir : " src"
426406 shell : " bash"
427- script : |
428- ${PREPARE_SHELL}
429- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
430- . ./activate-authawsvenv.sh
431- mongo aws_e2e_regular_aws.js
432- - command : shell.exec
433- type : test
434- params :
435407 working_dir : " src"
436- silent : true
437408 script : |
438- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
439- alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
440- USER=$(urlencode ${iam_auth_ecs_account})
441- PASS=$(urlencode ${iam_auth_ecs_secret_access_key})
442- MONGODB_URI="mongodb://$USER:$PASS@localhost"
443- EOF
444- JAVA_VERSION=${JAVA_VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} \
445- AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} \
446- .evergreen/run-mongodb-aws-test.sh
409+ ${PREPARE_SHELL}
410+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh regular
447411
448412 " run aws auth test with assume role credentials " :
449413 - command : shell.exec
450414 type : test
451415 params :
452- working_dir : " src"
453416 shell : " bash"
454- script : |
455- ${PREPARE_SHELL}
456- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
457- . ./activate-authawsvenv.sh
458- mongo aws_e2e_assume_role.js
459- - command : shell.exec
460- type : test
461- params :
462417 working_dir : " src"
463- silent : true
464418 script : |
465- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
466- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
467- alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
468- USER=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
469- USER=$(urlencode $USER)
470- PASS=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
471- PASS=$(urlencode $PASS)
472- SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
473- SESSION_TOKEN=$(urlencode $SESSION_TOKEN)
474- MONGODB_URI="mongodb://$USER:$PASS@localhost"
475- EOF
476- JAVA_VERSION=${JAVA_VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} DRIVERS_TOOLS=${DRIVERS_TOOLS} \
477- AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} \
478- .evergreen/run-mongodb-aws-test.sh
419+ ${PREPARE_SHELL}
420+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh assume-role
479421
480422 " run aws auth test with aws EC2 credentials " :
481423 - command : shell.exec
482424 type : test
483425 params :
484- working_dir : " src"
485426 shell : " bash"
486- script : |
487- ${PREPARE_SHELL}
488- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
489- . ./activate-authawsvenv.sh
490- mongo aws_e2e_ec2.js
491- - command : shell.exec
492- type : test
493- params :
494427 working_dir : " src"
495- shell : " bash"
496428 script : |
497429 ${PREPARE_SHELL}
498- # Write an empty prepare_mongodb_aws so no auth environment variables are set.
499- echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
500- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
430+ if [ "${SKIP_EC2_AUTH_TEST}" = "true" ]; then
431+ echo "This platform does not support the EC2 auth test, skipping..."
432+ exit 0
433+ fi
434+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh ec2
501435
502436 " run aws auth test with web identity credentials " :
503437 - command : shell.exec
504438 type : test
505439 params :
506- working_dir : " src"
507- shell : " bash"
508- script : |
509- ${PREPARE_SHELL}
510- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
511- . ./activate-authawsvenv.sh
512- mongo aws_e2e_web_identity.js
513- - command : shell.exec
514- type : test
515- params :
516- working_dir : " src"
517440 shell : " bash"
518- silent : true
519- script : |
520- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
521- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
522- export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
523- export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
524- EOF
525- - command : shell.exec
526- type : test
527- params :
528441 working_dir : " src"
529- shell : " bash"
530442 script : |
531443 ${PREPARE_SHELL}
532444 if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
533445 echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
534446 exit 0
535447 fi
536- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
448+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST}" = "true" ]; then
449+ echo "This platform does not support the web identity auth test, skipping..."
450+ exit 0
451+ fi
452+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
537453 - command : shell.exec
538454 type : test
539455 params :
540- working_dir : " src"
541456 shell : " bash"
542- silent : true
543- script : |
544- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
545- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
546- export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
547- export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
548- export AWS_ROLE_SESSION_NAME="test"
549- EOF
550- - command : shell.exec
551- type : test
552- params :
553457 working_dir : " src"
554- shell : " bash"
555458 script : |
556459 ${PREPARE_SHELL}
557460 if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
558461 echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
559462 exit 0
560463 fi
561- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
464+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST}" = "true" ]; then
465+ echo "This platform does not support the web identity auth test, skipping..."
466+ exit 0
467+ fi
468+ export AWS_ROLE_SESSION_NAME="test"
469+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
562470
563471 " run aws auth test with aws credentials as environment variables " :
564472 - command : shell.exec
565473 type : test
566474 params :
567- working_dir : " src"
568475 shell : " bash"
569- script : |
570- ${PREPARE_SHELL}
571- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
572- . ./activate-authawsvenv.sh
573- mongo aws_e2e_regular_aws.js
574- - command : shell.exec
575- type : test
576- params :
577- working_dir : " src"
578- silent : true
579- script : |
580- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
581- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
582- export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
583- export AWS_SECRET_ACCESS_KEY=${iam_auth_ecs_secret_access_key}
584- EOF
585- - command : shell.exec
586- type : test
587- params :
588476 working_dir : " src"
589477 script : |
590478 ${PREPARE_SHELL}
591- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
479+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh env-creds
592480
593481 " run aws auth test with aws credentials and session token as environment variables " :
594482 - command : shell.exec
595483 type : test
596484 params :
597- working_dir : " src"
598485 shell : " bash"
599- script : |
600- ${PREPARE_SHELL}
601- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
602- . ./activate-authawsvenv.sh
603- mongo aws_e2e_assume_role.js
604- - command : shell.exec
605- type : test
606- params :
607- working_dir : " src"
608- silent : true
609- script : |
610- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
611- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
612- export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
613- export AWS_SECRET_ACCESS_KEY=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
614- export AWS_SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
615- EOF
616- - command : shell.exec
617- type : test
618- params :
619486 working_dir : " src"
620487 script : |
621488 ${PREPARE_SHELL}
622- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
489+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh session-creds
623490
624491 " run aws ECS auth test " :
625492 - command : shell.exec
@@ -1099,7 +966,6 @@ tasks:
1099966 AUTH : " auth"
1100967 ORCHESTRATION_FILE : " auth-aws.json"
1101968 TOPOLOGY : " server"
1102- INSTALL_LEGACY_SHELL : " true"
1103969 - func : " add aws auth variables to file"
1104970 - func : " run aws auth test with regular aws credentials"
1105971
@@ -1110,7 +976,6 @@ tasks:
1110976 AUTH : " auth"
1111977 ORCHESTRATION_FILE : " auth-aws.json"
1112978 TOPOLOGY : " server"
1113- INSTALL_LEGACY_SHELL : " true"
1114979 - func : " add aws auth variables to file"
1115980 - func : " run aws auth test with assume role credentials"
1116981
@@ -1121,7 +986,6 @@ tasks:
1121986 AUTH : " auth"
1122987 ORCHESTRATION_FILE : " auth-aws.json"
1123988 TOPOLOGY : " server"
1124- INSTALL_LEGACY_SHELL : " true"
1125989 - func : " add aws auth variables to file"
1126990 - func : " run aws auth test with aws credentials as environment variables"
1127991
@@ -1132,7 +996,6 @@ tasks:
1132996 AUTH : " auth"
1133997 ORCHESTRATION_FILE : " auth-aws.json"
1134998 TOPOLOGY : " server"
1135- INSTALL_LEGACY_SHELL : " true"
1136999 - func : " add aws auth variables to file"
11371000 - func : " run aws auth test with aws credentials and session token as environment variables"
11381001
@@ -1143,7 +1006,6 @@ tasks:
11431006 AUTH : " auth"
11441007 ORCHESTRATION_FILE : " auth-aws.json"
11451008 TOPOLOGY : " server"
1146- INSTALL_LEGACY_SHELL : " true"
11471009 - func : " add aws auth variables to file"
11481010 - func : " run aws auth test with aws EC2 credentials"
11491011
@@ -1154,7 +1016,6 @@ tasks:
11541016 AUTH : " auth"
11551017 ORCHESTRATION_FILE : " auth-aws.json"
11561018 TOPOLOGY : " server"
1157- INSTALL_LEGACY_SHELL : " true"
11581019 - func : " add aws auth variables to file"
11591020 - func : " run aws auth test with web identity credentials"
11601021
@@ -1165,7 +1026,6 @@ tasks:
11651026 AUTH : " auth"
11661027 ORCHESTRATION_FILE : " auth-aws.json"
11671028 TOPOLOGY : " server"
1168- INSTALL_LEGACY_SHELL : " true"
11691029 - func : " add aws auth variables to file"
11701030 - func : " run aws ECS auth test"
11711031
0 commit comments