@@ -150,7 +150,7 @@ functions:
150
150
${PREPARE_SHELL}
151
151
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
152
152
AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
153
- INSTALL_LEGACY_SHELL=${INSTALL_LEGACY_SHELL} bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
153
+ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
154
154
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
155
155
- command : expansions.update
156
156
params :
@@ -344,241 +344,108 @@ functions:
344
344
JAVA_VERSION="8" MONGODB_URI="${plain_auth_mongodb_uri}" .evergreen/run-plain-auth-test.sh
345
345
346
346
" add aws auth variables to file " :
347
+ - command : ec2.assume_role
348
+ params :
349
+ role_arn : ${aws_test_secrets_role}
347
350
- command : shell.exec
348
351
type : test
349
352
params :
353
+ include_expansions_in_env : [ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN" ]
354
+ shell : " bash"
350
355
working_dir : " src"
351
- silent : true
352
356
script : |
353
- cat <<EOF > ${DRIVERS_TOOLS}/.evergreen/auth_aws/aws_e2e_setup.json
354
- {
355
- "iam_auth_ecs_account" : "${iam_auth_ecs_account}",
356
- "iam_auth_ecs_secret_access_key" : "${iam_auth_ecs_secret_access_key}",
357
- "iam_auth_ecs_account_arn": "arn:aws:iam::557821124784:user/authtest_fargate_user",
358
- "iam_auth_ecs_cluster": "${iam_auth_ecs_cluster}",
359
- "iam_auth_ecs_task_definition": "${iam_auth_ecs_task_definition}",
360
- "iam_auth_ecs_subnet_a": "${iam_auth_ecs_subnet_a}",
361
- "iam_auth_ecs_subnet_b": "${iam_auth_ecs_subnet_b}",
362
- "iam_auth_ecs_security_group": "${iam_auth_ecs_security_group}",
363
-
364
- "iam_auth_assume_aws_account" : "${iam_auth_assume_aws_account}",
365
- "iam_auth_assume_aws_secret_access_key" : "${iam_auth_assume_aws_secret_access_key}",
366
- "iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
367
-
368
- "iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
369
- "iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
370
- "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}",
371
-
372
- "iam_auth_assume_web_role_name": "${iam_auth_assume_web_role_name}",
373
- "iam_web_identity_issuer": "${iam_web_identity_issuer}",
374
- "iam_web_identity_rsa_key": "${iam_web_identity_rsa_key}",
375
- "iam_web_identity_jwks_uri": "${iam_web_identity_jwks_uri}",
376
- "iam_web_identity_token_file": "${iam_web_identity_token_file}"
377
- }
378
- EOF
357
+ ${PREPARE_SHELL}
358
+ cd $DRIVERS_TOOLS/.evergreen/auth_aws
359
+ ./setup_secrets.sh drivers/aws_auth
379
360
380
361
" run aws auth test with regular aws credentials " :
381
362
- command : shell.exec
382
363
type : test
383
364
params :
384
- working_dir : " src"
385
365
shell : " bash"
386
- script : |
387
- ${PREPARE_SHELL}
388
- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
389
- . ./activate-authawsvenv.sh
390
- mongo aws_e2e_regular_aws.js
391
- - command : shell.exec
392
- type : test
393
- params :
394
366
working_dir : " src"
395
- silent : true
396
367
script : |
397
- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
398
- alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
399
- USER=$(urlencode ${iam_auth_ecs_account})
400
- PASS=$(urlencode ${iam_auth_ecs_secret_access_key})
401
- MONGODB_URI="mongodb://$USER:$PASS@localhost"
402
- EOF
403
- JAVA_VERSION=${JAVA_VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} \
404
- AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} \
405
- .evergreen/run-mongodb-aws-test.sh
368
+ ${PREPARE_SHELL}
369
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh regular
406
370
407
371
" run aws auth test with assume role credentials " :
408
372
- command : shell.exec
409
373
type : test
410
374
params :
411
- working_dir : " src"
412
375
shell : " bash"
413
- script : |
414
- ${PREPARE_SHELL}
415
- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
416
- . ./activate-authawsvenv.sh
417
- mongo aws_e2e_assume_role.js
418
- - command : shell.exec
419
- type : test
420
- params :
421
376
working_dir : " src"
422
- silent : true
423
377
script : |
424
- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
425
- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
426
- alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
427
- USER=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
428
- USER=$(urlencode $USER)
429
- PASS=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
430
- PASS=$(urlencode $PASS)
431
- SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
432
- SESSION_TOKEN=$(urlencode $SESSION_TOKEN)
433
- MONGODB_URI="mongodb://$USER:$PASS@localhost"
434
- EOF
435
- JAVA_VERSION=${JAVA_VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} DRIVERS_TOOLS=${DRIVERS_TOOLS} \
436
- AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} \
437
- .evergreen/run-mongodb-aws-test.sh
378
+ ${PREPARE_SHELL}
379
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh assume-role
438
380
439
381
" run aws auth test with aws EC2 credentials " :
440
382
- command : shell.exec
441
383
type : test
442
384
params :
443
- working_dir : " src"
444
385
shell : " bash"
445
- script : |
446
- ${PREPARE_SHELL}
447
- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
448
- . ./activate-authawsvenv.sh
449
- mongo aws_e2e_ec2.js
450
- - command : shell.exec
451
- type : test
452
- params :
453
386
working_dir : " src"
454
- shell : " bash"
455
387
script : |
456
388
${PREPARE_SHELL}
457
- # Write an empty prepare_mongodb_aws so no auth environment variables are set.
458
- echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
459
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
389
+ if [ "${SKIP_EC2_AUTH_TEST}" = "true" ]; then
390
+ echo "This platform does not support the EC2 auth test, skipping..."
391
+ exit 0
392
+ fi
393
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh ec2
460
394
461
395
" run aws auth test with web identity credentials " :
462
396
- command : shell.exec
463
397
type : test
464
398
params :
465
- working_dir : " src"
466
399
shell : " bash"
467
- script : |
468
- ${PREPARE_SHELL}
469
- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
470
- . ./activate-authawsvenv.sh
471
- mongo aws_e2e_web_identity.js
472
- - command : shell.exec
473
- type : test
474
- params :
475
400
working_dir : " src"
476
- shell : " bash"
477
- silent : true
478
- script : |
479
- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
480
- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
481
- export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
482
- export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
483
- EOF
484
- - command : shell.exec
485
- type : test
486
- params :
487
- working_dir : " src"
488
- shell : " bash"
489
401
script : |
490
402
${PREPARE_SHELL}
491
403
if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
492
404
echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
493
405
exit 0
494
406
fi
495
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
407
+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST}" = "true" ]; then
408
+ echo "This platform does not support the web identity auth test, skipping..."
409
+ exit 0
410
+ fi
411
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
496
412
- command : shell.exec
497
413
type : test
498
414
params :
499
- working_dir : " src"
500
415
shell : " bash"
501
- silent : true
502
- script : |
503
- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
504
- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
505
- export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
506
- export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
507
- export AWS_ROLE_SESSION_NAME="test"
508
- EOF
509
- - command : shell.exec
510
- type : test
511
- params :
512
416
working_dir : " src"
513
- shell : " bash"
514
417
script : |
515
418
${PREPARE_SHELL}
516
419
if [ "${AWS_CREDENTIAL_PROVIDER}" = "builtIn" ]; then
517
420
echo "Built-in AWS credential provider does not support the web identity auth test, skipping..."
518
421
exit 0
519
422
fi
520
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
423
+ if [ "${SKIP_WEB_IDENTITY_AUTH_TEST}" = "true" ]; then
424
+ echo "This platform does not support the web identity auth test, skipping..."
425
+ exit 0
426
+ fi
427
+ export AWS_ROLE_SESSION_NAME="test"
428
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh web-identity
521
429
522
430
" run aws auth test with aws credentials as environment variables " :
523
431
- command : shell.exec
524
432
type : test
525
433
params :
526
- working_dir : " src"
527
434
shell : " bash"
528
- script : |
529
- ${PREPARE_SHELL}
530
- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
531
- . ./activate-authawsvenv.sh
532
- mongo aws_e2e_regular_aws.js
533
- - command : shell.exec
534
- type : test
535
- params :
536
- working_dir : " src"
537
- silent : true
538
- script : |
539
- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
540
- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
541
- export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
542
- export AWS_SECRET_ACCESS_KEY=${iam_auth_ecs_secret_access_key}
543
- EOF
544
- - command : shell.exec
545
- type : test
546
- params :
547
435
working_dir : " src"
548
436
script : |
549
437
${PREPARE_SHELL}
550
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
438
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh env-creds
551
439
552
440
" run aws auth test with aws credentials and session token as environment variables " :
553
441
- command : shell.exec
554
442
type : test
555
443
params :
556
- working_dir : " src"
557
444
shell : " bash"
558
- script : |
559
- ${PREPARE_SHELL}
560
- cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
561
- . ./activate-authawsvenv.sh
562
- mongo aws_e2e_assume_role.js
563
- - command : shell.exec
564
- type : test
565
- params :
566
- working_dir : " src"
567
- silent : true
568
- script : |
569
- # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
570
- cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
571
- export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
572
- export AWS_SECRET_ACCESS_KEY=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
573
- export AWS_SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
574
- EOF
575
- - command : shell.exec
576
- type : test
577
- params :
578
445
working_dir : " src"
579
446
script : |
580
447
${PREPARE_SHELL}
581
- JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh
448
+ JAVA_VERSION=${JAVA_VERSION} AWS_CREDENTIAL_PROVIDER=${AWS_CREDENTIAL_PROVIDER} .evergreen/run-mongodb-aws-test.sh session-creds
582
449
583
450
" run aws ECS auth test " :
584
451
- command : shell.exec
@@ -951,7 +818,6 @@ tasks:
951
818
AUTH : " auth"
952
819
ORCHESTRATION_FILE : " auth-aws.json"
953
820
TOPOLOGY : " server"
954
- INSTALL_LEGACY_SHELL : " true"
955
821
- func : " add aws auth variables to file"
956
822
- func : " run aws auth test with regular aws credentials"
957
823
@@ -962,7 +828,6 @@ tasks:
962
828
AUTH : " auth"
963
829
ORCHESTRATION_FILE : " auth-aws.json"
964
830
TOPOLOGY : " server"
965
- INSTALL_LEGACY_SHELL : " true"
966
831
- func : " add aws auth variables to file"
967
832
- func : " run aws auth test with assume role credentials"
968
833
@@ -973,7 +838,6 @@ tasks:
973
838
AUTH : " auth"
974
839
ORCHESTRATION_FILE : " auth-aws.json"
975
840
TOPOLOGY : " server"
976
- INSTALL_LEGACY_SHELL : " true"
977
841
- func : " add aws auth variables to file"
978
842
- func : " run aws auth test with aws credentials as environment variables"
979
843
@@ -984,7 +848,6 @@ tasks:
984
848
AUTH : " auth"
985
849
ORCHESTRATION_FILE : " auth-aws.json"
986
850
TOPOLOGY : " server"
987
- INSTALL_LEGACY_SHELL : " true"
988
851
- func : " add aws auth variables to file"
989
852
- func : " run aws auth test with aws credentials and session token as environment variables"
990
853
@@ -995,7 +858,6 @@ tasks:
995
858
AUTH : " auth"
996
859
ORCHESTRATION_FILE : " auth-aws.json"
997
860
TOPOLOGY : " server"
998
- INSTALL_LEGACY_SHELL : " true"
999
861
- func : " add aws auth variables to file"
1000
862
- func : " run aws auth test with aws EC2 credentials"
1001
863
@@ -1006,7 +868,6 @@ tasks:
1006
868
AUTH : " auth"
1007
869
ORCHESTRATION_FILE : " auth-aws.json"
1008
870
TOPOLOGY : " server"
1009
- INSTALL_LEGACY_SHELL : " true"
1010
871
- func : " add aws auth variables to file"
1011
872
- func : " run aws auth test with web identity credentials"
1012
873
@@ -1017,7 +878,6 @@ tasks:
1017
878
AUTH : " auth"
1018
879
ORCHESTRATION_FILE : " auth-aws.json"
1019
880
TOPOLOGY : " server"
1020
- INSTALL_LEGACY_SHELL : " true"
1021
881
- func : " add aws auth variables to file"
1022
882
- func : " run aws ECS auth test"
1023
883
0 commit comments