Reorganize plugin test modules
This change moves plugin test modules to conform to the new rules on unit test tree structure (see TESTING.rst). Vendor plugin paths continue to be ignored, and unit test modules that test features instead of modules are also ignored pending their removal to the functional test tree. Change-Id: I482c377ca72ffd58692ad84bd9692356513e4c98 Closes-Bug: #1440834
This commit is contained in:
parent
5bdcacad62
commit
21bef562c2
|
@ -29,7 +29,7 @@ import testscenarios
|
|||
|
||||
from neutron.tests import base as tests_base
|
||||
from neutron.tests.retargetable import client_fixtures
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
|
||||
# Each plugin must add a class to plugin_configurations that can configure the
|
||||
|
@ -39,7 +39,7 @@ from neutron.tests.unit.plugins.ml2 import test_ml2_plugin
|
|||
|
||||
# TODO(marun) Discover plugin conf via a metaclass
|
||||
plugin_configurations = [
|
||||
test_ml2_plugin.Ml2ConfFixture(),
|
||||
test_plugin.Ml2ConfFixture(),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ sys.modules["apicapi"] = mock.Mock()
|
|||
from neutron.plugins.ml2.drivers.cisco.apic import apic_topology
|
||||
from neutron.tests import base
|
||||
from neutron.tests.unit.plugins.ml2.drivers.cisco.apic import (
|
||||
test_cisco_apic_common as mocked)
|
||||
base as mocked)
|
||||
|
||||
NOTIFIER = ('neutron.plugins.ml2.drivers.cisco.apic.'
|
||||
'apic_topology.ApicTopologyServiceNotifierApi')
|
|
@ -25,7 +25,7 @@ from neutron.plugins.ml2.drivers.cisco.apic import mechanism_apic as md
|
|||
from neutron.plugins.ml2.drivers import type_vlan # noqa
|
||||
from neutron.tests import base
|
||||
from neutron.tests.unit.plugins.ml2.drivers.cisco.apic import (
|
||||
test_cisco_apic_common as mocked)
|
||||
base as mocked)
|
||||
|
||||
|
||||
HOST_ID1 = 'ubuntu'
|
|
@ -14,7 +14,7 @@
|
|||
# under the License.
|
||||
|
||||
from neutron.plugins.ml2.drivers.cisco.ncs import driver
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin as test_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
|
||||
class NCSTestCase(test_plugin.Ml2PluginV2TestCase):
|
|
@ -30,7 +30,7 @@ from neutron.tests.unit.plugins.ml2 import extensions as test_extensions
|
|||
|
||||
|
||||
class TestExtensionDriverBase(driver_api.ExtensionDriver):
|
||||
_supported_extension_aliases = 'test_extension'
|
||||
_supported_extension_aliases = 'fake_extension'
|
||||
|
||||
def initialize(self):
|
||||
extensions.append_api_extensions_path(test_extensions.__path__)
|
||||
|
|
|
@ -19,13 +19,13 @@ from oslo_config import cfg
|
|||
from neutron.extensions import portbindings
|
||||
from neutron.plugins.ml2.drivers.freescale import mechanism_fslsdn
|
||||
from neutron.tests import base
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
|
||||
"""Unit testing for Freescale SDN mechanism driver."""
|
||||
|
||||
|
||||
class TestFslSdnMechDriverV2(test_ml2_plugin.Ml2PluginV2TestCase):
|
||||
class TestFslSdnMechDriverV2(test_plugin.Ml2PluginV2TestCase):
|
||||
_mechanism_drivers = ['fslsdn']
|
||||
|
||||
"""Testing mechanism driver with ML2 plugin."""
|
||||
|
@ -41,18 +41,18 @@ class TestFslSdnMechDriverV2(test_ml2_plugin.Ml2PluginV2TestCase):
|
|||
super(TestFslSdnMechDriverV2, self).setUp()
|
||||
|
||||
|
||||
class TestFslSdnMechDriverNetworksV2(test_ml2_plugin.TestMl2NetworksV2,
|
||||
class TestFslSdnMechDriverNetworksV2(test_plugin.TestMl2NetworksV2,
|
||||
TestFslSdnMechDriverV2):
|
||||
pass
|
||||
|
||||
|
||||
class TestFslSdnMechDriverPortsV2(test_ml2_plugin.TestMl2PortsV2,
|
||||
class TestFslSdnMechDriverPortsV2(test_plugin.TestMl2PortsV2,
|
||||
TestFslSdnMechDriverV2):
|
||||
VIF_TYPE = portbindings.VIF_TYPE_OVS
|
||||
CAP_PORT_FILTER = True
|
||||
|
||||
|
||||
class TestFslSdnMechDriverSubnetsV2(test_ml2_plugin.TestMl2SubnetsV2,
|
||||
class TestFslSdnMechDriverSubnetsV2(test_plugin.TestMl2SubnetsV2,
|
||||
TestFslSdnMechDriverV2):
|
||||
pass
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc
|
|||
from neutron.plugins.ml2 import managers
|
||||
from neutron.plugins.ml2 import rpc
|
||||
from neutron.tests import base
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin as test_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
HOST = 'my_l2_host'
|
||||
L2_AGENT = {
|
|
@ -17,7 +17,7 @@ import sys
|
|||
|
||||
import mock
|
||||
from neutron import context
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin as test_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
|
||||
with mock.patch.dict(sys.modules,
|
|
@ -23,8 +23,8 @@ from neutron.db import api as db_api
|
|||
from neutron.plugins.common import constants as p_const
|
||||
from neutron.plugins.ml2 import config
|
||||
from neutron.plugins.ml2.drivers import type_gre
|
||||
from neutron.tests.unit.plugins.ml2 import test_rpcapi
|
||||
from neutron.tests.unit.plugins.ml2 import test_type_tunnel
|
||||
from neutron.tests.unit.plugins.ml2.drivers import base_type_tunnel
|
||||
from neutron.tests.unit.plugins.ml2 import test_rpc
|
||||
from neutron.tests.unit import testlib_api
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ def _get_allocation(session, gre_id):
|
|||
gre_id=gre_id).one()
|
||||
|
||||
|
||||
class GreTypeTest(test_type_tunnel.TunnelTypeTestMixin,
|
||||
class GreTypeTest(base_type_tunnel.TunnelTypeTestMixin,
|
||||
testlib_api.SqlTestCase):
|
||||
DRIVER_CLASS = type_gre.GreTypeDriver
|
||||
TYPE = p_const.TYPE_GRE
|
||||
|
@ -151,13 +151,13 @@ class GreTypeTest(test_type_tunnel.TunnelTypeTestMixin,
|
|||
self.assertEqual(0, self.driver.get_mtu('physnet1'))
|
||||
|
||||
|
||||
class GreTypeMultiRangeTest(test_type_tunnel.TunnelTypeMultiRangeTestMixin,
|
||||
class GreTypeMultiRangeTest(base_type_tunnel.TunnelTypeMultiRangeTestMixin,
|
||||
testlib_api.SqlTestCase):
|
||||
DRIVER_CLASS = type_gre.GreTypeDriver
|
||||
|
||||
|
||||
class GreTypeRpcCallbackTest(test_type_tunnel.TunnelRpcCallbackTestMixin,
|
||||
test_rpcapi.RpcCallbacksTestCase,
|
||||
class GreTypeRpcCallbackTest(base_type_tunnel.TunnelRpcCallbackTestMixin,
|
||||
test_rpc.RpcCallbacksTestCase,
|
||||
testlib_api.SqlTestCase):
|
||||
DRIVER_CLASS = type_gre.GreTypeDriver
|
||||
TYPE = p_const.TYPE_GRE
|
|
@ -18,8 +18,8 @@ import mock
|
|||
from neutron.plugins.common import constants as p_const
|
||||
from neutron.plugins.ml2 import config
|
||||
from neutron.plugins.ml2.drivers import type_vxlan
|
||||
from neutron.tests.unit.plugins.ml2 import test_rpcapi
|
||||
from neutron.tests.unit.plugins.ml2 import test_type_tunnel
|
||||
from neutron.tests.unit.plugins.ml2.drivers import base_type_tunnel
|
||||
from neutron.tests.unit.plugins.ml2 import test_rpc
|
||||
from neutron.tests.unit import testlib_api
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ VXLAN_UDP_PORT_ONE = 9999
|
|||
VXLAN_UDP_PORT_TWO = 8888
|
||||
|
||||
|
||||
class VxlanTypeTest(test_type_tunnel.TunnelTypeTestMixin,
|
||||
class VxlanTypeTest(base_type_tunnel.TunnelTypeTestMixin,
|
||||
testlib_api.SqlTestCase):
|
||||
DRIVER_CLASS = type_vxlan.VxlanTypeDriver
|
||||
TYPE = p_const.TYPE_VXLAN
|
||||
|
@ -119,13 +119,13 @@ class VxlanTypeTest(test_type_tunnel.TunnelTypeTestMixin,
|
|||
self.assertEqual(0, self.driver.get_mtu('physnet1'))
|
||||
|
||||
|
||||
class VxlanTypeMultiRangeTest(test_type_tunnel.TunnelTypeMultiRangeTestMixin,
|
||||
class VxlanTypeMultiRangeTest(base_type_tunnel.TunnelTypeMultiRangeTestMixin,
|
||||
testlib_api.SqlTestCase):
|
||||
DRIVER_CLASS = type_vxlan.VxlanTypeDriver
|
||||
|
||||
|
||||
class VxlanTypeRpcCallbackTest(test_type_tunnel.TunnelRpcCallbackTestMixin,
|
||||
test_rpcapi.RpcCallbacksTestCase,
|
||||
class VxlanTypeRpcCallbackTest(base_type_tunnel.TunnelRpcCallbackTestMixin,
|
||||
test_rpc.RpcCallbacksTestCase,
|
||||
testlib_api.SqlTestCase):
|
||||
DRIVER_CLASS = type_vxlan.VxlanTypeDriver
|
||||
TYPE = p_const.TYPE_VXLAN
|
|
@ -39,15 +39,15 @@ EXTENDED_ATTRIBUTES_2_0 = {
|
|||
}
|
||||
|
||||
|
||||
class Test_extension(extensions.ExtensionDescriptor):
|
||||
class Fake_extension(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_name(cls):
|
||||
return "ML2 test extension"
|
||||
return "ML2 fake extension"
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "test_extension"
|
||||
return "fake_extension"
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -56,7 +56,7 @@ class Test_extension(extensions.ExtensionDescriptor):
|
|||
@classmethod
|
||||
def get_namespace(cls):
|
||||
return ("http://docs.openstack.org/ext/neutron/ml2/test/"
|
||||
"test_extension/api/v1.0")
|
||||
"fake_extension/api/v1.0")
|
||||
|
||||
@classmethod
|
||||
def get_updated(cls):
|
|
@ -13,24 +13,24 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
from neutron.tests.unit.plugins.openvswitch import test_agent_scheduler
|
||||
|
||||
|
||||
class Ml2AgentSchedulerTestCase(
|
||||
test_agent_scheduler.OvsAgentSchedulerTestCase):
|
||||
plugin_str = test_ml2_plugin.PLUGIN_NAME
|
||||
plugin_str = test_plugin.PLUGIN_NAME
|
||||
l3_plugin = ('neutron.services.l3_router.'
|
||||
'l3_router_plugin.L3RouterPlugin')
|
||||
|
||||
|
||||
class Ml2L3AgentNotifierTestCase(
|
||||
test_agent_scheduler.OvsL3AgentNotifierTestCase):
|
||||
plugin_str = test_ml2_plugin.PLUGIN_NAME
|
||||
plugin_str = test_plugin.PLUGIN_NAME
|
||||
l3_plugin = ('neutron.services.l3_router.'
|
||||
'l3_router_plugin.L3RouterPlugin')
|
||||
|
||||
|
||||
class Ml2DhcpAgentNotifierTestCase(
|
||||
test_agent_scheduler.OvsDhcpAgentNotifierTestCase):
|
||||
plugin_str = test_ml2_plugin.PLUGIN_NAME
|
||||
plugin_str = test_plugin.PLUGIN_NAME
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
|
||||
from neutron.plugins.ml2 import config
|
||||
from neutron.tests.unit.extensions import test_portsecurity as test_psec
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
|
||||
class PSExtDriverTestCase(test_ml2_plugin.Ml2PluginV2TestCase,
|
||||
class PSExtDriverTestCase(test_plugin.Ml2PluginV2TestCase,
|
||||
test_psec.TestPortSecurity):
|
||||
_extension_drivers = ['port_security']
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@ from neutron import context
|
|||
from neutron import manager
|
||||
from neutron.plugins.ml2 import config
|
||||
from neutron.tests.unit.plugins.ml2.drivers import ext_test
|
||||
from neutron.tests.unit.plugins.ml2 import test_ml2_plugin
|
||||
from neutron.tests.unit.plugins.ml2 import test_plugin
|
||||
|
||||
|
||||
class ExtensionDriverTestCase(test_ml2_plugin.Ml2PluginV2TestCase):
|
||||
class ExtensionDriverTestCase(test_plugin.Ml2PluginV2TestCase):
|
||||
|
||||
_extension_drivers = ['test']
|
||||
|
||||
|
@ -128,7 +128,7 @@ class ExtensionDriverTestCase(test_ml2_plugin.Ml2PluginV2TestCase):
|
|||
self.assertTrue(ext_port_dict.called)
|
||||
|
||||
|
||||
class DBExtensionDriverTestCase(test_ml2_plugin.Ml2PluginV2TestCase):
|
||||
class DBExtensionDriverTestCase(test_plugin.Ml2PluginV2TestCase):
|
||||
_extension_drivers = ['testdb']
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
@ -21,8 +21,7 @@ sys.modules["apicapi"] = mock.Mock()
|
|||
|
||||
from neutron.plugins.ml2.drivers.cisco.apic import mechanism_apic as md
|
||||
from neutron.services.l3_router import l3_apic
|
||||
from neutron.tests.unit.plugins.ml2.drivers.cisco.apic import (
|
||||
test_cisco_apic_common as mocked)
|
||||
from neutron.tests.unit.plugins.ml2.drivers.cisco.apic import base as mocked
|
||||
from neutron.tests.unit import testlib_api
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,24 @@ test_path=$neutron_path/$base_test_path
|
|||
test_files=$(find ${test_path} -iname 'test_*.py')
|
||||
|
||||
ignore_regexes=(
|
||||
"^plugins.*$"
|
||||
# The following vendor plugins are not required to confrm to the
|
||||
# structural requirements.
|
||||
"^plugins/brocade.*$"
|
||||
"^plugins/cisco.*$"
|
||||
"^plugins/embrane.*$"
|
||||
"^plugins/ibm.*$"
|
||||
"^plugins/oneconvergence.*$"
|
||||
# The following open source plugin tests are not actually unit
|
||||
# tests and are ignored pending their relocation to the functional
|
||||
# test tree.
|
||||
"^plugins/ml2/drivers/mech_sriov/test_mech_sriov_nic_switch.py$"
|
||||
"^plugins/ml2/test_security_group.py$"
|
||||
"^plugins/ml2/test_port_binding.py$"
|
||||
"^plugins/ml2/test_extension_driver_api.py$"
|
||||
"^plugins/ml2/test_ext_portsecurity.py$"
|
||||
"^plugins/ml2/test_agent_scheduler.py$"
|
||||
"^plugins/openvswitch/test_ovs_tunnel.py$"
|
||||
"^plugins/openvswitch/test_agent_scheduler.py$"
|
||||
)
|
||||
|
||||
error_count=0
|
||||
|
|
Loading…
Reference in New Issue