Set lock_path correctly.
[openstack-build/neutron-build.git] / neutron / tests / unit / plugins / ml2 / base.py
1 # Copyright (c) 2015 Red Hat, Inc.
2 #
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
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
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
13 #    under the License.
14
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
18
19
20 class ML2TestFramework(test_plugin.Ml2PluginV2TestCase):
21     l3_plugin = ('neutron.services.l3_router.l3_router_plugin.'
22                  'L3RouterPlugin')
23     _mechanism_drivers = ['openvswitch']
24
25     def setUp(self):
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)
30
31     def _create_router(self, distributed=False, ha=False):
32         return self.l3_plugin.create_router(
33             self.context,
34             {'router':
35              {'name': 'router',
36               'admin_state_up': True,
37               'tenant_id': self._tenant_id,
38               'ha': ha,
39               'distributed': distributed}})