@@ -76,7 +76,7 @@ functions:
76
76
export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
77
77
export PATH="$MONGODB_BINARIES:$PATH"
78
78
export PROJECT="${project}"
79
-
79
+
80
80
export AUTH=${AUTH}
81
81
export SSL=${SSL}
82
82
export TOPOLOGY=${TOPOLOGY}
@@ -90,6 +90,194 @@ functions:
90
90
params :
91
91
file : src/expansion.yml
92
92
93
+ " add aws auth variables to file " :
94
+ - command : shell.exec
95
+ type : test
96
+ params :
97
+ working_dir : " src"
98
+ silent : true
99
+ script : |
100
+ cat <<EOF > ${DRIVERS_TOOLS}/.evergreen/auth_aws/aws_e2e_setup.json
101
+ {
102
+ "iam_auth_ecs_account" : "${iam_auth_ecs_account}",
103
+ "iam_auth_ecs_secret_access_key" : "${iam_auth_ecs_secret_access_key}",
104
+ "iam_auth_ecs_account_arn": "arn:aws:iam::557821124784:user/authtest_fargate_user",
105
+ "iam_auth_ecs_cluster": "${iam_auth_ecs_cluster}",
106
+ "iam_auth_ecs_task_definition": "${iam_auth_ecs_task_definition}",
107
+ "iam_auth_ecs_subnet_a": "${iam_auth_ecs_subnet_a}",
108
+ "iam_auth_ecs_subnet_b": "${iam_auth_ecs_subnet_b}",
109
+ "iam_auth_ecs_security_group": "${iam_auth_ecs_security_group}",
110
+ "iam_auth_assume_aws_account" : "${iam_auth_assume_aws_account}",
111
+ "iam_auth_assume_aws_secret_access_key" : "${iam_auth_assume_aws_secret_access_key}",
112
+ "iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
113
+ "iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
114
+ "iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
115
+ "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}"
116
+ }
117
+ EOF
118
+
119
+ " run aws auth test with regular aws credentials " :
120
+ - command : shell.exec
121
+ type : test
122
+ params :
123
+ working_dir : " src"
124
+ script : |
125
+ ${PREPARE_SHELL}
126
+ # The aws_e2e_assume_role script requires python3 with boto3.
127
+ pip install boto3
128
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
129
+ mongo aws_e2e_regular_aws.js
130
+ - command : shell.exec
131
+ type : test
132
+ params :
133
+ working_dir : " src"
134
+ silent : true
135
+ script : |
136
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
137
+ alias urlencode='python -c "import sys, urllib as ul; sys.stdout.write(ul.quote_plus(sys.argv[1]))"'
138
+ USER=$(urlencode ${iam_auth_ecs_account})
139
+ PASS=$(urlencode ${iam_auth_ecs_secret_access_key})
140
+ MONGODB_URI="mongodb://$USER:$PASS@localhost"
141
+ EOF
142
+ - command : shell.exec
143
+ type : test
144
+ params :
145
+ working_dir : " src"
146
+ script : |
147
+ ${PREPARE_SHELL}
148
+ ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-aws-tests.sh
149
+
150
+ " run aws auth test with assume role credentials " :
151
+ - command : shell.exec
152
+ type : test
153
+ params :
154
+ working_dir : " src"
155
+ script : |
156
+ ${PREPARE_SHELL}
157
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
158
+ # The aws_e2e_assume_role script requires python3 with boto3.
159
+ pip install boto3
160
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
161
+ mongo aws_e2e_assume_role.js
162
+ - command : shell.exec
163
+ type : test
164
+ params :
165
+ working_dir : " src"
166
+ silent : true
167
+ script : |
168
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
169
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
170
+ alias urlencode='python -c "import sys, urllib as ul; sys.stdout.write(ul.quote_plus(sys.argv[1]))"'
171
+ alias jsonkey='python -c "import json,sys;sys.stdout.write(json.load(sys.stdin)[sys.argv[1]])" < ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json'
172
+ USER=$(jsonkey AccessKeyId)
173
+ USER=$(urlencode $USER)
174
+ PASS=$(jsonkey SecretAccessKey)
175
+ PASS=$(urlencode $PASS)
176
+ SESSION_TOKEN=$(jsonkey SessionToken)
177
+ SESSION_TOKEN=$(urlencode $SESSION_TOKEN)
178
+ MONGODB_URI="mongodb://$USER:$PASS@localhost"
179
+ EOF
180
+ - command : shell.exec
181
+ type : test
182
+ params :
183
+ working_dir : " src"
184
+ script : |
185
+ ${PREPARE_SHELL}
186
+ ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-aws-tests.sh
187
+
188
+ " run aws auth test with aws EC2 credentials " :
189
+ - command : shell.exec
190
+ type : test
191
+ params :
192
+ working_dir : " src"
193
+ script : |
194
+ ${PREPARE_SHELL}
195
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
196
+ mongo aws_e2e_ec2.js
197
+ - command : shell.exec
198
+ type : test
199
+ params :
200
+ working_dir : " src"
201
+ script : |
202
+ ${PREPARE_SHELL}
203
+ ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-aws-tests.sh
204
+
205
+ " run aws auth test with aws credentials as environment variables " :
206
+ - command : shell.exec
207
+ type : test
208
+ params :
209
+ working_dir : " src"
210
+ silent : true
211
+ script : |
212
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
213
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
214
+ export AWS_ACCESS_KEY_ID=${iam_auth_ecs_account}
215
+ export AWS_SECRET_ACCESS_KEY=${iam_auth_ecs_secret_access_key}
216
+ EOF
217
+ - command : shell.exec
218
+ type : test
219
+ params :
220
+ working_dir : " src"
221
+ script : |
222
+ ${PREPARE_SHELL}
223
+ ASYNC_RUNTIME=${ASYNC_RUNTIME} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} .evergreen/run-aws-tests.sh
224
+
225
+ " run aws auth test with aws credentials and session token as environment variables " :
226
+ - command : shell.exec
227
+ type : test
228
+ params :
229
+ working_dir : " src"
230
+ silent : true
231
+ script : |
232
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
233
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
234
+ alias jsonkey='python -c "import json,sys;sys.stdout.write(json.load(sys.stdin)[sys.argv[1]])" < ${DRIVERS_TOOLS}/.evergreen/auth_aws/creds.json'
235
+ export AWS_ACCESS_KEY_ID=$(jsonkey AccessKeyId)
236
+ export AWS_SECRET_ACCESS_KEY=$(jsonkey SecretAccessKey)
237
+ export AWS_SESSION_TOKEN=$(jsonkey SessionToken)
238
+ EOF
239
+ - command : shell.exec
240
+ type : test
241
+ params :
242
+ working_dir : " src"
243
+ script : |
244
+ ${PREPARE_SHELL}
245
+ ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-aws-tests.sh
246
+
247
+ " run aws ECS auth test " :
248
+ - command : shell.exec
249
+ type : test
250
+ params :
251
+ working_dir : " src"
252
+ script : |
253
+ ${PREPARE_SHELL}
254
+ AUTH_AWS_DIR=${DRIVERS_TOOLS}/.evergreen/auth_aws
255
+ ECS_SRC_DIR=$AUTH_AWS_DIR/src
256
+
257
+ mkdir -p $ECS_SRC_DIR/.evergreen
258
+
259
+ # fix issue with `TestData` in SERVER-46340
260
+ sed -i '1s+^+TestData = {};\n+' $AUTH_AWS_DIR/lib/ecs_hosted_test.js
261
+
262
+ # compile mini test project
263
+ cd $PROJECT_DIRECTORY/.evergreen/aws-ecs-test
264
+ . ~/.cargo/env
265
+ cargo build
266
+ cd -
267
+
268
+ # copy mini test binary
269
+ cp $PROJECT_DIRECTORY/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen
270
+ cp $PROJECT_DIRECTORY/.evergreen/aws-ecs-test/target/debug/aws-ecs-test $ECS_SRC_DIR
271
+
272
+ cd $AUTH_AWS_DIR
273
+ cat <<EOF > setup.js
274
+ const mongo_binaries = "$MONGODB_BINARIES";
275
+ const project_dir = "$ECS_SRC_DIR";
276
+ EOF
277
+
278
+ cat setup.js
279
+ mongo --nodb setup.js aws_e2e_ecs.js
280
+
93
281
" prepare resources " :
94
282
- command : shell.exec
95
283
params :
@@ -112,7 +300,12 @@ functions:
112
300
params :
113
301
script : |
114
302
${PREPARE_SHELL}
115
- MONGODB_VERSION=${MONGODB_VERSION} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
303
+ ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
304
+ MONGODB_VERSION=${MONGODB_VERSION} \
305
+ TOPOLOGY=${TOPOLOGY} \
306
+ AUTH=${AUTH} \
307
+ SSL=${SSL} \
308
+ sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
116
309
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
117
310
- command : expansions.update
118
311
params :
@@ -141,7 +334,7 @@ functions:
141
334
working_dir : " src"
142
335
script : |
143
336
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
144
- export MONGO_ATLAS_TESTS=1
337
+ export MONGO_ATLAS_TESTS=1
145
338
export MONGO_ATLAS_FREE_TIER_REPL_URI='${MONGO_ATLAS_FREE_TIER_REPL_URI}'
146
339
export MONGO_ATLAS_FREE_TIER_REPL_URI_SRV='${MONGO_ATLAS_FREE_TIER_REPL_URI_SRV}'
147
340
ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-atlas-tests.sh
@@ -313,7 +506,7 @@ tasks:
313
506
MONGODB_VERSION : " 4.0"
314
507
TOPOLOGY : " sharded_cluster"
315
508
- func : " run tests"
316
-
509
+
317
510
- name : " test-4.2-standalone"
318
511
tags : ["4.2", "standalone"]
319
512
commands :
@@ -341,6 +534,51 @@ tasks:
341
534
TOPOLOGY : " sharded_cluster"
342
535
- func : " run tests"
343
536
537
+ - name : " test-4.4-standalone"
538
+ tags : ["4.4", "standalone"]
539
+ commands :
540
+ - func : " bootstrap mongo-orchestration"
541
+ vars :
542
+ MONGODB_VERSION : " 4.4"
543
+ TOPOLOGY : " server"
544
+ - func : " run tests"
545
+
546
+ - name : " test-4.4-replica_set"
547
+ tags : ["4.4", "replica_set"]
548
+ commands :
549
+ - func : " bootstrap mongo-orchestration"
550
+ vars :
551
+ MONGODB_VERSION : " 4.4"
552
+ TOPOLOGY : " replica_set"
553
+ - func : " run tests"
554
+
555
+ - name : " test-4.4-sharded_cluster"
556
+ tags : ["4.4", "sharded_cluster"]
557
+ commands :
558
+ - func : " bootstrap mongo-orchestration"
559
+ vars :
560
+ MONGODB_VERSION : " 4.4"
561
+ TOPOLOGY : " sharded_cluster"
562
+ - func : " run tests"
563
+
564
+ - name : " test-4.4-aws-auth"
565
+ # "4.4" explicitly left off to keep this out of the generic matrix
566
+ tags : ["aws-auth"]
567
+ commands :
568
+ - func : " bootstrap mongo-orchestration"
569
+ vars :
570
+ ORCHESTRATION_FILE : " auth-aws.json"
571
+ MONGODB_VERSION : " 4.4"
572
+ AUTH : " auth"
573
+ TOPOLOGY : " server"
574
+ - func : " add aws auth variables to file"
575
+ - func : " run aws auth test with regular aws credentials"
576
+ - func : " run aws auth test with assume role credentials"
577
+ - func : " run aws auth test with aws credentials as environment variables"
578
+ - func : " run aws auth test with aws credentials and session token as environment variables"
579
+ - func : " run aws auth test with aws EC2 credentials"
580
+ - func : " run aws ECS auth test"
581
+
344
582
- name : " test-latest-standalone"
345
583
tags : ["latest", "standalone"]
346
584
commands :
@@ -368,6 +606,24 @@ tasks:
368
606
TOPOLOGY : " sharded_cluster"
369
607
- func : " run tests"
370
608
609
+ - name : " test-latest-aws-auth"
610
+ # "latest" explicitly left off to keep this out of the generic matrix
611
+ tags : ["aws-auth"]
612
+ commands :
613
+ - func : " bootstrap mongo-orchestration"
614
+ vars :
615
+ ORCHESTRATION_FILE : " auth-aws.json"
616
+ MONGODB_VERSION : " latest"
617
+ AUTH : " auth"
618
+ TOPOLOGY : " server"
619
+ - func : " add aws auth variables to file"
620
+ - func : " run aws auth test with regular aws credentials"
621
+ - func : " run aws auth test with assume role credentials"
622
+ - func : " run aws auth test with aws credentials as environment variables"
623
+ - func : " run aws auth test with aws credentials and session token as environment variables"
624
+ - func : " run aws auth test with aws EC2 credentials"
625
+ - func : " run aws ECS auth test"
626
+
371
627
- name : " test-atlas-connectivity"
372
628
tags : ["atlas-connect"]
373
629
commands :
@@ -453,6 +709,9 @@ axes:
453
709
- id : " os"
454
710
display_name : OS
455
711
values :
712
+ - id : ubuntu-18.04
713
+ display_name : " Ubuntu 18.04"
714
+ run_on : ubuntu1804-test
456
715
- id : ubuntu-16.04
457
716
display_name : " Ubuntu 16.04"
458
717
run_on : ubuntu1604-test
@@ -469,12 +728,15 @@ buildvariants:
469
728
-
470
729
matrix_name : " tests"
471
730
matrix_spec :
472
- os : " *"
731
+ os :
732
+ - ubuntu-16.04
733
+ - macos-10.14
473
734
auth-and-tls : " *"
474
735
async-runtime : " *"
475
736
display_name : " ${os} ${auth-and-tls} with ${async-runtime}"
476
737
tasks :
477
738
- " .latest"
739
+ - " .4.4"
478
740
- " .4.2"
479
741
- " .4.0"
480
742
- " .3.6"
@@ -487,6 +749,14 @@ buildvariants:
487
749
display_name : " Atlas Connectivity ${os} with ${async-runtime}"
488
750
tasks :
489
751
- " .atlas-connect"
752
+ - matrix_name : " aws-auth"
753
+ matrix_spec :
754
+ os :
755
+ - ubuntu-18.04
756
+ async-runtime : " tokio"
757
+ display_name : " AWS Auth ${os} with ${async-runtime}"
758
+ tasks :
759
+ - " .aws-auth"
490
760
491
761
-
492
762
name : " lint"
0 commit comments