1 # Copyright (c) 2015 Red Hat, Inc.
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
15 from neutron import manager
16 from neutron.plugins.common import constants as plugin_constants
17 from neutron.tests.unit.plugins.ml2 import test_plugin
20 class ML2TestFramework(test_plugin.Ml2PluginV2TestCase):
21 l3_plugin = ('neutron.services.l3_router.l3_router_plugin.'
23 _mechanism_drivers = ['openvswitch']
26 super(ML2TestFramework, self).setUp()
27 self.core_plugin = manager.NeutronManager.get_instance().get_plugin()
28 self.l3_plugin = manager.NeutronManager.get_service_plugins().get(
29 plugin_constants.L3_ROUTER_NAT)
31 def _create_router(self, distributed=False, ha=False):
32 return self.l3_plugin.create_router(
36 'admin_state_up': True,
37 'tenant_id': self._tenant_id,
39 'distributed': distributed}})