mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2371 from brightbox/fix_interface_test
[Brightbox] Fix test issue with reusing servers
This commit is contained in:
commit
9be3033455
1 changed files with 7 additions and 19 deletions
|
@ -5,16 +5,8 @@ Shindo.tests('Fog::Compute[:brightbox] | interface requests', ['brightbox']) do
|
|||
tests('success') do
|
||||
|
||||
unless Fog.mocking?
|
||||
server = @test_service.servers.first
|
||||
|
||||
# If no server is available, create one just for the test
|
||||
unless server
|
||||
@test_server = Brightbox::Compute::TestSupport.get_test_server
|
||||
server = @test_server
|
||||
end
|
||||
|
||||
@interface_id = server.interfaces.first["id"]
|
||||
end
|
||||
@interface_id = @test_server.interfaces.first["id"]
|
||||
|
||||
tests("#get_interface('#{@interface_id}')") do
|
||||
pending if Fog.mocking?
|
||||
|
@ -22,11 +14,8 @@ Shindo.tests('Fog::Compute[:brightbox] | interface requests', ['brightbox']) do
|
|||
data_matches_schema(Brightbox::Compute::Formats::Full::INTERFACE, {:allow_extra_keys => true}) { result }
|
||||
end
|
||||
|
||||
unless Fog.mocking?
|
||||
# If we created a server just for this test, clean it up
|
||||
@test_server.destroy if @test_server
|
||||
@test_server.destroy
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
|
@ -41,5 +30,4 @@ Shindo.tests('Fog::Compute[:brightbox] | interface requests', ['brightbox']) do
|
|||
@test_service.get_interface()
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue