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