existing_fip = '19.4.4.2'
new_fip = '19.4.4.3'
self._add_fip(router, new_fip)
- router.router['gw_port']['subnet']['gateway_ip'] = '19.4.4.5'
- router.router['gw_port']['fixed_ips'][0]['ip_address'] = '19.4.4.10'
+ subnet_id = _uuid()
+ fixed_ips = [{'ip_address': '19.4.4.10',
+ 'prefixlen': 24,
+ 'subnet_id': subnet_id}]
+ subnets = [{'id': subnet_id,
+ 'cidr': '19.4.4.0/24',
+ 'gateway_ip': '19.4.4.5'}]
+ router.router['gw_port']['subnets'] = subnets
+ router.router['gw_port']['fixed_ips'] = fixed_ips
- self.agent.process_router(router)
+ router.process(self.agent)
# Get the updated configuration and assert that both FIPs are in,
# and that the GW IP address was updated.
router_append_interface(router)
# Reassign the router object to RouterInfo
ri.router = router
- agent.process_router(ri)
- # send_arp is called both times process_router is called
+ ri.process(agent)
+ # send_arp is called both times process is called
self.assertEqual(self.send_arp.call_count, 2)
- def test_process_ipv6_only_gw(self):
+ def _test_process_ipv6_only_or_dual_stack_gw(self, dual_stack=False):
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
- router = prepare_router_data(ip_version=6)
+ router = prepare_router_data(ip_version=6, dual_stack=dual_stack)
# Get NAT rules without the gw_port
gw_port = router['gw_port']
router['gw_port'] = None