Add call to the directory add_plugin method
This patch fixes unit tests failure due to adopting oslo-versioned objects (ovo) for neutorn db by adding the core plugin instance to the plugin directroy in the test. Change-Id: Ib0de20addf428c88c169e46ac3b63e4eb0efdb2d
This commit is contained in:
parent
3ebd389278
commit
c29cc9c73b
|
@ -21,7 +21,9 @@ import mock
|
||||||
from mock import patch
|
from mock import patch
|
||||||
from neutron_lib.api.definitions import portbindings
|
from neutron_lib.api.definitions import portbindings
|
||||||
from neutron_lib import constants as n_const
|
from neutron_lib import constants as n_const
|
||||||
|
from neutron_lib.plugins import directory
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from oslo_utils import importutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
import neutron.db.api as db
|
import neutron.db.api as db
|
||||||
|
@ -258,6 +260,9 @@ class _UnorderedDictList(list):
|
||||||
class TestAristaJSONRPCWrapper(testlib_api.SqlTestCase):
|
class TestAristaJSONRPCWrapper(testlib_api.SqlTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestAristaJSONRPCWrapper, self).setUp()
|
super(TestAristaJSONRPCWrapper, self).setUp()
|
||||||
|
plugin_klass = importutils.import_class(
|
||||||
|
"neutron.db.db_base_plugin_v2.NeutronDbPluginV2")
|
||||||
|
directory.add_plugin(n_const.CORE, plugin_klass())
|
||||||
setup_valid_config()
|
setup_valid_config()
|
||||||
ndb = db_lib.NeutronNets()
|
ndb = db_lib.NeutronNets()
|
||||||
self.drv = arista_ml2.AristaRPCWrapperJSON(ndb)
|
self.drv = arista_ml2.AristaRPCWrapperJSON(ndb)
|
||||||
|
@ -1863,6 +1868,9 @@ class SyncServiceTest(testlib_api.SqlTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(SyncServiceTest, self).setUp()
|
super(SyncServiceTest, self).setUp()
|
||||||
|
plugin_klass = importutils.import_class(
|
||||||
|
"neutron.db.db_base_plugin_v2.NeutronDbPluginV2")
|
||||||
|
directory.add_plugin(n_const.CORE, plugin_klass())
|
||||||
self.rpc = mock.MagicMock()
|
self.rpc = mock.MagicMock()
|
||||||
ndb = db_lib.NeutronNets()
|
ndb = db_lib.NeutronNets()
|
||||||
self.sync_service = arista_ml2.SyncService(self.rpc, ndb)
|
self.sync_service = arista_ml2.SyncService(self.rpc, ndb)
|
||||||
|
|
Loading…
Reference in New Issue