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

[brightbox] Load balancer request tests expanded

This commit is contained in:
Paul Thornthwaite 2011-10-03 11:49:07 +01:00
parent 0971fdc2cd
commit d7fa80f702

View file

@ -45,6 +45,48 @@ Shindo.tests('Fog::Compute[:brightbox] | load balancer requests', ['brightbox'])
formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
end
update_options = {:name => "New name"}
tests("#update_load_balancer('#{@load_balancer_id}', #{update_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].update_load_balancer(@load_balancer_id, update_options)
formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
end
add_listeners_options = {:listeners=>[{:out=>28080, :in=>8080, :protocol=>"http"}]}
tests("#add_listeners_load_balancer('#{@load_balancer_id}', #{add_listeners_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].add_listeners_load_balancer(@load_balancer_id, add_listeners_options)
formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
end
remove_listeners_options = {:listeners=>[{:out=>28080, :in=>8080, :protocol=>"http"}]}
tests("#remove_listeners_load_balancer('#{@load_balancer_id}', #{remove_listeners_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].remove_listeners_load_balancer(@load_balancer_id, remove_listeners_options)
formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
end
unless Fog.mocking?
@node2 = Brightbox::Compute::TestSupport.get_test_server
second_node_id = @node2.id
end
# Can't remove the last node so we need to add a second...
add_nodes_options = {:nodes => [{:node => second_node_id}]}
tests("#add_nodes_load_balancer('#{@load_balancer_id}', #{add_nodes_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].add_nodes_load_balancer(@load_balancer_id, add_nodes_options)
formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
end
# ...before we can attempt to remove either
remove_nodes_options = {:nodes => [{:node => node_id}]}
tests("#remove_nodes_load_balancer('#{@load_balancer_id}', #{remove_nodes_options.inspect})") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].remove_nodes_load_balancer(@load_balancer_id, remove_nodes_options)
formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) { result }
end
tests("#destroy_load_balancer('#{@load_balancer_id}')") do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].destroy_load_balancer(@load_balancer_id)
@ -53,6 +95,7 @@ Shindo.tests('Fog::Compute[:brightbox] | load balancer requests', ['brightbox'])
unless Fog.mocking?
@node.destroy
@node2.destroy
end
end