def test_process_router_dist_floating_ip_add(self):
    fake_floatingips = {'floatingips': [{'id': _uuid(), 'host': HOSTNAME, 'floating_ip_address': '0.0.0.0', 'fixed_ip_address': '192.168.0.1', 'floating_network_id': mock.sentinel.ext_net_id, 'port_id': _uuid()}, {'id': _uuid(), 'host': 'some-other-host', 'floating_ip_address': '0.0.0.0', 'fixed_ip_address': '192.168.0.10', 'floating_network_id': mock.sentinel.ext_net_id, 'port_id': _uuid()}]}
    router = l3_test_common.prepare_router_data(enable_snat=True)
    router[lib_constants.FLOATINGIP_KEY] = fake_floatingips['floatingips']
    router['distributed'] = True
    agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
    self._set_ri_kwargs(agent, router['id'], router)
    ri = dvr_router.DvrLocalRouter(HOSTNAME, **self.ri_kwargs)
    ri.iptables_manager.ipv4['nat'] = mock.MagicMock()
    fip_ns = agent.get_fip_ns(mock.sentinel.ext_net_id)
    subnet_id = _uuid()
    fip_ns.agent_gateway_port = {'fixed_ips': [{'ip_address': '0.0.0.0', 'subnet_id': subnet_id}], 'subnets': [{'id': subnet_id, 'cidr': '20.0.0.0/24', 'gateway_ip': '0.0.0.0'}], 'id': _uuid(), 'network_id': _uuid(), 'mac_address': 'ca:fe:de:ad:be:ef'}
def test_process_router_dist_floating_ip_add(self):
    fake_floatingips = {'floatingips': [{'id': _uuid(), 'host': HOSTNAME, 'floating_ip_address': '0.0.0.0', 'fixed_ip_address': '192.168.0.1', 'floating_network_id': mock.sentinel.ext_net_id, 'port_id': _uuid()}, {'id': _uuid(), 'host': 'some-other-host', 'floating_ip_address': '0.0.0.0', 'fixed_ip_address': '192.168.0.10', 'floating_network_id': mock.sentinel.ext_net_id, 'port_id': _uuid()}]}
    router = l3_test_common.prepare_router_data(enable_snat=True)
    router[lib_constants.FLOATINGIP_KEY] = fake_floatingips['floatingips']
    router['distributed'] = True
    agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
    self._set_ri_kwargs(agent, router['id'], router)
    ri = dvr_router.DvrLocalRouter(HOSTNAME, **self.ri_kwargs)
    ri.iptables_manager.ipv4['nat'] = mock.MagicMock()
    fip_ns = agent.get_fip_ns(mock.sentinel.ext_net_id)
    subnet_id = _uuid()
    fip_ns.agent_gateway_port = {'fixed_ips': [{'ip_address': '0.0.0.0', 'subnet_id': subnet_id}], 'subnets': [{'id': subnet_id, 'cidr': '20.0.0.0/24', 'gateway_ip': '0.0.0.0'}], 'id': _uuid(), 'network_id': _uuid(), 'mac_address': 'ca:fe:de:ad:be:ef'}