1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[Brightbox] Fix SQL instance waiting in tests

API changed to prevent deleting an server whilst snapshots are occurring
but the test was waiting in the wrong place for the wrong thing.

Seems e78d096 did not correctly solve the problem when requests are
being tested.
This commit is contained in:
Paul Thornthwaite 2014-03-03 15:42:52 +00:00
parent 71808711ae
commit 3b2e933060

View file

@ -8,9 +8,7 @@ Shindo.tests('Fog::Compute[:brightbox] | database snapshot requests', ['brightbo
# Create a Database Server, then snapshot it
database_server = service.database_servers.create
database_server.wait_for { ready? }
result = service.snapshot_database_server(database_server.id)
database_server.destroy
service.snapshot_database_server(database_server.id)
tests("#list_database_snapshots") do
result = service.list_database_snapshots
@ -18,6 +16,10 @@ Shindo.tests('Fog::Compute[:brightbox] | database snapshot requests', ['brightbo
@database_snapshot_id = result.last["id"]
end
# Can't delete the server until snapshot is finished
service.database_snapshots.get(@database_snapshot_id).wait_for { ready? }
database_server.destroy
tests("#get_database_snapshot('#{@database_snapshot_id}')") do
result = service.get_database_snapshot(@database_snapshot_id)
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, {:allow_extra_keys => true}) { result }
@ -31,8 +33,6 @@ Shindo.tests('Fog::Compute[:brightbox] | database snapshot requests', ['brightbo
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, {:allow_extra_keys => true}) { result }
end
service.database_snapshots.get(@database_snapshot_id).wait_for { ready? }
tests("#destroy_database_snapshot('#{@database_snapshot_id}')") do
result = service.destroy_database_snapshot(@database_snapshot_id)
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, {:allow_extra_keys => true}) { result }