@@ -154,7 +154,7 @@ functions:
154154 ${PREPARE_SHELL}
155155 REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
156156 AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
157- INSTALL_LEGACY_SHELL=${INSTALL_LEGACY_SHELL} bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
157+ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
158158 # run-orchestration generates expansion file with the MONGODB_URI for the cluster
159159 - command : expansions.update
160160 params :
@@ -346,241 +346,108 @@ functions:
346346 JAVA_VERSION="8" MONGODB_URI="${plain_auth_mongodb_uri}" .evergreen/run-plain-auth-test.sh
347347
348348 " add aws auth variables to file " :
349+ - command : ec2.assume_role
350+ params :
351+ role_arn : ${aws_test_secrets_role}
349352 - command : shell.exec
350353 type : test
351354 params :
355+ include_expansions_in_env : [ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN" ]
356+ shell : " bash"
352357 working_dir : " src"
353- silent : true
354358 script : |
355- cat <<EOF > ${DRIVERS_TOOLS}/.evergreen/auth_aws/aws_e2e_setup.json
356- {
357- "iam_auth_ecs_account" : "${iam_auth_ecs_account}",
358- "iam_auth_ecs_secret_access_key" : "${iam_auth_ecs_secret_access_key}",
359- "iam_auth_ecs_account_arn": "arn:aws:iam::557821124784:user/authtest_fargate_user",
360- "iam_auth_ecs_cluster": "${iam_auth_ecs_cluster}",
361- "iam_auth_ecs_task_definition": "${iam_auth_ecs_task_definition}",
362- "iam_auth_ecs_subnet_a": "${iam_auth_ecs_subnet_a}",
363- "iam_auth_ecs_subnet_b": "${iam_auth_ecs_subnet_b}",
364- "iam_auth_ecs_security_group": "${iam_auth_ecs_security_group}",
365-
366- "iam_auth_assume_aws_account" : "${iam_auth_assume_aws_account}",
367- "iam_auth_assume_aws_secret_access_key" : "${iam_auth_assume_aws_secret_access_key}",
368- "iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
369-
370- "iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
371- "iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
372- "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}",
373-
374- "iam_auth_assume_web_role_name": "${iam_auth_assume_web_role_name}",
375- "iam_web_identity_issuer": "${iam_web_identity_issuer}",
376- "iam_web_identity_rsa_key": "${iam_web_identity_rsa_key}",
377- "iam_web_identity_jwks_uri": "${iam_web_identity_jwks_uri}",
378- "iam_web_identity_token_file": "${iam_web_identity_token_file}"
379- }
380- EOF
359+ ${PREPARE_SHELL}
360+ cd $DRIVERS_TOOLS/.evergreen/auth_aws
361+ ./setup_secrets.sh drivers/aws_auth
381362
382363 " run aws auth test with regular aws credentials " :
383364 - command : shell.exec
384365 type : test
385366 params :
386- working_dir : " src"
387367 shell : " bash"
388- script : |
389- ${PREPARE_SHELL}
390- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
391- . ./activate-authawsvenv.sh
392- mongo aws_e2e_regular_aws.js
393- - command : shell.exec
394- type : test
395- params :
396368 working_dir : " src"
397- silent : true
398369 script : |
399- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
400- alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
401- USER=$(urlencode ${iam_auth_ecs_account})
402- PASS=$(urlencode ${iam_auth_ecs_secret_access_key})
403- MONGODB_URI="mongodb://$USER:$PASS@localhost"
404- EOF
405- JAVA_VERSION=${JAVA_VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} \
406- AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} \
407- .evergreen/run-mongodb-aws-test.sh
370+ ${PREPARE_SHELL}
371+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh regular
408372
409373 " run aws auth test with assume role credentials " :
410374 - command : shell.exec
411375 type : test
412376 params :
413- working_dir : " src"
414377 shell : " bash"
415- script : |
416- ${PREPARE_SHELL}
417- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
418- . ./activate-authawsvenv.sh
419- mongo aws_e2e_assume_role.js
420- - command : shell.exec
421- type : test
422- params :
423378 working_dir : " src"
424- silent : true
425379 script : |
426- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
427- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
428- alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
429- USER=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
430- USER=$(urlencode $USER)
431- PASS=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
432- PASS=$(urlencode $PASS)
433- SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
434- SESSION_TOKEN=$(urlencode $SESSION_TOKEN)
435- MONGODB_URI="mongodb://$USER:$PASS@localhost"
436- EOF
437- JAVA_VERSION=${JAVA_VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} DRIVERS_TOOLS=${DRIVERS_TOOLS} \
438- AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} \
439- .evergreen/run-mongodb-aws-test.sh
380+ ${PREPARE_SHELL}
381+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh assume-role
440382
441383 " run aws auth test with aws EC2 credentials " :
442384 - command : shell.exec
443385 type : test
444386 params :
445- working_dir : " src"
446387 shell : " bash"
447- script : |
448- ${PREPARE_SHELL}
449- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
450- . ./activate-authawsvenv.sh
451- mongo aws_e2e_ec2.js
452- - command : shell.exec
453- type : test
454- params :
455388 working_dir : " src"
456- shell : " bash"
457389 script : |
458390 ${PREPARE_SHELL}
459- # Write an empty prepare_mongodb_aws so no auth environment variables are set.
460- echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
461- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
391+ if [ "${SKIP_EC2_AUTH_TEST}" = "true" ]; then
392+ echo "This platform does not support the EC2 auth test, skipping..."
393+ exit 0
394+ fi
395+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh ec2
462396
463397 " run aws auth test with web identity credentials " :
464398 - command : shell.exec
465399 type : test
466400 params :
467- working_dir : " src"
468- shell : " bash"
469- script : |
470- ${PREPARE_SHELL}
471- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
472- . ./activate-authawsvenv.sh
473- mongo aws_e2e_web_identity.js
474- - command : shell.exec
475- type : test
476- params :
477- working_dir : " src"
478401 shell : " bash"
479- silent : true
480- script : |
481- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
482- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
483- export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
484- export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
485- EOF
486- - command : shell.exec
487- type : test
488- params :
489402 working_dir : " src"
490- shell : " bash"
491403 script : |
492404 ${PREPARE_SHELL}
493405 if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
494406 echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
495407 exit 0
496408 fi
497- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
409+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST}" = "true" ]; then
410+ echo "This platform does not support the web identity auth test, skipping..."
411+ exit 0
412+ fi
413+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
498414 - command : shell.exec
499415 type : test
500416 params :
501- working_dir : " src"
502417 shell : " bash"
503- silent : true
504- script : |
505- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
506- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
507- export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
508- export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
509- export AWS_ROLE_SESSION_NAME="test"
510- EOF
511- - command : shell.exec
512- type : test
513- params :
514418 working_dir : " src"
515- shell : " bash"
516419 script : |
517420 ${PREPARE_SHELL}
518421 if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
519422 echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
520423 exit 0
521424 fi
522- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
425+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST}" = "true" ]; then
426+ echo "This platform does not support the web identity auth test, skipping..."
427+ exit 0
428+ fi
429+ export AWS_ROLE_SESSION_NAME="test"
430+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
523431
524432 " run aws auth test with aws credentials as environment variables " :
525433 - command : shell.exec
526434 type : test
527435 params :
528- working_dir : " src"
529436 shell : " bash"
530- script : |
531- ${PREPARE_SHELL}
532- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
533- . ./activate-authawsvenv.sh
534- mongo aws_e2e_regular_aws.js
535- - command : shell.exec
536- type : test
537- params :
538- working_dir : " src"
539- silent : true
540- script : |
541- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
542- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
543- export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
544- export AWS_SECRET_ACCESS_KEY=${iam_auth_ecs_secret_access_key}
545- EOF
546- - command : shell.exec
547- type : test
548- params :
549437 working_dir : " src"
550438 script : |
551439 ${PREPARE_SHELL}
552- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
440+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh env-creds
553441
554442 " run aws auth test with aws credentials and session token as environment variables " :
555443 - command : shell.exec
556444 type : test
557445 params :
558- working_dir : " src"
559446 shell : " bash"
560- script : |
561- ${PREPARE_SHELL}
562- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
563- . ./activate-authawsvenv.sh
564- mongo aws_e2e_assume_role.js
565- - command : shell.exec
566- type : test
567- params :
568- working_dir : " src"
569- silent : true
570- script : |
571- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
572- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
573- export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
574- export AWS_SECRET_ACCESS_KEY=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
575- export AWS_SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
576- EOF
577- - command : shell.exec
578- type : test
579- params :
580447 working_dir : " src"
581448 script : |
582449 ${PREPARE_SHELL}
583- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
450+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh session-creds
584451
585452 " run aws ECS auth test " :
586453 - command : shell.exec
@@ -1063,7 +930,6 @@ tasks:
1063930 AUTH : " auth"
1064931 ORCHESTRATION_FILE : " auth-aws.json"
1065932 TOPOLOGY : " server"
1066- INSTALL_LEGACY_SHELL : " true"
1067933 - func : " add aws auth variables to file"
1068934 - func : " run aws auth test with regular aws credentials"
1069935
@@ -1074,7 +940,6 @@ tasks:
1074940 AUTH : " auth"
1075941 ORCHESTRATION_FILE : " auth-aws.json"
1076942 TOPOLOGY : " server"
1077- INSTALL_LEGACY_SHELL : " true"
1078943 - func : " add aws auth variables to file"
1079944 - func : " run aws auth test with assume role credentials"
1080945
@@ -1085,7 +950,6 @@ tasks:
1085950 AUTH : " auth"
1086951 ORCHESTRATION_FILE : " auth-aws.json"
1087952 TOPOLOGY : " server"
1088- INSTALL_LEGACY_SHELL : " true"
1089953 - func : " add aws auth variables to file"
1090954 - func : " run aws auth test with aws credentials as environment variables"
1091955
@@ -1096,7 +960,6 @@ tasks:
1096960 AUTH : " auth"
1097961 ORCHESTRATION_FILE : " auth-aws.json"
1098962 TOPOLOGY : " server"
1099- INSTALL_LEGACY_SHELL : " true"
1100963 - func : " add aws auth variables to file"
1101964 - func : " run aws auth test with aws credentials and session token as environment variables"
1102965
@@ -1107,7 +970,6 @@ tasks:
1107970 AUTH : " auth"
1108971 ORCHESTRATION_FILE : " auth-aws.json"
1109972 TOPOLOGY : " server"
1110- INSTALL_LEGACY_SHELL : " true"
1111973 - func : " add aws auth variables to file"
1112974 - func : " run aws auth test with aws EC2 credentials"
1113975
@@ -1118,7 +980,6 @@ tasks:
1118980 AUTH : " auth"
1119981 ORCHESTRATION_FILE : " auth-aws.json"
1120982 TOPOLOGY : " server"
1121- INSTALL_LEGACY_SHELL : " true"
1122983 - func : " add aws auth variables to file"
1123984 - func : " run aws auth test with web identity credentials"
1124985
@@ -1129,7 +990,6 @@ tasks:
1129990 AUTH : " auth"
1130991 ORCHESTRATION_FILE : " auth-aws.json"
1131992 TOPOLOGY : " server"
1132- INSTALL_LEGACY_SHELL : " true"
1133993 - func : " add aws auth variables to file"
1134994 - func : " run aws ECS auth test"
1135995
0 commit comments