2015-01-02 12:34:40 -05:00
|
|
|
Shindo.tests('AWS::RDS | parameter group requests', ['aws', 'rds']) do
|
2014-12-30 17:25:09 -05:00
|
|
|
tests('success') do
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#create_db_parameter_groups").formats(AWS::RDS::Formats::CREATE_DB_PARAMETER_GROUP) do
|
2014-12-30 17:25:09 -05:00
|
|
|
body = Fog::AWS[:rds].create_db_parameter_group('fog-group', 'MySQL5.1', 'Some description').body
|
|
|
|
|
|
|
|
returns( 'mysql5.1') { body['CreateDBParameterGroupResult']['DBParameterGroup']['DBParameterGroupFamily']}
|
|
|
|
returns( 'fog-group') { body['CreateDBParameterGroupResult']['DBParameterGroup']['DBParameterGroupName']}
|
|
|
|
returns( 'Some description') { body['CreateDBParameterGroupResult']['DBParameterGroup']['Description']}
|
|
|
|
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
|
|
|
Fog::AWS[:rds].create_db_parameter_group('other-fog-group', 'MySQL5.1', 'Some description')
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#describe_db_parameter_groups").formats(AWS::RDS::Formats::DESCRIBE_DB_PARAMETER_GROUP) do
|
2014-12-30 17:25:09 -05:00
|
|
|
|
|
|
|
body = Fog::AWS[:rds].describe_db_parameter_groups().body
|
|
|
|
|
|
|
|
returns(4) {body['DescribeDBParameterGroupsResult']['DBParameterGroups'].length}
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
2016-01-19 10:17:36 -05:00
|
|
|
tests("#describe_db_parameter_groups('fog-group')").formats(AWS::RDS::Formats::DESCRIBE_DB_PARAMETER_GROUP) do
|
2014-12-30 17:25:09 -05:00
|
|
|
|
|
|
|
body = Fog::AWS[:rds].describe_db_parameter_groups('fog-group').body
|
|
|
|
|
|
|
|
returns(1) {body['DescribeDBParameterGroupsResult']['DBParameterGroups'].length}
|
|
|
|
|
|
|
|
group = body['DescribeDBParameterGroupsResult']['DBParameterGroups'].first
|
|
|
|
returns( 'mysql5.1') { group['DBParameterGroupFamily']}
|
|
|
|
returns( 'fog-group') { group['DBParameterGroupName']}
|
|
|
|
returns( 'Some description') { group['Description']}
|
|
|
|
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("delete_db_parameter_group").formats(AWS::RDS::Formats::BASIC) do
|
2014-12-30 17:25:09 -05:00
|
|
|
body = Fog::AWS[:rds].delete_db_parameter_group('fog-group').body
|
|
|
|
|
|
|
|
raises(Fog::AWS::RDS::NotFound) {Fog::AWS[:rds].describe_db_parameter_groups('fog-group')}
|
|
|
|
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
|
|
|
Fog::AWS[:rds].delete_db_parameter_group('other-fog-group')
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("failures") do
|
|
|
|
raises(Fog::AWS::RDS::NotFound) {Fog::AWS[:rds].describe_db_parameter_groups('doesntexist')}
|
|
|
|
raises(Fog::AWS::RDS::NotFound) {Fog::AWS[:rds].delete_db_parameter_group('doesntexist')}
|
|
|
|
|
|
|
|
tests "creating second group with same id" do
|
|
|
|
Fog::AWS[:rds].create_db_parameter_group('fog-group', 'MySQL5.1', 'Some description')
|
|
|
|
raises(Fog::AWS::RDS::IdentifierTaken) {Fog::AWS[:rds].create_db_parameter_group('fog-group', 'MySQL5.1', 'Some description')}
|
|
|
|
end
|
|
|
|
|
|
|
|
Fog::AWS[:rds].delete_db_parameter_group('fog-group')
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|