1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
require "test_helper"
require "helpers/network_helper"
describe "Fog::OpenStack::Network | lb_vip" do
describe "success" do
before do
attributes = {
:subnet_id => 'subnet_id',
:pool_id => 'pool_id',
:protocol => 'HTTP',
:protocol_port => 80,
:name => 'test-vip',
:description => 'Test VIP',
:address => '10.0.0.1',
:session_persistence => {
"cookie_name" => "COOKIE_NAME",
"type" => "APP_COOKIE"
},
:connection_limit => 10,
:admin_state_up => true,
:tenant_id => 'tenant_id'
}
@instance = network.lb_vips.create(attributes)
end
after do
@instance.destroy.must_equal true
end
it "#create" do
@instance.id.wont_be_nil
end
it "#update" do
@instance.pool_id = 'new_pool_id'
@instance.name = 'new-test-vip'
@instance.description = 'New Test VIP'
@instance.session_persistence = {"type" => "HTTP_COOKIE"}
@instance.connection_limit = 5
@instance.admin_state_up = false
@instance.update.status.must_equal "ACTIVE"
end
end
end
|