Skip Octavia init in UT

Some UT get stuck becasue of conflicts with the Octavia RPC

Change-Id: I209b7f38b5317d1158b9046e7f77e0619d3e5818
This commit is contained in:
Adit Sarfaty 2018-10-11 09:32:30 +03:00
parent 9c7991dacb
commit e86f7a1af5
1 changed files with 10 additions and 0 deletions

View File

@ -195,6 +195,7 @@ class NsxVPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase):
ext_mgr=None,
service_plugins=None,
with_md_proxy=True,
with_octavia=False,
**kwargs):
test_utils.override_nsx_ini_test()
mock_vcns = mock.patch(vmware.VCNS_NAME, autospec=True)
@ -239,6 +240,15 @@ class NsxVPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase):
# Add some mocks required for the md code
mock.patch.object(edge_utils, "update_internal_interface").start()
# Skip Octavia init because of RPC conflicts
if not with_octavia:
mock.patch("vmware_nsx.services.lbaas.octavia.octavia_listener."
"NSXOctaviaListener.__init__",
return_value=None).start()
mock.patch("vmware_nsx.services.lbaas.octavia.octavia_listener."
"NSXOctaviaStatisticsCollector.__init__",
return_value=None).start()
if service_plugins is not None:
# override the service plugins only if specified directly
super(NsxVPluginV2TestCase, self).setUp(