Merge "[Functional] Fix mocks of the create_dhcp_port method" into stable/wallaby

This commit is contained in:
Zuul 2021-04-19 21:28:01 +00:00 committed by Gerrit Code Review
commit c3cbf37858
1 changed files with 5 additions and 10 deletions

View File

@ -357,17 +357,12 @@ class DHCPAgentOVSTestCase(DHCPAgentOVSTestFramework):
new_network.subnets.append(dhcp_enabled_ipv4_subnet) new_network.subnets.append(dhcp_enabled_ipv4_subnet)
self.mock_plugin_api.get_network_info.return_value = new_network self.mock_plugin_api.get_network_info.return_value = new_network
fixed_ip_mock = mock.Mock( dhcp_port_mock = self.create_port_dict(
ip_address='192.168.10.2', network.id, dhcp_enabled_ipv4_subnet.id,
subnet_id=dhcp_enabled_ipv4_subnet.id)
dhcp_port_mock = mock.Mock(
dns_assignment={},
extra_dhcp_opts=[],
fixed_ips=[fixed_ip_mock],
id=new_network.ports[0].id,
mac_address=str(self._DHCP_PORT_MAC_ADDRESS)) mac_address=str(self._DHCP_PORT_MAC_ADDRESS))
self.mock_plugin_api.get_dhcp_port.return_value = dhcp_port_mock self.mock_plugin_api.create_dhcp_port.return_value = dhcp_port_mock
self.mock_plugin_api.update_dhcp_port.return_value = dhcp_port_mock network.ports = []
new_network.ports = []
self.agent.refresh_dhcp_helper(network.id) self.agent.refresh_dhcp_helper(network.id)
# Metadata proxy should be spawned for the newly added subnet # Metadata proxy should be spawned for the newly added subnet