]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
test_l3_plugin: L3AgentDbInteTestCase L3AgentDbSepTestCase fails
authorIsaku Yamahata <isaku.yamahata@intel.com>
Wed, 30 Jul 2014 09:07:04 +0000 (18:07 +0900)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Wed, 30 Jul 2014 10:32:31 +0000 (19:32 +0900)
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

neutron/tests/unit/test_l3_plugin.py

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