
In unit tests for several ML2 mechanism drivers (listed below) the NeutronDbPluginV2TestCase class is used instead of Ml2PluginV2TestCase which is desired to be used. Unit tests for ML2 mechanism drivers in neutron/tests/unit/ml2: drivers/cisco/nexus/test_cisco_mech.py drivers/brocade/test_brocade_mechanism_driver.py drivers/freescale/test_mechanism_fslsdn.py test_mechanism_ncs.py test_mechanism_odl.py test_l2population.py Partial-Bug: #1373153 Change-Id: I9524cafb39975b1384954a2eefcbf754231d2198
46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
# Copyright (c) 2013 OpenStack Foundation
|
|
# 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 neutron.plugins.ml2.drivers import mechanism_ncs
|
|
from neutron.tests.unit.ml2 import test_ml2_plugin as test_plugin
|
|
|
|
|
|
class NCSTestCase(test_plugin.Ml2PluginV2TestCase):
|
|
_mechanism_drivers = ['logger', 'ncs']
|
|
|
|
def setUp(self):
|
|
# Enable the test mechanism driver to ensure that
|
|
# we can successfully call through to all mechanism
|
|
# driver apis.
|
|
super(NCSTestCase, self).setUp()
|
|
self.port_create_status = 'DOWN'
|
|
mechanism_ncs.NCSMechanismDriver.sendjson = self.check_sendjson
|
|
|
|
def check_sendjson(self, method, urlpath, obj):
|
|
# Confirm fix for bug #1224981
|
|
self.assertFalse(urlpath.startswith("http://"))
|
|
|
|
|
|
class NCSMechanismTestBasicGet(test_plugin.TestMl2BasicGet, NCSTestCase):
|
|
pass
|
|
|
|
|
|
class NCSMechanismTestNetworksV2(test_plugin.TestMl2NetworksV2, NCSTestCase):
|
|
pass
|
|
|
|
|
|
class NCSMechanismTestPortsV2(test_plugin.TestMl2PortsV2, NCSTestCase):
|
|
pass
|