From 41b0a3e7549b8a958fc8e30fb0203665ec70f347 Mon Sep 17 00:00:00 2001 From: Paul Thornthwaite Date: Tue, 7 Feb 2012 17:14:29 +0000 Subject: [PATCH] [Brightbox] Correct server snapshot test Had a mistake in it was trying to use the Server's ID for the get image request and resulted in calling destroy on a nil. Also had to add a wait since the API does not allow deleting an image that is being prepared. --- tests/brightbox/requests/compute/server_tests.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/brightbox/requests/compute/server_tests.rb b/tests/brightbox/requests/compute/server_tests.rb index 0df48d7f7..f01255ff9 100644 --- a/tests/brightbox/requests/compute/server_tests.rb +++ b/tests/brightbox/requests/compute/server_tests.rb @@ -64,8 +64,10 @@ Shindo.tests('Fog::Compute[:brightbox] | server requests', ['brightbox']) do pending if Fog.mocking? result = Fog::Compute[:brightbox].snapshot_server(server_id) formats(Brightbox::Compute::Formats::Full::SERVER, false) { result } - snapshot_id = result["id"] + # Server should be exclusively for our test so assume we can delete the snapshot + snapshot_id = result["snapshots"].first["id"] @snapshot = Fog::Compute[:brightbox].images.get(snapshot_id) + @snapshot.wait_for { ready? } @snapshot.destroy end