Merge "Initialize phys bridges before setup_rpc" into stable/queens

This commit is contained in:
Zuul 2019-08-19 11:11:42 +00:00 committed by Gerrit Code Review
commit ccb850e6a9
2 changed files with 16 additions and 1 deletions

View File

@ -178,7 +178,6 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
self.network_ports = collections.defaultdict(set) self.network_ports = collections.defaultdict(set)
# keeps association between ports and ofports to detect ofport change # keeps association between ports and ofports to detect ofport change
self.vifname_to_ofport_map = {} self.vifname_to_ofport_map = {}
self.setup_rpc()
# Stores newly created bridges # Stores newly created bridges
self.added_bridges = list() self.added_bridges = list()
self.bridge_mappings = self._parse_bridge_mappings( self.bridge_mappings = self._parse_bridge_mappings(
@ -212,6 +211,8 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
self.setup_tunnel_br(ovs_conf.tunnel_bridge) self.setup_tunnel_br(ovs_conf.tunnel_bridge)
self.setup_tunnel_br_flows() self.setup_tunnel_br_flows()
self.setup_rpc()
agent_api = ovs_ext_api.OVSAgentExtensionAPI(self.int_br, self.tun_br) agent_api = ovs_ext_api.OVSAgentExtensionAPI(self.int_br, self.tun_br)
self.ext_manager.initialize( self.ext_manager.initialize(
self.connection, constants.EXTENSION_DRIVER_TYPE, agent_api) self.connection, constants.EXTENSION_DRIVER_TYPE, agent_api)

View File

@ -175,6 +175,20 @@ class TestOvsNeutronAgent(object):
"Port", mock.ANY, "other_config", vlan_mapping) "Port", mock.ANY, "other_config", vlan_mapping)
self.assertTrue(needs_binding) self.assertTrue(needs_binding)
def test_setup_physical_bridges_during_agent_initialization(self):
with mock.patch.object(
self.mod_agent.OVSNeutronAgent,
'setup_physical_bridges') as setup_physical_bridges,\
mock.patch.object(
self.mod_agent.OVSNeutronAgent, 'setup_rpc') as setup_rpc:
setup_rpc.side_effect = oslo_messaging.MessagingException(
"Test communication failure")
try:
self._make_agent()
except oslo_messaging.MessagingException:
pass
setup_physical_bridges.assert_called_once_with(mock.ANY)
def test_datapath_type_system(self): def test_datapath_type_system(self):
# verify kernel datapath is default # verify kernel datapath is default
expected = constants.OVS_DATAPATH_SYSTEM expected = constants.OVS_DATAPATH_SYSTEM