@@ -92,11 +92,15 @@ String s3TemporaryBasePath = System.getenv("amazon_s3_base_path_temporary")
9292String s3EC2Bucket = System . getenv(" amazon_s3_bucket_ec2" )
9393String s3EC2BasePath = System . getenv(" amazon_s3_base_path_ec2" )
9494
95+ String s3ECSBucket = System . getenv(" amazon_s3_bucket_ecs" )
96+ String s3ECSBasePath = System . getenv(" amazon_s3_base_path_ecs" )
97+
9598// If all these variables are missing then we are testing against the internal fixture instead, which has the following
9699// credentials hard-coded in.
97100
98101if (! s3PermanentAccessKey && ! s3PermanentSecretKey && ! s3PermanentBucket && ! s3PermanentBasePath
99- && ! s3EC2Bucket && ! s3EC2BasePath) {
102+ && ! s3EC2Bucket && ! s3EC2BasePath
103+ && ! s3ECSBucket && ! s3ECSBasePath) {
100104 s3PermanentAccessKey = ' s3_integration_test_permanent_access_key'
101105 s3PermanentSecretKey = ' s3_integration_test_permanent_secret_key'
102106 s3PermanentBucket = ' permanent-bucket-test'
@@ -105,10 +109,14 @@ if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3P
105109 s3EC2Bucket = ' ec2-bucket-test'
106110 s3EC2BasePath = ' integration_test'
107111
112+ s3ECSBucket = ' ecs-bucket-test'
113+ s3ECSBasePath = ' integration_test'
114+
108115 useFixture = true
109116
110117} else if (! s3PermanentAccessKey || ! s3PermanentSecretKey || ! s3PermanentBucket || ! s3PermanentBasePath
111- || ! s3EC2Bucket || ! s3EC2BasePath) {
118+ || ! s3EC2Bucket || ! s3EC2BasePath
119+ || ! s3ECSBucket || ! s3ECSBasePath) {
112120 throw new IllegalArgumentException (" not all options specified to run against external S3 service" )
113121}
114122
@@ -284,7 +292,8 @@ if (useFixture && minioDistribution) {
284292 // Minio only supports a single access key, see https://github.com/minio/minio/pull/5968
285293 integTestMinioRunner. systemProperty ' tests.rest.blacklist' , [
286294 ' repository_s3/30_repository_temporary_credentials/*' ,
287- ' repository_s3/40_repository_ec2_credentials/*'
295+ ' repository_s3/40_repository_ec2_credentials/*' ,
296+ ' repository_s3/50_repository_ecs_credentials/*'
288297 ]. join(" ," )
289298
290299 project. check. dependsOn(integTestMinio)
@@ -302,7 +311,8 @@ task s3FixtureProperties {
302311 " s3Fixture.temporary_bucket_name" : s3TemporaryBucket,
303312 " s3Fixture.temporary_key" : s3TemporaryAccessKey,
304313 " s3Fixture.temporary_session_token" : s3TemporarySessionToken,
305- " s3Fixture.ec2_bucket_name" : s3EC2Bucket
314+ " s3Fixture.ec2_bucket_name" : s3EC2Bucket,
315+ " s3Fixture.ecs_bucket_name" : s3ECSBucket
306316 ]
307317
308318 doLast {
@@ -327,7 +337,9 @@ Map<String, Object> expansions = [
327337 ' temporary_bucket' : s3TemporaryBucket,
328338 ' temporary_base_path' : s3TemporaryBasePath,
329339 ' ec2_bucket' : s3EC2Bucket,
330- ' ec2_base_path' : s3EC2BasePath
340+ ' ec2_base_path' : s3EC2BasePath,
341+ ' ecs_bucket' : s3ECSBucket,
342+ ' ecs_base_path' : s3ECSBasePath
331343]
332344
333345processTestResources {
@@ -364,6 +376,34 @@ integTestCluster {
364376 }
365377}
366378
379+ integTestRunner. systemProperty ' tests.rest.blacklist' , ' repository_s3/50_repository_ecs_credentials/*'
380+
381+ // /
382+ RestIntegTestTask integTestECS = project. tasks. create(' integTestECS' , RestIntegTestTask . class) {
383+ description = " Runs tests using the ECS repository."
384+ }
385+
386+ // The following closure must execute before the afterEvaluate block in the constructor of the following integrationTest tasks:
387+ project. afterEvaluate {
388+ ClusterConfiguration cluster = project. extensions. getByName(' integTestECSCluster' ) as ClusterConfiguration
389+ cluster. dependsOn(project. s3Fixture)
390+
391+ cluster. setting ' s3.client.integration_test_ecs.endpoint' , " http://${ -> s3Fixture.addressAndPort} "
392+
393+ Task integTestECSTask = project. tasks. getByName(' integTestECS' )
394+ integTestECSTask. clusterConfig. plugin(project. path)
395+ integTestECSTask. clusterConfig. environment ' AWS_CONTAINER_CREDENTIALS_FULL_URI' ,
396+ " http://${ -> s3Fixture.addressAndPort} /ecs_credentials_endpoint"
397+ integTestECSRunner. systemProperty ' tests.rest.blacklist' , [
398+ ' repository_s3/10_basic/*' ,
399+ ' repository_s3/20_repository_permanent_credentials/*' ,
400+ ' repository_s3/30_repository_temporary_credentials/*' ,
401+ ' repository_s3/40_repository_ec2_credentials/*'
402+ ]. join(" ," )
403+ }
404+ project. check. dependsOn(integTestECS)
405+ // /
406+
367407thirdPartyAudit. excludes = [
368408 // classes are missing
369409 ' javax.servlet.ServletContextEvent' ,
0 commit comments