def test_get_floating_agent_gw_interfaces(self):
    fake_network_id = _uuid()
    subnet_id = _uuid()
    agent_gateway_port = [{'fixed_ips': [{'ip_address': '0.0.0.0', 'prefixlen': 24, 'subnet_id': subnet_id}], 'subnets': [{'id': subnet_id, 'cidr': '20.0.0.0/24', 'gateway_ip': '0.0.0.0'}], 'id': _uuid(), portbindings.HOST_ID: 'myhost', 'device_owner': lib_constants.DEVICE_OWNER_AGENT_GW, 'network_id': fake_network_id, 'mac_address': 'ca:fe:de:ad:be:ef'}]
    router = l3_test_common.prepare_router_data(enable_snat=True)
    router[lib_constants.FLOATINGIP_AGENT_INTF_KEY] = agent_gateway_port
    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)
    self.assertEqual(agent_gateway_port[0], ri.get_floating_agent_gw_interface(fake_network_id))
def test_get_floating_agent_gw_interfaces(self):
    fake_network_id = _uuid()
    subnet_id = _uuid()
    agent_gateway_port = [{'fixed_ips': [{'ip_address': '0.0.0.0', 'prefixlen': 24, 'subnet_id': subnet_id}], 'subnets': [{'id': subnet_id, 'cidr': '20.0.0.0/24', 'gateway_ip': '0.0.0.0'}], 'id': _uuid(), portbindings.HOST_ID: 'myhost', 'device_owner': lib_constants.DEVICE_OWNER_AGENT_GW, 'network_id': fake_network_id, 'mac_address': 'ca:fe:de:ad:be:ef'}]
    router = l3_test_common.prepare_router_data(enable_snat=True)
    router[lib_constants.FLOATINGIP_AGENT_INTF_KEY] = agent_gateway_port
    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)
    self.assertEqual(agent_gateway_port[0], ri.get_floating_agent_gw_interface(fake_network_id))