'Test to validate the fip and router namespace routes.
This test validates the fip and router namespace routes
that are based on the address scopes.
If the address scopes of internal network and external network
matches, the traffic will be forwarded to the fip namespace and
the reverse traffic to the private network is forwarded to the
router namespace.'

def _setup_dvr_router_for_fast_path_exit(self, address_scopes=True):

    self.agent.conf.agent_mode = 'dvr'
    router_info = self.generate_dvr_router_info(enable_snat=True, enable_gw=True, enable_floating_ip=True)
    fip_agent_gw_port = router_info[n_const.FLOATINGIP_AGENT_INTF_KEY]
    self.mock_plugin_api.get_agent_gateway_port.return_value = fip_agent_gw_port[0]
    router_info[lib_constants.FLOATINGIP_KEY] = []
    if address_scopes:
        address_scope1 = {str(lib_constants.IP_VERSION_4): 'scope1'}
        address_scope2 = {str(lib_constants.IP_VERSION_4): 'scope1'}
    else:
        address_scope1 = {str(lib_constants.IP_VERSION_4): 'scope2'}
        address_scope2 = {str(lib_constants.IP_VERSION_4): 'scope2'}
    router_info['gw_port']['address_scopes'] = {str(lib_constants.IP_VERSION_4): 'scope1'}
    router_info[lib_constants.INTERFACE_KEY][0]['address_scopes'] = address_scope1
    router_info[lib_constants.INTERFACE_KEY][1]['address_scopes'] = address_scope2
    router1 = self.manage_router(self.agent, router_info)
    fip_ns_name = router1.fip_ns.get_name()
    self.assertTrue(self._namespace_exists(router1.ns_name))
    self.assertTrue(self._namespace_exists(fip_ns_name))
    rfp_device_name = router1.fip_ns.get_rtr_ext_device_name(router1.router_id)
    rfp_device = ip_lib.IPDevice(rfp_device_name, namespace=router1.ns_name)
    fpr_device_name = router1.fip_ns.get_int_device_name(router1.router_id)
    fpr_device = ip_lib.IPDevice(fpr_device_name, namespace=fip_ns_name)
    (rtr_2_fip, fip_2_rtr) = router1.rtr_fip_subnet.get_pair()
    self._assert_default_gateway(fip_2_rtr, rfp_device, rfp_device_name)
    ns_ipr = ip_lib.IPRule(namespace=router1.ns_name)
    ip4_rules_list = ns_ipr.rule.list_rules(lib_constants.IP_VERSION_4)
    ip6_rules_list = ns_ipr.rule.list_rules(lib_constants.IP_VERSION_6)
    self.assertEqual(5, len(ip4_rules_list))
    self.assertEqual(2, len(ip6_rules_list))
    self._assert_fip_namespace_interface_static_routes(address_scopes, fpr_device, router_info, rtr_2_fip, fpr_device_name)
    self._assert_interface_rules_on_gateway_remove(router1, self.agent, address_scopes, fip_agent_gw_port[0], rfp_device, fpr_device)
