diff --git a/neutron/services/network_ip_availability/plugin.py b/neutron/services/network_ip_availability/plugin.py index 7a4cbbd886d..49a6e4db845 100644 --- a/neutron/services/network_ip_availability/plugin.py +++ b/neutron/services/network_ip_availability/plugin.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import neutron.common.exceptions as exceptions +from neutron_lib import exceptions + import neutron.db.db_base_plugin_v2 as db_base_plugin_v2 import neutron.db.network_ip_availability_db as ip_availability_db diff --git a/neutron/tests/tempest/api/test_network_ip_availability_negative.py b/neutron/tests/tempest/api/test_network_ip_availability_negative.py new file mode 100644 index 00000000000..094f3932d82 --- /dev/null +++ b/neutron/tests/tempest/api/test_network_ip_availability_negative.py @@ -0,0 +1,29 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo_utils import uuidutils +from tempest.lib import exceptions as lib_exc +from tempest import test + +from neutron.tests.tempest.api import test_network_ip_availability as net_ip + + +class NetworksIpAvailabilityNegativeTest(net_ip.NetworksIpAvailabilityTest): + + @test.attr(type='negative') + @test.idempotent_id('3b8693eb-6c57-4ea1-ab84-3730c9ee9c84') + def test_network_availability_nonexistent_network_id(self): + self.assertRaises(lib_exc.NotFound, + self.admin_client.show_network_ip_availability, + uuidutils.generate_uuid()) diff --git a/neutron/tests/tempest/services/network/json/network_client.py b/neutron/tests/tempest/services/network/json/network_client.py index 610b04998aa..671c0408aa7 100644 --- a/neutron/tests/tempest/services/network/json/network_client.py +++ b/neutron/tests/tempest/services/network/json/network_client.py @@ -87,6 +87,7 @@ class NetworkClientJSON(service_client.RestClient): 'quotas': 'quotas', 'qos_policy': 'policies', 'rbac_policy': 'rbac_policies', + 'network_ip_availability': 'network_ip_availabilities', } return resource_plural_map.get(resource_name, resource_name + 's')