Skip to content

Commit

Permalink
Version 1.3.9 of the AWS SDK for Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorrowe committed Mar 31, 2012
1 parent 8c9db39 commit e63c07e
Show file tree
Hide file tree
Showing 89 changed files with 8,001 additions and 439 deletions.
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source 'http://rubygems.org'

gem 'uuidtools', '~> 2.1'
gem 'httparty', '~> 0.7'
gem 'nokogiri', '<= 1.5.0'
gem 'nokogiri', '>= 1.4.4'
gem 'json', '~> 1.4.6'

group :debug do
Expand All @@ -37,12 +37,9 @@ end
group :build do
gem 'rspec', '2.5'
gem 'rcov', '0.9.9'
gem 'hanna', '0.1.12', :require => 'hanna/rdoctask'
gem 'rspec', '2.5', :require => 'rspec/core/rake_task'
gem 'ci_reporter', '~> 1.6', :require => 'ci/reporter/rake/rspec'
gem 'flog', '~> 2.5'
gem 'yard', '~> 0.7.3'
gem 'chronic', '~> 0.5', :platforms => [:ruby]
end

group :integration do
Expand Down
21 changes: 21 additions & 0 deletions features/auto_scaling/activities.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @activities
Feature: Auto Scaling Activities

Scenario: Creating a policy
Given I create a launch configuration
And I create an auto scaling group
Then the auto scaling group should have some activities
68 changes: 68 additions & 0 deletions features/auto_scaling/groups.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @groups
Feature: Auto Scaling Groups

Scenario: Creating an auto scaling group
Given I create a launch configuration
When I create an auto scaling group
Then the auto scaling group should exist

Scenario: Getting an auto scaling group
Given I create a launch configuration
When I create an auto scaling group
And I get the auto scaling group by name
Then the auto scaling group should have the options I created it with

Scenario: Deleting an auto scaling group
Given I create a launch configuration
And I create an auto scaling group
When I delete the auto scaling group
Then the auto scaling group should not exist

Scenario: Suspending processes
Given I create a launch configuration
And I create an auto scaling group
When I suspend the "Launch" process
Then the auto scaling group should contain "Launch" in the suspended processes

Scenario: Suspending all processes
Given I create a launch configuration
And I create an auto scaling group
When I suspend all processes
Then the auto scaling group should have all processes suspended

Scenario: Resuming processes
Given I create a launch configuration
And I create an auto scaling group
And I suspend the "Launch" process
When I resume the "Launch" process
Then the auto scaling group should not contain "Launch" in the suspended processes

Scenario: Resuming all processes
Given I create a launch configuration
And I create an auto scaling group
And I suspend all processes
When I resume all processes
Then the auto scaling group should have no suspended processes

Scenario: Metrics collection
Given I create a launch configuration
And I create an auto scaling group
When I enable all metrics collection
Then the auto scaling group should have all metrics enabled for "1Minute"
When I disable all metrics collection
Then the auto scaling group should have no enabled metrics.

27 changes: 27 additions & 0 deletions features/auto_scaling/instances.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @instances
Feature: Auto Scaling Instances

@slow
Scenario: Creating notification configurations
Given I create a launch configuration
When I create an auto scaling group
Then eventually there should be an auto scaling instance
And the auto scaling instance should exist
And the auto scaling should have a matching ec2 instance
And the auto scaling should have a matching ec2 instance
And the auto scaling should have the correct launch configuration
And the auto scaling should have the correct launch configuration
34 changes: 34 additions & 0 deletions features/auto_scaling/launch_configurations.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @launch_configurations
Feature: Auto Scaling Launch Configurations

Scenario: Creating a launch configuration
When I create a launch configuration
Then the launch configuration should exist

Scenario: Deleting a launch configuration
Given I create a launch configuration
When I delete the launch configuration
Then the launch configuration should not exist

@ec2
Scenario: Launch configuration attributes
Given I create a key pair
And I create 2 security groups
And I create a launch configuration with options
When I get the launch configuraiton by name
Then the launch configuraiton should have the same attributes

32 changes: 32 additions & 0 deletions features/auto_scaling/notification_configurations.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @notification_configurations @sns
Feature: Auto Scaling Notification Configurations

Scenario: Creating notification configurations
Given I create a launch configuration
And I create an auto scaling group
And I create an SNS topic
When I create a notification configuration for the group
Then the auto scaling group should have the notification configuration

Scenario: Deleting notification configurations
Given I create a launch configuration
And I create an auto scaling group
And I create an SNS topic
When I create a notification configuration for the group
And I delete the notification configuration
Then the group should have no notification configurations

60 changes: 60 additions & 0 deletions features/auto_scaling/scaling_policies.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @scaling_policies
Feature: Auto Scaling Policies

Scenario: Creating a policy
Given I create a launch configuration
And I create an auto scaling group
When I create an auto scaling policy
Then the auto scaling policy should exist
And the auto scaling group policies should include the policy

Scenario: Deleting policy
Given I create a launch configuration
And I create an auto scaling group
And I create an auto scaling policy
When I delete the auto scaling policy
Then the auto scaling policy should not exist
And the auto scaling group policies should not include the policy

Scenario: Getting policy attributes
Given I create a launch configuration
And I create an auto scaling group
And I create a scaling policy with the following options:
| OPT | VALUE |
| adjustment_type | ChangeInCapacity |
| scaling_adjustment | 2 |
When I get the scaling policy by name
Then the auto scaling policy adjustent type should be "ChangeInCapacity"
And the auto scaling policy scaling adjustent should be 2
And the cooldown should be nil

Scenario: Updating a scaling policy
Given I create a launch configuration
And I create an auto scaling group
And I create a scaling policy with the following options:
| OPT | VALUE |
| adjustment_type | ChangeInCapacity |
| scaling_adjustment | 2 |
When I update the scaling policy with the following options:
| OPT | VALUE |
| adjustment_type | ExactCapacity |
| scaling_adjustment | 3 |
| cooldown | 1 |
When I get the scaling policy by name
Then the auto scaling policy adjustent type should be "ExactCapacity"
And the auto scaling policy scaling adjustent should be 3
And the cooldown should be 1
36 changes: 36 additions & 0 deletions features/auto_scaling/scheduled_actions.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@auto_scaling @scheduled_actions
Feature: Auto Scaling Scheduled Actions

Scenario: Create a scheduled action
Given I create a launch configuration
And I create an auto scaling group
When I create a scheduled action
Then the auto scaling group should have 1 scheduled action

Scenario: Getting a scheduled action
Given I create a launch configuration
And I create an auto scaling group
And I create a scheduled action
When I get the scheduled action by name
Then the scheduled action should have the correct attributes

Scenario: Enumerating scheduled actions
Given I create a launch configuration
And I create an auto scaling group
And I create a scheduled action
Then the scheduled action should be in the list of scheduled actions

18 changes: 18 additions & 0 deletions features/auto_scaling/step_definitions/activities.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

Then /^the auto scaling group should have some activities$/ do
eventually do
@auto_scaling_group.activities.count.should > 0
end
end
43 changes: 43 additions & 0 deletions features/auto_scaling/step_definitions/auto_scaling.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

Before("@auto_scaling") do

@as = AWS::AutoScaling.new
@as_client = @as.client

@created_launch_configurations = []
@created_auto_scaling_groups = []

end

After("@auto_scaling") do

@created_auto_scaling_groups.each do |group|
begin
group.delete!
rescue AWS::AutoScaling::Errors::ValidationError
# already deleted
end
end

@created_launch_configurations.each do |launch_config|
begin
launch_config.delete
rescue AWS::AutoScaling::Errors::ValidationError
# throws a name validation error when it cant find a launch
# configuration with the given name -- already deleted
end
end

end
Loading

0 comments on commit e63c07e

Please sign in to comment.