diff --git a/neutron/tests/unit/dummy_plugin.py b/neutron/tests/unit/dummy_plugin.py index fd5818fc4e7..cfef0cf63a4 100644 --- a/neutron/tests/unit/dummy_plugin.py +++ b/neutron/tests/unit/dummy_plugin.py @@ -22,6 +22,7 @@ from neutron.api import extensions from neutron.api.v2 import base from neutron.db import servicetype_db from neutron.extensions import servicetype +from neutron import neutron_plugin_base_v2 RESOURCE_NAME = "dummy" @@ -129,3 +130,54 @@ class DummyServicePlugin(service_base.ServicePluginBase): svc_type_id) except KeyError: raise exceptions.NotFound() + + +class DummyCorePluginWithoutDatastore( + neutron_plugin_base_v2.NeutronPluginBaseV2): + def create_subnet(self, context, subnet): + pass + + def update_subnet(self, context, id, subnet): + pass + + def get_subnet(self, context, id, fields=None): + pass + + def get_subnets(self, context, filters=None, fields=None, + sorts=None, limit=None, marker=None, page_reverse=False): + pass + + def delete_subnet(self, context, id): + pass + + def create_network(self, context, network): + pass + + def update_network(self, context, id, network): + pass + + def get_network(self, context, id, fields=None): + pass + + def get_networks(self, context, filters=None, fields=None, + sorts=None, limit=None, marker=None, page_reverse=False): + pass + + def delete_network(self, context, id): + pass + + def create_port(self, context, port): + pass + + def update_port(self, context, id, port): + pass + + def get_port(self, context, id, fields=None): + pass + + def get_ports(self, context, filters=None, fields=None, + sorts=None, limit=None, marker=None, page_reverse=False): + pass + + def delete_port(self, context, id): + pass diff --git a/neutron/tests/unit/test_neutron_plugin_base_v2.py b/neutron/tests/unit/test_neutron_plugin_base_v2.py new file mode 100644 index 00000000000..25e0892fb89 --- /dev/null +++ b/neutron/tests/unit/test_neutron_plugin_base_v2.py @@ -0,0 +1,26 @@ +# Copyright (c) 2017 OpenStack Foundation. +# +# 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_config import cfg + +from neutron import manager +from neutron.tests import base + + +class NeutronPluginBaseV2TestCase(base.BaseTestCase): + + def test_can_load_core_plugin_without_datastore(self): + cfg.CONF.set_override("core_plugin", 'neutron.tests.unit.dummy_plugin.' + 'DummyCorePluginWithoutDatastore') + manager.init()