Fix misc unit test failures
A recent commit landed with failing unit tests, but due to gate misconfiguration this was not picked up during pre-commit testing. Fixup offending code. Change-Id: I20488efabe91b2423c85dd4e7474cbaf9a0a0261
This commit is contained in:
parent
54449e783d
commit
f4ef607187
@ -393,6 +393,7 @@ def configure_ovs():
|
||||
if ext_port_ctx and ext_port_ctx['ext_port']:
|
||||
add_bridge_port(EXT_BRIDGE, ext_port_ctx['ext_port'])
|
||||
|
||||
bridgemaps = None
|
||||
if not use_dpdk():
|
||||
portmaps = DataPortContext()()
|
||||
bridgemaps = parse_bridge_mappings(config('bridge-mappings'))
|
||||
@ -420,7 +421,8 @@ def configure_ovs():
|
||||
|
||||
target = config('ipfix-target')
|
||||
bridges = [INT_BRIDGE, EXT_BRIDGE]
|
||||
bridges.extend(bridgemaps.values())
|
||||
if bridgemaps:
|
||||
bridges.extend(bridgemaps.values())
|
||||
|
||||
if target:
|
||||
for bridge in bridges:
|
||||
|
5
tox.ini
5
tox.ini
@ -27,6 +27,11 @@ basepython = python3.5
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:py36]
|
||||
basepython = python3.6
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
|
@ -501,11 +501,12 @@ class TestNeutronOVSUtils(CharmTestCase):
|
||||
any_order=True
|
||||
)
|
||||
|
||||
@patch.object(nutils, 'use_dvr')
|
||||
@patch('charmhelpers.contrib.openstack.context.config')
|
||||
def test_configure_ovs_enable_ipfix(self, mock_config):
|
||||
def test_configure_ovs_enable_ipfix(self, mock_config, mock_use_dvr):
|
||||
mock_use_dvr.return_value = False
|
||||
mock_config.side_effect = self.test_config.get
|
||||
self.config.side_effect = self.test_config.get
|
||||
self.test_config.set('plugin', 'ovs')
|
||||
self.test_config.set('ipfix-target', '127.0.0.1:80')
|
||||
nutils.configure_ovs()
|
||||
self.enable_ipfix.assert_has_calls([
|
||||
|
Loading…
Reference in New Issue
Block a user