diff --git a/lib/fog/openstack/requests/compute/list_address_pools.rb b/lib/fog/openstack/requests/compute/list_address_pools.rb index ad3b276cd..cfc75fc5c 100644 --- a/lib/fog/openstack/requests/compute/list_address_pools.rb +++ b/lib/fog/openstack/requests/compute/list_address_pools.rb @@ -16,6 +16,16 @@ module Fog class Mock + def list_address_pools + response = Excon::Response.new + response.status = 200 + response.body = { + 'floating_ip_pools' => [ + { 'name' => 'nova' } + ] + } + response + end end end diff --git a/tests/openstack/requests/compute/address_tests.rb b/tests/openstack/requests/compute/address_tests.rb index 85031b4f8..3d02404a2 100644 --- a/tests/openstack/requests/compute/address_tests.rb +++ b/tests/openstack/requests/compute/address_tests.rb @@ -12,6 +12,10 @@ Shindo.tests('Fog::Compute[:openstack] | address requests', ['openstack']) do "pool" => String } + @address_pools_format = { + "name" => String + } + tests('success') do tests('#allocate_address').formats({"floating_ip" => @address_format}) do @@ -29,6 +33,10 @@ Shindo.tests('Fog::Compute[:openstack] | address requests', ['openstack']) do compute.get_address(@address_id).body end + tests('#list_address_pools').formats({"floating_ip_pools" => [@address_pools_format]}) do + compute.list_address_pools.body + end + compute.servers.get(@server_id).wait_for { ready? } tests('#associate_address(server_id, ip_address)').succeeds do