Browse Source

OSP-244 Fix inheritance issue for TestBigSwitchMechDriverNetworksV2

TestBigSwitchMechDriverNetworksV2 was inherited from two classes,
both of them have a setUp() method, previously, TestNetworksV2's
setUp() was called, while our setUp() was not called. This caused
an issue that topo sync was still triggled and made
test_create_network unstable.

Changing the order of classes being inherited is easy but that would
not be compatible with python3.

Specifying the super class for setUp() is a more consistent fix.

Change-Id: Ic01394b4875d1cbafd84d26f093ad56ccfd424ab
tags/14.0.0
Weifan Fu 8 months ago
parent
commit
2b962d5fdf

+ 6
- 0
networking_bigswitch/tests/unit/ml2/drivers/test_bigswitch_mech.py View File

@@ -78,6 +78,12 @@ class TestBigSwitchMechDriverBase(trp.BigSwitchProxyPluginV2TestCase):
78 78
 
79 79
 class TestBigSwitchMechDriverNetworksV2(test_db_base_plugin_v2.TestNetworksV2,
80 80
                                         TestBigSwitchMechDriverBase):
81
+    def setUp(self, plugin=None, service_plugins=None, ext_mgr=None):
82
+        TestBigSwitchMechDriverBase.setUp(self,
83
+                                          plugin=plugin,
84
+                                          service_plugins=service_plugins,
85
+                                          ext_mgr=ext_mgr)
86
+
81 87
     def test_create_network(self):
82 88
         name = 'net1'
83 89
         keys = [('subnets', []), ('name', name), ('admin_state_up', True),

Loading…
Cancel
Save