@@ -429,6 +429,172 @@ functions:
429
429
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
430
430
PYTHON_BINARY=${PYTHON_BINARY} ATLAS_REPL='${atlas_repl}' ATLAS_SHRD='${atlas_shrd}' ATLAS_FREE='${atlas_free}' ATLAS_TLS11='${atlas_tls11}' ATLAS_TLS12='${atlas_tls12}' sh ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh
431
431
432
+ " add aws auth variables to file " :
433
+ - command : shell.exec
434
+ type : test
435
+ params :
436
+ working_dir : " src"
437
+ silent : true
438
+ script : |
439
+ cat <<EOF > ${DRIVERS_TOOLS}/.evergreen/auth_aws/aws_e2e_setup.json
440
+ {
441
+ "iam_auth_ecs_account" : "${iam_auth_ecs_account}",
442
+ "iam_auth_ecs_secret_access_key" : "${iam_auth_ecs_secret_access_key}",
443
+ "iam_auth_ecs_account_arn": "arn:aws:iam::557821124784:user/authtest_fargate_user",
444
+ "iam_auth_ecs_cluster": "${iam_auth_ecs_cluster}",
445
+ "iam_auth_ecs_task_definition": "${iam_auth_ecs_task_definition}",
446
+ "iam_auth_ecs_subnet_a": "${iam_auth_ecs_subnet_a}",
447
+ "iam_auth_ecs_subnet_b": "${iam_auth_ecs_subnet_b}",
448
+ "iam_auth_ecs_security_group": "${iam_auth_ecs_security_group}",
449
+
450
+ "iam_auth_assume_aws_account" : "${iam_auth_assume_aws_account}",
451
+ "iam_auth_assume_aws_secret_access_key" : "${iam_auth_assume_aws_secret_access_key}",
452
+ "iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
453
+
454
+ "iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
455
+ "iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
456
+ "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}"
457
+ }
458
+ EOF
459
+
460
+ " run aws auth test with regular aws credentials " :
461
+ - command : shell.exec
462
+ type : test
463
+ params :
464
+ working_dir : " src"
465
+ script : |
466
+ ${PREPARE_SHELL}
467
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
468
+ mongo aws_e2e_regular_aws.js
469
+ - command : shell.exec
470
+ type : test
471
+ params :
472
+ working_dir : " src"
473
+ silent : true
474
+ script : |
475
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
476
+ alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
477
+ USER=$(urlencode ${iam_auth_ecs_account})
478
+ PASS=$(urlencode ${iam_auth_ecs_secret_access_key})
479
+ MONGODB_URI="mongodb://$USER:$PASS@localhost"
480
+ EOF
481
+ - command : shell.exec
482
+ type : test
483
+ params :
484
+ working_dir : " src"
485
+ script : |
486
+ ${PREPARE_SHELL}
487
+ .evergreen/run-mongodb-aws-test.sh
488
+
489
+ " run aws auth test with assume role credentials " :
490
+ - command : shell.exec
491
+ type : test
492
+ params :
493
+ working_dir : " src"
494
+ script : |
495
+ ${PREPARE_SHELL}
496
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
497
+ mongo aws_e2e_assume_role.js
498
+ - command : shell.exec
499
+ type : test
500
+ params :
501
+ working_dir : " src"
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
+ alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
507
+ USER=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
508
+ USER=$(urlencode $USER)
509
+ PASS=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
510
+ PASS=$(urlencode $PASS)
511
+ SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
512
+ SESSION_TOKEN=$(urlencode $SESSION_TOKEN)
513
+ MONGODB_URI="mongodb://$USER:$PASS@localhost"
514
+ EOF
515
+ - command : shell.exec
516
+ type : test
517
+ params :
518
+ working_dir : " src"
519
+ script : |
520
+ ${PREPARE_SHELL}
521
+ .evergreen/run-mongodb-aws-test.sh
522
+
523
+ " run aws auth test with aws EC2 credentials " :
524
+ - command : shell.exec
525
+ type : test
526
+ params :
527
+ working_dir : " src"
528
+ script : |
529
+ ${PREPARE_SHELL}
530
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
531
+ mongo aws_e2e_ec2.js
532
+ - command : shell.exec
533
+ type : test
534
+ params :
535
+ working_dir : " src"
536
+ script : |
537
+ ${PREPARE_SHELL}
538
+ .evergreen/run-mongodb-aws-test.sh
539
+
540
+ " run aws auth test with aws credentials as environment variables " :
541
+ - command : shell.exec
542
+ type : test
543
+ params :
544
+ working_dir : " src"
545
+ silent : true
546
+ script : |
547
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
548
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
549
+ export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
550
+ export AWS_SECRET_ACCESS_KEY=${iam_auth_ecs_secret_access_key}
551
+ EOF
552
+ - command : shell.exec
553
+ type : test
554
+ params :
555
+ working_dir : " src"
556
+ script : |
557
+ ${PREPARE_SHELL}
558
+ PROJECT_DIRECTORY=${PROJECT_DIRECTORY} .evergreen/run-mongodb-aws-test.sh
559
+
560
+ " run aws auth test with aws credentials and session token as environment variables " :
561
+ - command : shell.exec
562
+ type : test
563
+ params :
564
+ working_dir : " src"
565
+ silent : true
566
+ script : |
567
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
568
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
569
+ export AWS_ACCESS_KEY_ID=$(jq -r '.AccessKeyId' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
570
+ export AWS_SECRET_ACCESS_KEY=$(jq -r '.SecretAccessKey' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
571
+ export AWS_SESSION_TOKEN=$(jq -r '.SessionToken' ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json)
572
+ EOF
573
+ - command : shell.exec
574
+ type : test
575
+ params :
576
+ working_dir : " src"
577
+ script : |
578
+ ${PREPARE_SHELL}
579
+ .evergreen/run-mongodb-aws-test.sh
580
+
581
+ " run aws ECS auth test " :
582
+ - command : shell.exec
583
+ type : test
584
+ params :
585
+ working_dir : " src"
586
+ script : |
587
+ ${PREPARE_SHELL}
588
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
589
+
590
+ cat <<EOF > setup.js
591
+ const mongo_binaries = "$MONGODB_BINARIES";
592
+ const project_dir = "$PROJECT_DIRECTORY";
593
+ EOF
594
+
595
+ mongo --nodb setup.js aws_e2e_ecs.js
596
+ cd -
597
+
432
598
" cleanup " :
433
599
- command : shell.exec
434
600
params :
@@ -968,6 +1134,22 @@ tasks:
968
1134
vars :
969
1135
OCSP_TLS_SHOULD_SUCCEED : " 0"
970
1136
1137
+ - name : " aws-auth-test"
1138
+ commands :
1139
+ - func : " bootstrap mongo-orchestration"
1140
+ vars :
1141
+ AUTH : " auth"
1142
+ # TODO: SSL??
1143
+ ORCHESTRATION_FILE : " auth-aws.json"
1144
+ TOPOLOGY : " server"
1145
+ - func : " add aws auth variables to file"
1146
+ - func : " run aws auth test with regular aws credentials"
1147
+ - func : " run aws auth test with assume role credentials"
1148
+ - func : " run aws auth test with aws credentials as environment variables"
1149
+ - func : " run aws auth test with aws credentials and session token as environment variables"
1150
+ - func : " run aws auth test with aws EC2 credentials"
1151
+ - func : " run aws ECS auth test"
1152
+
971
1153
# }}}
972
1154
- name : " coverage-report"
973
1155
tags : ["coverage"]
@@ -1064,6 +1246,10 @@ axes:
1064
1246
batchtime : 10080 # 7 days
1065
1247
variables :
1066
1248
libmongocrypt_url : https://s3.amazonaws.com/mciuploads/libmongocrypt/ubuntu1604/master/latest/libmongocrypt.tar.gz
1249
+ - id : ubuntu-18.04
1250
+ display_name : " Ubuntu 18.04"
1251
+ run_on : ubuntu1804-test
1252
+ batchtime : 10080 # 7 days
1067
1253
- id : ubuntu1604-arm64-small
1068
1254
display_name : " Ubuntu 16.04 (ARM64)"
1069
1255
run_on : ubuntu1604-arm64-small
@@ -1920,6 +2106,14 @@ buildvariants:
1920
2106
tasks :
1921
2107
- name : " .ocsp"
1922
2108
2109
+ - matrix_name : " aws-auth-test"
2110
+ matrix_spec :
2111
+ platform : ubuntu-18.04
2112
+ display_name : " MONGODB-AWS Auth test"
2113
+ run_on : ubuntu1804-test
2114
+ tasks :
2115
+ - name : " aws-auth-test"
2116
+
1923
2117
# Platform notes
1924
2118
# i386 builds of OpenSSL or Cyrus SASL are not available
1925
2119
# Ubuntu16.04 ppc64le is only supported by MongoDB 3.4+
0 commit comments