@ -47,15 +47,15 @@ from neutron.openstack.common import uuidutils
from neutron . plugins . common import constants as service_constants
from neutron . tests import base
from neutron . tests import fake_notifier
from neutron . tests . unit import test_agent_ext_plugin
from neutron . tests . unit import test_ api_v2
from neutron . tests . unit import test_api_v2_ extension
from neutron . tests . unit import test_db_plugin
from neutron . tests . unit . api . v2 import test_base
from neutron . tests . unit . db import test_ db_b ase_ plug in _v2
from neutron . tests . unit . extensions import base as test_extensions_base
from neutron . tests . unit . extensions import test_agent
LOG = logging . getLogger ( __name__ )
_uuid = uuidutils . generate_uuid
_get_path = test_ api_v2 . _get_path
_get_path = test_ base . _get_path
class L3TestExtensionManager ( object ) :
@ -76,7 +76,7 @@ class L3TestExtensionManager(object):
return [ ]
class L3NatExtensionTestCase ( test_ api_v2_ extension. ExtensionTestCase ) :
class L3NatExtensionTestCase ( test_ extensions_base . ExtensionTestCase ) :
fmt = ' json '
def setUp ( self ) :
@ -464,7 +464,7 @@ class L3NatTestCaseMixin(object):
private_port = None
if port_id :
private_port = self . _show ( ' ports ' , port_id )
with test_db_ plugin. optional_ctx ( private_port ,
with test_db_ base_ plugin_v2 . optional_ctx ( private_port ,
self . port ) as private_port :
with self . router ( ) as r :
sid = private_port [ ' port ' ] [ ' fixed_ips ' ] [ 0 ] [ ' subnet_id ' ]
@ -2431,13 +2431,13 @@ class L3AgentDbTestCaseBase(L3NatTestCaseMixin):
self . _test_notify_op_agent ( self . _test_floatingips_op_agent )
class L3BaseForIntTests ( test_db_ plugin. NeutronDbPluginV2TestCase ) :
class L3BaseForIntTests ( test_db_ base_ plugin_v2 . NeutronDbPluginV2TestCase ) :
mock_rescheduling = True
def setUp ( self , plugin = None , ext_mgr = None , service_plugins = None ) :
if not plugin :
plugin = ' neutron.tests.unit. test_l3_plugin .TestL3NatIntPlugin'
plugin = ' neutron.tests.unit. extensions. test_l3.TestL3NatIntPlugin'
# for these tests we need to enable overlapping ips
cfg . CONF . set_default ( ' allow_overlapping_ips ' , True )
ext_mgr = ext_mgr or L3TestExtensionManager ( )
@ -2452,14 +2452,14 @@ class L3BaseForIntTests(test_db_plugin.NeutronDbPluginV2TestCase):
self . setup_notification_driver ( )
class L3BaseForSepTests ( test_db_ plugin. NeutronDbPluginV2TestCase ) :
class L3BaseForSepTests ( test_db_ base_ plugin_v2 . NeutronDbPluginV2TestCase ) :
def setUp ( self , plugin = None , ext_mgr = None ) :
# the plugin without L3 support
if not plugin :
plugin = ' neutron.tests.unit. test_l3_plugin .TestNoL3NatPlugin'
plugin = ' neutron.tests.unit. extensions. test_l3.TestNoL3NatPlugin'
# the L3 service plugin
l3_plugin = ( ' neutron.tests.unit. test_l3_plugin .'
l3_plugin = ( ' neutron.tests.unit. extensions. test_l3.'
' TestL3NatServicePlugin ' )
service_plugins = { ' l3_plugin_name ' : l3_plugin }
@ -2475,12 +2475,12 @@ class L3BaseForSepTests(test_db_plugin.NeutronDbPluginV2TestCase):
class L3NatDBIntAgentSchedulingTestCase ( L3BaseForIntTests ,
L3NatTestCaseMixin ,
test_agent _ext_plugin .
test_agent .
AgentDBTestMixIn ) :
""" Unit tests for core plugin with L3 routing and scheduling integrated. """
def setUp ( self , plugin = ' neutron.tests.unit. test_l3_plugin .'
def setUp ( self , plugin = ' neutron.tests.unit. extensions. test_l3.'
' TestL3NatIntAgentSchedulingPlugin ' ,
ext_mgr = None , service_plugins = None ) :
self . mock_rescheduling = False