@@ -193,7 +193,7 @@ functions:
193
193
${PREPARE_SHELL}
194
194
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
195
195
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
197
197
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
198
198
- command : expansions.update
199
199
params :
@@ -385,241 +385,108 @@ functions:
385
385
JAVA_VERSION="8" MONGODB_URI="${plain_auth_mongodb_uri}" .evergreen/run-plain-auth-test.sh
386
386
387
387
" add aws auth variables to file " :
388
+ - command : ec2.assume_role
389
+ params :
390
+ role_arn : ${aws_test_secrets_role}
388
391
- command : shell.exec
389
392
type : test
390
393
params :
394
+ include_expansions_in_env : [ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN" ]
395
+ shell : " bash"
391
396
working_dir : " src"
392
- silent : true
393
397
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
420
401
421
402
" run aws auth test with regular aws credentials " :
422
403
- command : shell.exec
423
404
type : test
424
405
params :
425
- working_dir : " src"
426
406
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 :
435
407
working_dir : " src"
436
- silent : true
437
408
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
447
411
448
412
" run aws auth test with assume role credentials " :
449
413
- command : shell.exec
450
414
type : test
451
415
params :
452
- working_dir : " src"
453
416
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 :
462
417
working_dir : " src"
463
- silent : true
464
418
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
479
421
480
422
" run aws auth test with aws EC2 credentials " :
481
423
- command : shell.exec
482
424
type : test
483
425
params :
484
- working_dir : " src"
485
426
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 :
494
427
working_dir : " src"
495
- shell : " bash"
496
428
script : |
497
429
${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
501
435
502
436
" run aws auth test with web identity credentials " :
503
437
- command : shell.exec
504
438
type : test
505
439
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"
517
440
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 :
528
441
working_dir : " src"
529
- shell : " bash"
530
442
script : |
531
443
${PREPARE_SHELL}
532
444
if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
533
445
echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
534
446
exit 0
535
447
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
537
453
- command : shell.exec
538
454
type : test
539
455
params :
540
- working_dir : " src"
541
456
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 :
553
457
working_dir : " src"
554
- shell : " bash"
555
458
script : |
556
459
${PREPARE_SHELL}
557
460
if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
558
461
echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
559
462
exit 0
560
463
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
562
470
563
471
" run aws auth test with aws credentials as environment variables " :
564
472
- command : shell.exec
565
473
type : test
566
474
params :
567
- working_dir : " src"
568
475
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 :
588
476
working_dir : " src"
589
477
script : |
590
478
${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
592
480
593
481
" run aws auth test with aws credentials and session token as environment variables " :
594
482
- command : shell.exec
595
483
type : test
596
484
params :
597
- working_dir : " src"
598
485
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 :
619
486
working_dir : " src"
620
487
script : |
621
488
${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
623
490
624
491
" run aws ECS auth test " :
625
492
- command : shell.exec
@@ -1099,7 +966,6 @@ tasks:
1099
966
AUTH : " auth"
1100
967
ORCHESTRATION_FILE : " auth-aws.json"
1101
968
TOPOLOGY : " server"
1102
- INSTALL_LEGACY_SHELL : " true"
1103
969
- func : " add aws auth variables to file"
1104
970
- func : " run aws auth test with regular aws credentials"
1105
971
@@ -1110,7 +976,6 @@ tasks:
1110
976
AUTH : " auth"
1111
977
ORCHESTRATION_FILE : " auth-aws.json"
1112
978
TOPOLOGY : " server"
1113
- INSTALL_LEGACY_SHELL : " true"
1114
979
- func : " add aws auth variables to file"
1115
980
- func : " run aws auth test with assume role credentials"
1116
981
@@ -1121,7 +986,6 @@ tasks:
1121
986
AUTH : " auth"
1122
987
ORCHESTRATION_FILE : " auth-aws.json"
1123
988
TOPOLOGY : " server"
1124
- INSTALL_LEGACY_SHELL : " true"
1125
989
- func : " add aws auth variables to file"
1126
990
- func : " run aws auth test with aws credentials as environment variables"
1127
991
@@ -1132,7 +996,6 @@ tasks:
1132
996
AUTH : " auth"
1133
997
ORCHESTRATION_FILE : " auth-aws.json"
1134
998
TOPOLOGY : " server"
1135
- INSTALL_LEGACY_SHELL : " true"
1136
999
- func : " add aws auth variables to file"
1137
1000
- func : " run aws auth test with aws credentials and session token as environment variables"
1138
1001
@@ -1143,7 +1006,6 @@ tasks:
1143
1006
AUTH : " auth"
1144
1007
ORCHESTRATION_FILE : " auth-aws.json"
1145
1008
TOPOLOGY : " server"
1146
- INSTALL_LEGACY_SHELL : " true"
1147
1009
- func : " add aws auth variables to file"
1148
1010
- func : " run aws auth test with aws EC2 credentials"
1149
1011
@@ -1154,7 +1016,6 @@ tasks:
1154
1016
AUTH : " auth"
1155
1017
ORCHESTRATION_FILE : " auth-aws.json"
1156
1018
TOPOLOGY : " server"
1157
- INSTALL_LEGACY_SHELL : " true"
1158
1019
- func : " add aws auth variables to file"
1159
1020
- func : " run aws auth test with web identity credentials"
1160
1021
@@ -1165,7 +1026,6 @@ tasks:
1165
1026
AUTH : " auth"
1166
1027
ORCHESTRATION_FILE : " auth-aws.json"
1167
1028
TOPOLOGY : " server"
1168
- INSTALL_LEGACY_SHELL : " true"
1169
1029
- func : " add aws auth variables to file"
1170
1030
- func : " run aws ECS auth test"
1171
1031
0 commit comments