From: Jenkins Date: Fri, 21 Nov 2014 09:32:08 +0000 (+0000) Subject: Merge "Refactor l2_pop code to pass mac/ip info more readably" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f4646eaca811bad56f502cf7376120730130ca8e;p=openstack-build%2Fneutron-build.git Merge "Refactor l2_pop code to pass mac/ip info more readably" --- f4646eaca811bad56f502cf7376120730130ca8e diff --cc neutron/agent/l2population_rpc.py index c94d29bb1,6cc64fc68..2ffcd2be4 --- a/neutron/agent/l2population_rpc.py +++ b/neutron/agent/l2population_rpc.py @@@ -117,11 -128,12 +145,13 @@@ class L2populationRpcCallBackTunnelMixi :param br: represent the bridge on which del_fdb_flow should be applied. - :param port_info: a list to contain mac and ip. - [mac, ip] + :param port_info: PortInfo instance to include mac and ip. + .mac_address + .ip_address + :remote_ip: remote ip address. - :param lvm: local VLAN map of network. + :param lvm: local VLAN map of a network. See add_fdb_flow for + more explanation. :param ofport: a port to delete. ''' pass @@@ -256,9 -259,11 +286,12 @@@ 'net2': ... } + + PortInfo has .mac_address and .ip_address attrs. + :param local_ip: local IP address of this agent. - :local_vlan_map: local VLAN map of network. + :param local_vlan_map: A dict to map network_id to + the corresponding lvm entry. ''' for network_id, agent_ports in fdb_entries.items(): diff --cc neutron/common/constants.py index e424450d2,2935760c6..fc8205669 --- a/neutron/common/constants.py +++ b/neutron/common/constants.py @@@ -70,8 -70,21 +70,8 @@@ MAX_GRE_ID = 2 ** 32 - MIN_VXLAN_VNI = 1 MAX_VXLAN_VNI = 2 ** 24 - 1 - FLOODING_ENTRY = ['00:00:00:00:00:00', '0.0.0.0'] + FLOODING_ENTRY = ('00:00:00:00:00:00', '0.0.0.0') -EXT_NS_COMP = '_backward_comp_e_ns' -EXT_NS = '_extension_ns' -XML_NS_V20 = 'http://openstack.org/quantum/api/v2.0' -XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance" -XSI_ATTR = "xsi:nil" -XSI_NIL_ATTR = "xmlns:xsi" -ATOM_NAMESPACE = "http://www.w3.org/2005/Atom" -ATOM_XMLNS = "xmlns:atom" -ATOM_LINK_NOTATION = "{%s}link" % ATOM_NAMESPACE -TYPE_XMLNS = "xmlns:quantum" -TYPE_ATTR = "quantum:type" -VIRTUAL_ROOT_KEY = "_v_root" - TYPE_BOOL = "bool" TYPE_INT = "int" TYPE_LONG = "long" diff --cc neutron/tests/unit/ml2/drivers/test_l2population.py index fa5a8be99,1073a0e48..70aa4945a --- a/neutron/tests/unit/ml2/drivers/test_l2population.py +++ b/neutron/tests/unit/ml2/drivers/test_l2population.py @@@ -24,10 -25,12 +25,11 @@@ from neutron.extensions import portbind from neutron.extensions import providernet as pnet from neutron import manager from neutron.openstack.common import timeutils -from neutron.plugins.ml2 import config as config from neutron.plugins.ml2.drivers.l2pop import mech_driver as l2pop_mech_driver + from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc from neutron.plugins.ml2 import managers from neutron.plugins.ml2 import rpc -from neutron.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit.ml2 import test_ml2_plugin as test_plugin HOST = 'my_l2_host' L2_AGENT = { @@@ -90,13 -93,24 +92,15 @@@ L2_AGENT_5 = NOTIFIER = 'neutron.plugins.ml2.rpc.AgentNotifierApi' DEVICE_OWNER_COMPUTE = 'compute:None' + FLOODING_ENTRY_AS_LIST = list(constants.FLOODING_ENTRY) + -class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase): +class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase): + _mechanism_drivers = ['openvswitch', 'linuxbridge', + 'ofagent', 'l2population'] def setUp(self): - # Enable the test mechanism driver to ensure that - # we can successfully call through to all mechanism - # driver apis. - config.cfg.CONF.set_override('mechanism_drivers', - ['openvswitch', 'linuxbridge', - 'ofagent', 'l2population'], - 'ml2') - config.cfg.CONF.set_override('network_vlan_ranges', - ['phys1:1:100'], - 'ml2_type_vlan') - super(TestL2PopulationRpcTestCase, self).setUp(PLUGIN_NAME) + super(TestL2PopulationRpcTestCase, self).setUp() self.adminContext = context.get_admin_context()