@@ -154,7 +154,7 @@ functions:
154
154
${PREPARE_SHELL}
155
155
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
156
156
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
158
158
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
159
159
- command : expansions.update
160
160
params :
@@ -346,241 +346,100 @@ functions:
346
346
JAVA_VERSION="8" MONGODB_URI="${plain_auth_mongodb_uri}" .evergreen/run-plain-auth-test.sh
347
347
348
348
" add aws auth variables to file " :
349
+ - command : ec2.assume_role
350
+ params :
351
+ role_arn : ${aws_test_secrets_role}
349
352
- command : shell.exec
350
353
type : test
351
354
params :
355
+ include_expansions_in_env : [ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN" ]
356
+ shell : " bash"
352
357
working_dir : " src"
353
- silent : true
354
358
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
381
362
382
363
" run aws auth test with regular aws credentials " :
383
364
- command : shell.exec
384
365
type : test
385
366
params :
386
- working_dir : " src"
387
367
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 :
396
368
working_dir : " src"
397
- silent : true
398
369
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
408
372
409
373
" run aws auth test with assume role credentials " :
410
374
- command : shell.exec
411
375
type : test
412
376
params :
413
- working_dir : " src"
414
377
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 :
423
378
working_dir : " src"
424
- silent : true
425
379
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
440
382
441
383
" run aws auth test with aws EC2 credentials " :
442
384
- command : shell.exec
443
385
type : test
444
386
params :
445
- working_dir : " src"
446
387
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 :
455
388
working_dir : " src"
456
- shell : " bash"
457
389
script : |
458
390
${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
462
396
463
397
" run aws auth test with web identity credentials " :
464
398
- command : shell.exec
465
399
type : test
466
400
params :
467
- working_dir : " src"
468
401
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
402
working_dir : " src"
478
- 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 :
489
- working_dir : " src"
490
- shell : " bash"
491
403
script : |
492
404
${PREPARE_SHELL}
493
- if [ "${AWS_CREDENTIAL_PROVIDER }" = "builtIn " ]; then
494
- echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
405
+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST }" = "true " ]; then
406
+ echo "This platform does not support the web identity auth test, skipping..."
495
407
exit 0
496
408
fi
497
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
409
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
498
410
- command : shell.exec
499
411
type : test
500
412
params :
501
- working_dir : " src"
502
413
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 :
514
414
working_dir : " src"
515
- shell : " bash"
516
- script : |
415
+ script : | Remove legacy shell from test scripts
517
416
${PREPARE_SHELL}
518
- if [ "${AWS_CREDENTIAL_PROVIDER }" = "builtIn " ]; then
519
- echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
417
+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST }" = "true " ]; then
418
+ echo "This platform does not support the web identity auth test, skipping..."
520
419
exit 0
521
420
fi
522
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
421
+ export AWS_ROLE_SESSION_NAME="test"
422
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
523
423
524
424
" run aws auth test with aws credentials as environment variables " :
525
425
- command : shell.exec
526
426
type : test
527
427
params :
528
- working_dir : " src"
529
428
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 :
549
429
working_dir : " src"
550
430
script : |
551
431
${PREPARE_SHELL}
552
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
432
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh env-creds
553
433
554
434
" run aws auth test with aws credentials and session token as environment variables " :
555
435
- command : shell.exec
556
436
type : test
557
437
params :
558
- working_dir : " src"
559
438
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 :
580
439
working_dir : " src"
581
440
script : |
582
441
${PREPARE_SHELL}
583
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
442
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh session-creds
584
443
585
444
" run aws ECS auth test " :
586
445
- command : shell.exec
@@ -1063,7 +922,6 @@ tasks:
1063
922
AUTH : " auth"
1064
923
ORCHESTRATION_FILE : " auth-aws.json"
1065
924
TOPOLOGY : " server"
1066
- INSTALL_LEGACY_SHELL : " true"
1067
925
- func : " add aws auth variables to file"
1068
926
- func : " run aws auth test with regular aws credentials"
1069
927
@@ -1074,7 +932,6 @@ tasks:
1074
932
AUTH : " auth"
1075
933
ORCHESTRATION_FILE : " auth-aws.json"
1076
934
TOPOLOGY : " server"
1077
- INSTALL_LEGACY_SHELL : " true"
1078
935
- func : " add aws auth variables to file"
1079
936
- func : " run aws auth test with assume role credentials"
1080
937
@@ -1085,7 +942,6 @@ tasks:
1085
942
AUTH : " auth"
1086
943
ORCHESTRATION_FILE : " auth-aws.json"
1087
944
TOPOLOGY : " server"
1088
- INSTALL_LEGACY_SHELL : " true"
1089
945
- func : " add aws auth variables to file"
1090
946
- func : " run aws auth test with aws credentials as environment variables"
1091
947
@@ -1096,7 +952,6 @@ tasks:
1096
952
AUTH : " auth"
1097
953
ORCHESTRATION_FILE : " auth-aws.json"
1098
954
TOPOLOGY : " server"
1099
- INSTALL_LEGACY_SHELL : " true"
1100
955
- func : " add aws auth variables to file"
1101
956
- func : " run aws auth test with aws credentials and session token as environment variables"
1102
957
@@ -1107,7 +962,6 @@ tasks:
1107
962
AUTH : " auth"
1108
963
ORCHESTRATION_FILE : " auth-aws.json"
1109
964
TOPOLOGY : " server"
1110
- INSTALL_LEGACY_SHELL : " true"
1111
965
- func : " add aws auth variables to file"
1112
966
- func : " run aws auth test with aws EC2 credentials"
1113
967
@@ -1118,7 +972,6 @@ tasks:
1118
972
AUTH : " auth"
1119
973
ORCHESTRATION_FILE : " auth-aws.json"
1120
974
TOPOLOGY : " server"
1121
- INSTALL_LEGACY_SHELL : " true"
1122
975
- func : " add aws auth variables to file"
1123
976
- func : " run aws auth test with web identity credentials"
1124
977
@@ -1129,7 +982,6 @@ tasks:
1129
982
AUTH : " auth"
1130
983
ORCHESTRATION_FILE : " auth-aws.json"
1131
984
TOPOLOGY : " server"
1132
- INSTALL_LEGACY_SHELL : " true"
1133
985
- func : " add aws auth variables to file"
1134
986
- func : " run aws ECS auth test"
1135
987
0 commit comments