aws-sdk-core 2.0.0.rc4 → 2.0.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/apis/CloudFront-2013-11-11.json +5502 -0
- data/apis/CloudWatch-2010-08-01.json +186 -1
- data/apis/DirectConnect-2012-10-25.json +758 -140
- data/apis/DynamoDB-2012-08-10.json +860 -2
- data/apis/EC2-2013-10-15.json +14698 -0
- data/apis/EMR-2009-03-31.json +86 -0
- data/apis/ElastiCache-2013-06-15.json +13 -5
- data/apis/ElasticBeanstalk-2010-12-01.json +141 -16
- data/apis/ElasticLoadBalancing-2012-06-01.json +0 -72
- data/apis/IAM-2010-05-08.json +156 -0
- data/apis/Kinesis-2013-12-02.json +9 -1
- data/apis/OpsWorks-2013-02-18.json +180 -6
- data/apis/RDS-2013-02-12.json +2 -1
- data/apis/RDS-2013-09-09.json +7963 -0
- data/apis/Redshift-2012-12-01.json +3273 -702
- data/apis/Route53-2012-12-12.json +2 -2
- data/apis/S3-2006-03-01.json +579 -538
- data/apis/SNS-2010-03-31.json +14 -0
- data/apis/SQS-2012-11-05.json +43 -6
- data/apis/STS-2011-06-15.json +81 -0
- data/apis/StorageGateway-2013-06-30.json +28 -28
- data/apis/source/cloudformation-2010-05-15.json +199 -199
- data/apis/source/cloudfront-2013-11-11.json +8828 -0
- data/apis/source/cloudfront-2013-11-11.paginators.json +32 -0
- data/apis/source/cloudfront-2013-11-11.waiters.json +29 -0
- data/apis/source/cloudsearch-2011-02-01.json +16 -23
- data/apis/source/datapipeline-2012-10-29.paginators.json +3 -2
- data/apis/source/directconnect-2012-10-25.json +1302 -363
- data/apis/source/dynamodb-2011-12-05.paginators.json +4 -1
- data/apis/source/dynamodb-2011-12-05.waiters.json +27 -0
- data/apis/source/dynamodb-2012-08-10.json +1634 -417
- data/apis/source/dynamodb-2012-08-10.paginators.json +4 -1
- data/apis/source/dynamodb-2012-08-10.waiters.json +25 -0
- data/apis/source/ec2-2013-10-15.json +19911 -0
- data/apis/source/ec2-2013-10-15.paginators.json +126 -0
- data/apis/source/ec2-2013-10-15.waiters.json +146 -0
- data/apis/source/elasticache-2013-06-15.json +10 -8
- data/apis/source/elasticache-2013-06-15.paginators.json +8 -2
- data/apis/source/elasticbeanstalk-2010-12-01.json +186 -32
- data/apis/source/elasticloadbalancing-2012-06-01.json +166 -293
- data/apis/source/elasticmapreduce-2009-03-31.json +229 -134
- data/apis/source/elastictranscoder-2012-09-25.json +1 -1
- data/apis/source/glacier-2012-06-01.paginators.json +3 -3
- data/apis/source/glacier-2012-06-01.waiters.json +23 -0
- data/apis/source/iam-2010-05-08.json +1306 -626
- data/apis/source/iam-2010-05-08.paginators.json +3 -0
- data/apis/source/kinesis-2013-12-02.json +4 -4
- data/apis/source/kinesis-2013-12-02.paginators.json +10 -4
- data/apis/source/monitoring-2010-08-01.json +336 -28
- data/apis/source/opsworks-2013-02-18.json +385 -102
- data/apis/source/rds-2013-01-10.paginators.json +6 -2
- data/apis/source/rds-2013-02-12.paginators.json +6 -2
- data/apis/source/rds-2013-09-09.json +10658 -0
- data/apis/source/rds-2013-09-09.paginators.json +110 -0
- data/apis/source/rds-2013-09-09.waiters.json +36 -0
- data/apis/source/redshift-2012-12-01.json +4759 -1237
- data/apis/source/redshift-2012-12-01.paginators.json +20 -1
- data/apis/source/redshift-2012-12-01.waiters.json +43 -0
- data/apis/source/route53-2012-12-12.paginators.json +2 -2
- data/apis/source/s3-2006-03-01.json +1032 -985
- data/apis/source/s3-2006-03-01.paginators.json +14 -3
- data/apis/source/s3-2006-03-01.waiters.json +27 -0
- data/apis/source/sns-2010-03-31.paginators.json +10 -0
- data/apis/source/sqs-2012-11-05.json +153 -101
- data/apis/source/storagegateway-2013-06-30.json +403 -442
- data/apis/source/storagegateway-2013-06-30.paginators.json +24 -0
- data/apis/source/sts-2011-06-15.json +258 -75
- data/apis/source/support-2013-04-15.paginators.json +0 -6
- data/apis/source/swf-2012-01-25.paginators.json +7 -7
- data/features/autoscaling/client.feature +6 -10
- data/features/autoscaling/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudformation/client.feature +5 -6
- data/features/cloudformation/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudfront/client.feature +5 -9
- data/features/cloudfront/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudsearch/client.feature +4 -6
- data/features/cloudsearch/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudwatch/client.feature +7 -9
- data/features/cloudwatch/{setup.rb → step_definitions.rb} +1 -1
- data/features/datapipeline/client.feature +5 -7
- data/features/datapipeline/{setup.rb → step_definitions.rb} +1 -1
- data/features/directconnect/client.feature +5 -7
- data/features/directconnect/{setup.rb → step_definitions.rb} +1 -1
- data/features/dynamodb/client.feature +6 -10
- data/features/dynamodb/simplified.feature +5 -9
- data/features/dynamodb/step_definitions.rb +9 -1
- data/features/ec2/client.feature +4 -9
- data/features/ec2/step_definitions.rb +3 -16
- data/features/elasticache/client.feature +4 -6
- data/features/elasticache/{setup.rb → step_definitions.rb} +1 -1
- data/features/elasticbeanstalk/client.feature +4 -6
- data/features/elasticbeanstalk/{setup.rb → step_definitions.rb} +1 -1
- data/features/elasticloadbalancing/client.feature +4 -6
- data/features/elasticloadbalancing/{setup.rb → step_definitions.rb} +1 -1
- data/features/elastictranscoder/client.feature +4 -6
- data/features/elastictranscoder/{setup.rb → step_definitions.rb} +1 -1
- data/features/emr/client.feature +4 -6
- data/features/emr/{setup.rb → step_definitions.rb} +1 -1
- data/features/env.rb +0 -2
- data/features/glacier/client.feature +10 -34
- data/features/glacier/step_definitions.rb +25 -8
- data/features/glacier/upload.feature +27 -0
- data/features/iam/client.feature +4 -6
- data/features/iam/{setup.rb → step_definitions.rb} +1 -1
- data/features/importexport/client.feature +4 -6
- data/features/importexport/{setup.rb → step_definitions.rb} +1 -1
- data/features/kinesis/client.feature +4 -6
- data/features/kinesis/{setup.rb → step_definitions.rb} +1 -1
- data/features/opsworks/client.feature +4 -6
- data/features/opsworks/{setup.rb → step_definitions.rb} +1 -1
- data/features/rds/client.feature +4 -6
- data/features/rds/{setup.rb → step_definitions.rb} +1 -1
- data/features/redshift/client.feature +4 -6
- data/features/redshift/{setup.rb → step_definitions.rb} +1 -1
- data/features/route53/client.feature +4 -6
- data/features/route53/{setup.rb → step_definitions.rb} +1 -1
- data/features/s3/buckets.feature +8 -0
- data/features/s3/step_definitions.rb +42 -3
- data/features/sdb/client.feature +4 -6
- data/features/sdb/{setup.rb → step_definitions.rb} +1 -1
- data/features/ses/client.feature +4 -6
- data/features/ses/{setup.rb → step_definitions.rb} +1 -1
- data/features/sns/client.feature +5 -6
- data/features/sns/{setup.rb → step_definitions.rb} +1 -1
- data/features/sqs/client.feature +5 -7
- data/features/sqs/step_definitions.rb +11 -0
- data/features/step_definitions.rb +88 -0
- data/features/storagegateway/client.feature +4 -6
- data/features/storagegateway/{setup.rb → step_definitions.rb} +1 -1
- data/features/sts/client.feature +5 -6
- data/features/sts/{setup.rb → step_definitions.rb} +1 -1
- data/features/swf/client.feature +5 -9
- data/features/swf/{setup.rb → step_definitions.rb} +1 -1
- data/lib/aws/api/shape_translator.rb +1 -0
- data/lib/aws/errors.rb +35 -11
- data/lib/aws/plugins/credentials.rb +11 -5
- data/lib/aws/plugins/regional_endpoint.rb +7 -3
- data/lib/aws/plugins/s3_regional_endpoint.rb +0 -2
- data/lib/aws/request_handler.rb +8 -3
- data/lib/aws/signers/s3.rb +14 -18
- data/lib/aws/version.rb +1 -1
- data/spec/aws/errors_spec.rb +39 -0
- data/spec/aws/plugins/credentials_spec.rb +12 -0
- data/spec/aws/plugins/region_endpoint_spec.rb +16 -4
- data/spec/aws/plugins/retry_errors_spec.rb +26 -26
- data/spec/aws/service_spec.rb +1 -1
- data/spec/fixtures/operations/route53/change_resource_record_sets.yml +18 -0
- data/tasks/test.rake +6 -18
- data/vendor/seahorse/lib/seahorse/client/http/headers.rb +20 -0
- data/vendor/seahorse/tasks/test.rake +2 -15
- metadata +77 -64
- data/features/common/step_definitions.rb +0 -63
- data/features/dynamodb/setup.rb +0 -8
- data/features/ec2/setup.rb +0 -6
- data/features/glacier/setup.rb +0 -16
- data/features/s3/setup.rb +0 -17
- data/features/sqs/setup.rb +0 -10
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Elastic Load Balancing
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "DescribeLoadBalancers" API
|
7
|
+
Then the response should contain a list of "LoadBalancerDescriptions"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ load_balancer_names: ['fake_load_balancer'] }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DescribeLoadBalancers" API with:
|
11
|
+
| LoadBalancerNames | ['fake_load_balancer'] |
|
14
12
|
Then I expect the response error code to be "ValidationError"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon Elastic Transcoder
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListPresets" API
|
7
|
+
Then the response should contain a list of "Presets"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ id: 'fake_job' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "ReadJob" API with:
|
11
|
+
| Id | fake_job |
|
14
12
|
Then I expect the response error code to be "ValidationException"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/emr/client.feature
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon EMR
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "DescribeJobFlows" API
|
7
|
+
Then the response should contain a list of "JobFlows"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ job_flow_ids: ['fake_job_flow'] }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DescribeJobFlows" API with:
|
11
|
+
| JobFlowIds | ['fake_job_flow'] |
|
14
12
|
Then I expect the response error code to be "ValidationException"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/env.rb
CHANGED
@@ -1,41 +1,17 @@
|
|
1
1
|
# language: en
|
2
|
-
@glacier
|
2
|
+
@glacier @client
|
3
3
|
Feature: Amazon Glacier
|
4
4
|
|
5
|
-
Scenario:
|
6
|
-
When I call "
|
7
|
-
|
8
|
-
|
9
|
-
"""
|
10
|
-
Then the response data should include "vault_list"
|
11
|
-
And the response "vault_list" should be an array
|
12
|
-
|
13
|
-
@upload
|
14
|
-
Scenario: Uploading an archive from a string
|
15
|
-
When I upload an archive with the contents "Hello World!"
|
16
|
-
Then I should be able to delete the archive
|
17
|
-
|
18
|
-
@upload @slow
|
19
|
-
Scenario: Uploading and deleting an archive
|
20
|
-
When I upload an archive from a 5.5MB large file
|
21
|
-
Then I should be able to delete the archive
|
22
|
-
|
23
|
-
@multipart @upload @slow
|
24
|
-
Scenario: Using multipart upload interface
|
25
|
-
When I multipart-upload a 15.5MB file in 1048576 byte chunks
|
26
|
-
Then I should be able to delete the archive
|
27
|
-
|
28
|
-
# There was an issue where the client would fail attempting to compute
|
29
|
-
# a checksum of an empty body, this step ensures that the checksum
|
30
|
-
# computation does not hang.
|
31
|
-
@upload
|
32
|
-
Scenario: Attempting to upload an empty archive
|
33
|
-
When I upload an archive with the contents ""
|
34
|
-
Then a "InvalidParameterValueException" error should be raised
|
5
|
+
Scenario: Making a basic request
|
6
|
+
When I call the "ListVaults" API with:
|
7
|
+
| AccountId | - |
|
8
|
+
Then the response should contain a "VaultList"
|
35
9
|
|
36
10
|
Scenario: Error handling
|
37
|
-
When I call "
|
11
|
+
When I attempt to call the "ListVaults" API with:
|
12
|
+
| AccountId | abcmnoxyz |
|
13
|
+
Then I expect the response error code to be "AccessDeniedException"
|
14
|
+
And I expect the response error message to include:
|
38
15
|
"""
|
39
|
-
|
16
|
+
Access denied
|
40
17
|
"""
|
41
|
-
Then a "AccessDeniedException" error should be raised
|
@@ -1,8 +1,15 @@
|
|
1
|
+
Before("@glacier") do
|
2
|
+
@glacier = @client = Aws.glacier
|
3
|
+
end
|
4
|
+
|
5
|
+
After("@glacier") do
|
6
|
+
end
|
7
|
+
|
1
8
|
def upload_glacier_archive(contents)
|
2
|
-
resp =
|
9
|
+
resp = @glacier.upload_archive(
|
3
10
|
vault_name: @vault_name,
|
4
|
-
body: contents
|
5
|
-
|
11
|
+
body: contents
|
12
|
+
)
|
6
13
|
@archive_id = resp.data.archive_id if resp.data
|
7
14
|
end
|
8
15
|
|
@@ -17,8 +24,21 @@ def bytes(megabytes)
|
|
17
24
|
megabytes.to_f * 1024 * 1024
|
18
25
|
end
|
19
26
|
|
27
|
+
Given(/^I have a vault ready to receive uploads$/) do
|
28
|
+
# ensure we have a suitable vault for testing with
|
29
|
+
@vault_name = 'aws-sdk-core-integration-test-vault'
|
30
|
+
begin
|
31
|
+
@glacier.describe_vault(vault_name: @vault_name, account_id: '-')
|
32
|
+
rescue Aws::Glacier::Errors::ResourceNotFoundException
|
33
|
+
@glacier.create_vault(vault_name: @vault_name, account_id: '-')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
20
37
|
When(/^I upload an archive with the contents "(.*?)"$/) do |contents|
|
21
|
-
|
38
|
+
begin
|
39
|
+
upload_glacier_archive(contents)
|
40
|
+
rescue => @error
|
41
|
+
end
|
22
42
|
end
|
23
43
|
|
24
44
|
When(/^I upload an archive from a ([0-9\.]+)MB large file$/) do |size_in_mb|
|
@@ -69,8 +89,5 @@ When(/^I multipart\-upload a ([0-9\.]+)MB file in ([0-9\.]+) byte chunks$/) do |
|
|
69
89
|
end
|
70
90
|
|
71
91
|
Then(/^I should be able to delete the archive$/) do
|
72
|
-
|
73
|
-
vault_name: @vault_name,
|
74
|
-
archive_id: @archive_id,
|
75
|
-
})
|
92
|
+
@glacier.delete_archive(vault_name: @vault_name, archive_id: @archive_id)
|
76
93
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# language: en
|
2
|
+
@glacier @upload
|
3
|
+
Feature: Amazon Glacier
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given I have a vault ready to receive uploads
|
7
|
+
|
8
|
+
Scenario: Uploading an archive from a string
|
9
|
+
When I upload an archive with the contents "Hello World!"
|
10
|
+
Then I should be able to delete the archive
|
11
|
+
|
12
|
+
@slow
|
13
|
+
Scenario: Uploading and deleting an archive
|
14
|
+
When I upload an archive from a 5.5MB large file
|
15
|
+
Then I should be able to delete the archive
|
16
|
+
|
17
|
+
@multipart @slow
|
18
|
+
Scenario: Using multipart upload interface
|
19
|
+
When I multipart-upload a 15.5MB file in 1048576 byte chunks
|
20
|
+
Then I should be able to delete the archive
|
21
|
+
|
22
|
+
# There was an issue where the client would fail attempting to compute
|
23
|
+
# a checksum of an empty body, this step ensures that the checksum
|
24
|
+
# computation does not hang.
|
25
|
+
Scenario: Attempting to upload an empty archive
|
26
|
+
When I upload an archive with the contents ""
|
27
|
+
Then I expect the response error code to be "InvalidParameterValueException"
|
data/features/iam/client.feature
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: AWS Identity and Access Management
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListUsers" API
|
7
|
+
Then the response should contain a list of "Users"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ user_name: 'fake_user' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "GetUser" API with:
|
11
|
+
| UserName | fake_user |
|
14
12
|
Then I expect the response error code to be "NoSuchEntity"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: AWS Import/Export
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListJobs" API
|
7
|
+
Then the response should contain a list of "Jobs"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ job_id: 'fake_job' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "GetStatus" API with:
|
11
|
+
| JobId | fake_job |
|
14
12
|
Then I expect the response error code to be "InvalidJobIdException"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: AWS Kinesis
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListStreams" API
|
7
|
+
Then the response should contain a list of "StreamNames"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ stream_name: 'bogus-stream-name' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DescribeStream" API with:
|
11
|
+
| StreamName | bogus-stream-name |
|
14
12
|
Then I expect the response error code to be "ResourceNotFoundException"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: AWS OpsWorks
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "DescribeStacks" API
|
7
|
+
Then the response should contain a list of "Stacks"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ stack_id: 'fake_stack' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DescribeLayers" API with:
|
11
|
+
| StackId | fake_stack |
|
14
12
|
Then I expect the response error code to be "ResourceNotFoundException"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/rds/client.feature
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon RDS
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "DescribeDbEngineVersions" API
|
7
|
+
Then the response should contain a list of "DbEngineVersions"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ db_instance_identifier: 'fake-id' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DescribeDbInstances" API with:
|
11
|
+
| DbInstanceIdentifier | fake-id |
|
14
12
|
Then I expect the response error code to be "DBInstanceNotFound"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon Redshift
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "DescribeClusterVersions" API
|
7
|
+
Then the response should contain a list of "ClusterVersions"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ cluster_identifier: 'fake-cluster' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DescribeClusters" API with:
|
11
|
+
| ClusterIdentifier | fake-cluster |
|
14
12
|
Then I expect the response error code to be "ClusterNotFound"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon Route 53
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListHostedZones" API
|
7
|
+
Then the response should contain a list of "HostedZones"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ id: 'fake-zone' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "GetHostedZone" API with:
|
11
|
+
| Id | fake-zone |
|
14
12
|
Then I expect the response error code to be "NoSuchHostedZone"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/s3/buckets.feature
CHANGED
@@ -30,3 +30,11 @@ Feature: S3 Buckets
|
|
30
30
|
Given I am using the S3 "http://s3.amazonaws.com" endpoint
|
31
31
|
When I create a bucket with a DNS compatible name that contains a dot
|
32
32
|
Then I should be able to delete the bucket
|
33
|
+
|
34
|
+
@force_path_style
|
35
|
+
Scenario: Operating on a bucket/object using path style
|
36
|
+
Given I force path style requests
|
37
|
+
And I create a DNS compatible bucket
|
38
|
+
When I put "abc" to the key "object-key"
|
39
|
+
Then the bucket name should be in the request path
|
40
|
+
And the bucket name should not be in the request host
|
@@ -1,3 +1,21 @@
|
|
1
|
+
Before("@s3") do
|
2
|
+
@s3 = @client = Aws.s3
|
3
|
+
@created_buckets = []
|
4
|
+
end
|
5
|
+
|
6
|
+
After("@s3") do
|
7
|
+
@created_buckets.each do |bucket|
|
8
|
+
loop do
|
9
|
+
objects = @s3.list_object_versions(bucket: bucket).data.versions.map do |v|
|
10
|
+
{ key: v.key, version_id: v.version_id }
|
11
|
+
end
|
12
|
+
break if objects.empty?
|
13
|
+
@s3.delete_objects(bucket: bucket, delete: { objects: objects })
|
14
|
+
end
|
15
|
+
@s3.delete_bucket(bucket: bucket)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
1
19
|
def create_bucket(options = {})
|
2
20
|
@bucket_name = "aws-sdk-test-#{Time.now.to_i}-#{rand(1000)}"
|
3
21
|
options[:bucket] = @bucket_name
|
@@ -10,6 +28,10 @@ def create_bucket(options = {})
|
|
10
28
|
@created_buckets << @bucket_name
|
11
29
|
end
|
12
30
|
|
31
|
+
When(/^I force path style requests$/) do
|
32
|
+
@s3 = Aws.s3(force_path_style:true)
|
33
|
+
end
|
34
|
+
|
13
35
|
Given(/^I am using the S3 "(.*?)" region$/) do |region|
|
14
36
|
@s3 = Aws.s3(region: region)
|
15
37
|
end
|
@@ -18,6 +40,10 @@ When(/^I create a bucket$/) do
|
|
18
40
|
create_bucket
|
19
41
|
end
|
20
42
|
|
43
|
+
Given(/^I create a DNS compatible bucket$/) do
|
44
|
+
create_bucket
|
45
|
+
end
|
46
|
+
|
21
47
|
When(/^I create a bucket with the location constraint "(.*?)"$/) do |loc|
|
22
48
|
create_bucket(create_bucket_configuration: {
|
23
49
|
location_constraint: loc
|
@@ -40,8 +66,11 @@ end
|
|
40
66
|
|
41
67
|
Then(/^the bucket should not exist$/) do
|
42
68
|
eventually do
|
43
|
-
|
44
|
-
|
69
|
+
begin
|
70
|
+
@s3.get_bucket_location(bucket: @bucket_name)
|
71
|
+
rescue => @error
|
72
|
+
end
|
73
|
+
expect(@error).to be_kind_of(Aws::S3::Errors::NoSuchBucket)
|
45
74
|
end
|
46
75
|
end
|
47
76
|
|
@@ -50,7 +79,7 @@ When(/^I put nothing to the key "(.*?)"$/) do |key|
|
|
50
79
|
end
|
51
80
|
|
52
81
|
When(/^I put "(.*?)" to the key "(.*?)"$/) do |data, key|
|
53
|
-
@s3.put_object(bucket: @bucket_name, key: key, body: data)
|
82
|
+
@response = @s3.put_object(bucket: @bucket_name, key: key, body: data)
|
54
83
|
end
|
55
84
|
|
56
85
|
When(/^I put the test png to the key "(.*?)"$/) do |key|
|
@@ -92,3 +121,13 @@ end
|
|
92
121
|
Then(/^I should be able to delete the bucket$/) do
|
93
122
|
@s3.delete_bucket(bucket: @bucket_name)
|
94
123
|
end
|
124
|
+
|
125
|
+
Then(/^the bucket name should be in the request path$/) do
|
126
|
+
endpoint = @response.context.http_request.endpoint
|
127
|
+
expect(endpoint.path).to include(@bucket_name)
|
128
|
+
end
|
129
|
+
|
130
|
+
Then(/^the bucket name should not be in the request host$/) do
|
131
|
+
endpoint = @response.context.http_request.endpoint
|
132
|
+
expect(endpoint.host).not_to include(@bucket_name)
|
133
|
+
end
|