1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/tests/models/rds/servers_tests.rb

25 lines
862 B
Ruby
Raw Normal View History

2015-01-02 12:34:40 -05:00
Shindo.tests("AWS::RDS | servers", ['aws', 'rds']) do
collection_tests(Fog::AWS[:rds].servers, rds_default_server_params) do
@instance.wait_for { ready? }
end
tests("#restore").succeeds do
instance = Fog::AWS[:rds].servers.create(rds_default_server_params.merge(:id => uniq_id("fog-snapshot-test")))
snapshot_id = uniq_id('fog-snapshot-test')
@snapshot = instance.snapshots.create(:id => snapshot_id )
instance.destroy
db_name = uniq_id('fog-db-name')
2016-01-19 12:06:54 -05:00
@restore_instance = Fog::AWS[:rds].servers.restore('master_username' => instance.master_username, 'flavor_id' => 'db.m3.medium', 'source_snapshot_id' => snapshot_id, 'id' => uniq_id('restored-instance'))
end
if Fog.mocking? && @restore_instance.respond_to?(:ready?)
@restore_instance.wait_for { ready? }
end
@snapshot.destroy
@restore_instance.destroy
end