test_l3_plugin: L3AgentDbInteTestCase L3AgentDbSepTestCase fails

L3AgentDbInteTestCase and L3AgentDbSepTestCase fails when they are run
independently without other test case. something like
tox -e py27 neutron.tests.unit.test_l3_plugin
It's because necessary oslo.config options aren't properly initialized
when instantiating service plugin.
Initialize config before instantiating plugin.

Change-Id: Ic6dd28e3caf8b9e3322bf2df99e67adb138cb234
Closes-Bug: #1350252
This commit is contained in:
Isaku Yamahata 2014-07-30 18:07:04 +09:00
parent 461a910478
commit 748d4fdaf6
1 changed files with 4 additions and 6 deletions

View File

@ -2057,10 +2057,9 @@ class L3AgentDbIntTestCase(L3BaseForIntTests, L3AgentDbTestCaseBase):
"""
def setUp(self):
self.core_plugin = TestL3NatIntPlugin()
# core plugin is also plugin providing L3 routing
self.plugin = self.core_plugin
super(L3AgentDbIntTestCase, self).setUp()
self.core_plugin = TestL3NatIntPlugin()
self.plugin = self.core_plugin
class L3AgentDbSepTestCase(L3BaseForSepTests, L3AgentDbTestCaseBase):
@ -2070,10 +2069,9 @@ class L3AgentDbSepTestCase(L3BaseForSepTests, L3AgentDbTestCaseBase):
"""
def setUp(self):
self.core_plugin = TestNoL3NatPlugin()
# core plugin is also plugin providing L3 routing
self.plugin = TestL3NatServicePlugin()
super(L3AgentDbSepTestCase, self).setUp()
self.core_plugin = TestNoL3NatPlugin()
self.plugin = TestL3NatServicePlugin()
class L3NatDBIntTestCase(L3BaseForIntTests, L3NatTestCaseBase):