@@ -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,108 @@ 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
- 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"
478
401
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
402
working_dir : " src"
490
- shell : " bash"
491
403
script : |
492
404
${PREPARE_SHELL}
493
405
if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
494
406
echo "Built-in AWS credential provider 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
+ 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
498
414
- command : shell.exec
499
415
type : test
500
416
params :
501
- working_dir : " src"
502
417
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
418
working_dir : " src"
515
- shell : " bash"
516
419
script : |
517
420
${PREPARE_SHELL}
518
421
if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
519
422
echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
520
423
exit 0
521
424
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
523
431
524
432
" run aws auth test with aws credentials as environment variables " :
525
433
- command : shell.exec
526
434
type : test
527
435
params :
528
- working_dir : " src"
529
436
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
437
working_dir : " src"
550
438
script : |
551
439
${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
553
441
554
442
" run aws auth test with aws credentials and session token as environment variables " :
555
443
- command : shell.exec
556
444
type : test
557
445
params :
558
- working_dir : " src"
559
446
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
447
working_dir : " src"
581
448
script : |
582
449
${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
584
451
585
452
" run aws ECS auth test " :
586
453
- command : shell.exec
@@ -1063,7 +930,6 @@ tasks:
1063
930
AUTH : " auth"
1064
931
ORCHESTRATION_FILE : " auth-aws.json"
1065
932
TOPOLOGY : " server"
1066
- INSTALL_LEGACY_SHELL : " true"
1067
933
- func : " add aws auth variables to file"
1068
934
- func : " run aws auth test with regular aws credentials"
1069
935
@@ -1074,7 +940,6 @@ tasks:
1074
940
AUTH : " auth"
1075
941
ORCHESTRATION_FILE : " auth-aws.json"
1076
942
TOPOLOGY : " server"
1077
- INSTALL_LEGACY_SHELL : " true"
1078
943
- func : " add aws auth variables to file"
1079
944
- func : " run aws auth test with assume role credentials"
1080
945
@@ -1085,7 +950,6 @@ tasks:
1085
950
AUTH : " auth"
1086
951
ORCHESTRATION_FILE : " auth-aws.json"
1087
952
TOPOLOGY : " server"
1088
- INSTALL_LEGACY_SHELL : " true"
1089
953
- func : " add aws auth variables to file"
1090
954
- func : " run aws auth test with aws credentials as environment variables"
1091
955
@@ -1096,7 +960,6 @@ tasks:
1096
960
AUTH : " auth"
1097
961
ORCHESTRATION_FILE : " auth-aws.json"
1098
962
TOPOLOGY : " server"
1099
- INSTALL_LEGACY_SHELL : " true"
1100
963
- func : " add aws auth variables to file"
1101
964
- func : " run aws auth test with aws credentials and session token as environment variables"
1102
965
@@ -1107,7 +970,6 @@ tasks:
1107
970
AUTH : " auth"
1108
971
ORCHESTRATION_FILE : " auth-aws.json"
1109
972
TOPOLOGY : " server"
1110
- INSTALL_LEGACY_SHELL : " true"
1111
973
- func : " add aws auth variables to file"
1112
974
- func : " run aws auth test with aws EC2 credentials"
1113
975
@@ -1118,7 +980,6 @@ tasks:
1118
980
AUTH : " auth"
1119
981
ORCHESTRATION_FILE : " auth-aws.json"
1120
982
TOPOLOGY : " server"
1121
- INSTALL_LEGACY_SHELL : " true"
1122
983
- func : " add aws auth variables to file"
1123
984
- func : " run aws auth test with web identity credentials"
1124
985
@@ -1129,7 +990,6 @@ tasks:
1129
990
AUTH : " auth"
1130
991
ORCHESTRATION_FILE : " auth-aws.json"
1131
992
TOPOLOGY : " server"
1132
- INSTALL_LEGACY_SHELL : " true"
1133
993
- func : " add aws auth variables to file"
1134
994
- func : " run aws ECS auth test"
1135
995
0 commit comments