2011-08-04 17:21:22 -04:00
|
|
|
Shindo.tests('Fog::Rackspace::LoadBalancers | connection_throttling', ['rackspace']) do
|
2011-07-27 17:19:44 -04:00
|
|
|
|
2011-07-28 14:37:21 -04:00
|
|
|
given_a_load_balancer_service do
|
|
|
|
given_a_load_balancer do
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
@lb.wait_for { ready? }
|
|
|
|
tests("#get_connection_throttling(#{@lb.id})").formats(CONNECTION_THROTTLING_FORMAT) do
|
|
|
|
@service.get_connection_throttling(@lb.id).body
|
|
|
|
end
|
|
|
|
|
|
|
|
@lb.wait_for { ready? }
|
|
|
|
tests("#set_connection_throttling(#{@lb.id}, 10, 10, 10, 30)").succeeds do
|
|
|
|
@service.set_connection_throttling(@lb.id, 10, 10, 10, 30)
|
|
|
|
end
|
|
|
|
|
|
|
|
@lb.wait_for { ready? }
|
|
|
|
tests("#get_connection_throttling(#{@lb.id})").formats(CONNECTION_THROTTLING_FORMAT) do
|
|
|
|
@service.get_connection_throttling(@lb.id).body
|
|
|
|
end
|
|
|
|
|
|
|
|
@lb.wait_for { ready? }
|
|
|
|
tests("#remove_connection_throttling()").succeeds do
|
|
|
|
@service.remove_connection_throttling(@lb.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
tests("#set_connection_throttling(#{@lb.id}, -1, -1, -1, -1)").raises(Fog::Rackspace::LoadBalancer::BadRequest) do
|
|
|
|
@service.set_connection_throttling(@lb.id, -1, -1, -1, -1)
|
|
|
|
end
|
|
|
|
end
|
2011-07-27 17:19:44 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|