diff --git a/neutron/plugins/ml2/rpc.py b/neutron/plugins/ml2/rpc.py index ae447fa8e4..18338b0425 100644 --- a/neutron/plugins/ml2/rpc.py +++ b/neutron/plugins/ml2/rpc.py @@ -123,6 +123,7 @@ class RpcCallbacks(n_rpc.RpcCallback, entry = {'device': device, 'network_id': port['network_id'], 'port_id': port_id, + 'mac_address': port['mac_address'], 'admin_state_up': port['admin_state_up'], 'network_type': segment[api.NETWORK_TYPE], 'segmentation_id': segment[api.SEGMENTATION_ID], diff --git a/neutron/tests/unit/ml2/test_port_binding.py b/neutron/tests/unit/ml2/test_port_binding.py index b4aa19a9ca..3f3c4b2053 100644 --- a/neutron/tests/unit/ml2/test_port_binding.py +++ b/neutron/tests/unit/ml2/test_port_binding.py @@ -55,7 +55,9 @@ class PortBindingTestCase(test_plugin.NeutronDbPluginV2TestCase): def _test_port_binding(self, host, vif_type, has_port_filter, bound, status=None): - host_arg = {portbindings.HOST_ID: host} + mac_address = 'aa:aa:aa:aa:aa:aa' + host_arg = {portbindings.HOST_ID: host, + 'mac_address': mac_address} with self.port(name='name', arg_list=(portbindings.HOST_ID,), **host_arg) as port: self._check_response(port['port'], vif_type, has_port_filter, @@ -66,8 +68,10 @@ class PortBindingTestCase(test_plugin.NeutronDbPluginV2TestCase): neutron_context, agent_id="theAgentId", device=port_id) if bound: self.assertEqual(details['network_type'], 'local') + self.assertEqual(mac_address, details['mac_address']) else: self.assertNotIn('network_type', details) + self.assertNotIn('mac_address', details) def test_unbound(self): self._test_port_binding("",