From: Kevin Benton Date: Fri, 27 Mar 2015 15:13:58 +0000 (-0700) Subject: Fix test case for DHCP agent interface restart X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=18c5a8b2e9161e8beda8a14078a1e8d666e900d1;p=openstack-build%2Fneutron-build.git Fix test case for DHCP agent interface restart One of the new test cases in the recent DHCP interface patch[1] was supposed to confirm that the driver wouldn't be restarted if the IP address stayed the same. However, it wasn't matching the device ID of the agent so it was never making it to that conditional. This patch just fixes that UT so it's exercising the right code path. 1. c4a7447e2d659b3a240a62ae9d34e6e0b9cee7a3 Change-Id: I8735c6e533d6b486c32cfded2c22eac8a25c855d --- diff --git a/neutron/tests/unit/test_dhcp_agent.py b/neutron/tests/unit/test_dhcp_agent.py index b574f9312..c618658f7 100644 --- a/neutron/tests/unit/test_dhcp_agent.py +++ b/neutron/tests/unit/test_dhcp_agent.py @@ -930,9 +930,12 @@ class TestDhcpAgentEventHandler(base.BaseTestCase): [mock.call.call_driver('restart', fake_network)]) def test_port_update_on_dhcp_agents_port_no_ip_change(self): - payload = dict(port=fake_port1) self.cache.get_network_by_id.return_value = fake_network self.cache.get_port_by_id.return_value = fake_port1 + payload = dict(port=fake_port1) + device_id = utils.get_dhcp_agent_device_id( + payload['port']['network_id'], self.dhcp.conf.host) + payload['port']['device_id'] = device_id self.dhcp.port_update_end(None, payload) self.call_driver.assert_has_calls( [mock.call.call_driver('reload_allocations', fake_network)])