From 219c2b1038d3b0b8393a4c0cd7e9b66c8086f70e Mon Sep 17 00:00:00 2001 From: Josh Lane Date: Fri, 8 May 2015 14:12:12 -0700 Subject: [PATCH] repair request logic --- tests/models/rds/server_tests.rb | 8 ++------ tests/requests/rds/helper.rb | 3 +-- tests/requests/rds/instance_tests.rb | 8 ++++++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/models/rds/server_tests.rb b/tests/models/rds/server_tests.rb index 1c7e507cd..fbd7294bf 100644 --- a/tests/models/rds/server_tests.rb +++ b/tests/models/rds/server_tests.rb @@ -27,15 +27,11 @@ Shindo.tests("AWS::RDS | server", ['aws', 'rds']) do tests("#modify").succeeds do pending if Fog.mocking? - engine = rds_default_server_params.fetch(:engine) + engine = rds_default_server_params.fetch(:engine) version = rds_default_server_params.fetch(:version).match(/\d+\.\d+/).to_s - family = "#{engine}#{version}" - - puts family - orig_parameter_group = @instance.db_parameter_groups.first['DBParameterGroupName'] - parameter_group = Fog::AWS[:rds].parameter_groups.create(:id => uniq_id, :family => family, :description => 'fog-test') + parameter_group = Fog::AWS[:rds].parameter_groups.create(:id => uniq_id, :family => "#{engine}#{version}", :description => 'fog-test') orig_security_groups = @instance.db_security_groups.map{|h| h['DBSecurityGroupName']} security_group = Fog::AWS[:rds].security_groups.create(:id => uniq_id, :description => 'fog-test') diff --git a/tests/requests/rds/helper.rb b/tests/requests/rds/helper.rb index 73ff26d46..6c3cd4d4f 100644 --- a/tests/requests/rds/helper.rb +++ b/tests/requests/rds/helper.rb @@ -205,8 +205,7 @@ class AWS } REPLICA_INSTANCE = INSTANCE.merge({ - 'BackupRetentionPeriod' => Fog::Nullable::String, - 'PreferredBackupWindow' => Fog::Nullable::String, + 'PreferredBackupWindow' => Fog::Nullable::String, 'ReadReplicaSourceDBInstanceIdentifier' => String }) diff --git a/tests/requests/rds/instance_tests.rb b/tests/requests/rds/instance_tests.rb index 399bbadc5..b7769677e 100644 --- a/tests/requests/rds/instance_tests.rb +++ b/tests/requests/rds/instance_tests.rb @@ -15,13 +15,17 @@ Shindo.tests('AWS::RDS | instance requests', ['aws', 'rds']) do tests("#create_db_instance").formats(AWS::RDS::Formats::CREATE_DB_INSTANCE) do default_params = rds_default_server_params + # creation of replicas requires a > 0 BackupRetentionPeriod value + # InvalidDBInstanceState => Automated backups are not enabled for this database instance. To enable automated backups, use ModifyDBInstance to set the backup retention period to a non-zero value. (Fog::AWS::RDS::Error) + backup_retention_period = 1 + result = Fog::AWS[:rds].create_db_instance(@db_instance_id, 'AllocatedStorage' => default_params.fetch(:allocated_storage), 'DBInstanceClass' => default_params.fetch(:flavor_id), 'Engine' => default_params.fetch(:engine), 'EngineVersion' => default_params.fetch(:version), 'MasterUsername' => default_params.fetch(:master_username), - 'BackupRetentionPeriod' => default_params.fetch(:backup_retention_period), + 'BackupRetentionPeriod' => backup_retention_period, 'MasterUserPassword' => default_params.fetch(:password)).body instance = result['CreateDBInstanceResult']['DBInstance'] @@ -69,7 +73,7 @@ Shindo.tests('AWS::RDS | instance requests', ['aws', 'rds']) do end tests("#describe_db_snapshots").formats(AWS::RDS::Formats::DESCRIBE_DB_SNAPSHOTS) do - body = Fog::AWS[:rds].describe_db_snapshots.body + Fog::AWS[:rds].describe_db_snapshots.body end server.wait_for { state == 'available' }