Fix mock.patch.stopall issue with ovsdbapp

After I876919dfc1fa0ae36bd99e3d760e38d207ee6ef3, two test classes
that inherit from both neutron's oslotest-based base classes and
ovsdbapp's unittest-based base class would fail due to
mock.patch.stopall being called twice. This appears to be because
of some special handling in oslotest addCleanup that checks a
private _cleanups variable before adding a cleanup to stopall.
Changing the order of the imports so that neutron can register its
cleanups first seems to fix the issue.

Closes-Bug: #1878708
Change-Id: I5b3812a9765a37b3e66d6c8ca0cb42ee1b7a2b9a
This commit is contained in:
Terry Wilson 2020-05-14 22:27:10 +00:00
parent cb55643a06
commit ccb0cddd4a
2 changed files with 4 additions and 4 deletions

View File

@ -24,8 +24,8 @@ from neutron.tests.functional import base as n_base
from neutron.tests.functional.resources.ovsdb import events
class TestSbApi(base.FunctionalTestCase,
n_base.BaseLoggingTestCase):
class TestSbApi(n_base.BaseLoggingTestCase,
base.FunctionalTestCase):
schemas = ['OVN_Southbound', 'OVN_Northbound']
def setUp(self):

View File

@ -599,8 +599,8 @@ class TestExternalPorts(base.TestOVNFunctionalBase):
self._test_external_port_update_switchdev(portbindings.VNIC_MACVTAP)
class TestCreateDefaultDropPortGroup(ovs_base.FunctionalTestCase,
base.BaseLoggingTestCase):
class TestCreateDefaultDropPortGroup(base.BaseLoggingTestCase,
ovs_base.FunctionalTestCase):
schemas = ['OVN_Southbound', 'OVN_Northbound']
PG_NAME = ovn_const.OVN_DROP_PORT_GROUP_NAME