diff options
226 files changed, 5212 insertions, 1172 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 890f7963e6..15d647f4df 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1485,10 +1485,10 @@ static void update_evpn_route_entry_sync_info(struct bgp *bgp, * or the global route table. */ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, - afi_t afi, safi_t safi, struct bgp_dest *dest, - struct attr *attr, int add, - struct bgp_path_info **pi, uint8_t flags, - uint32_t seq, bool setup_sync, + afi_t afi, safi_t safi, + struct bgp_dest *dest, struct attr *attr, + int add, struct bgp_path_info **pi, + uint8_t flags, uint32_t seq, bool vpn_rt, bool *old_is_sync) { struct bgp_path_info *tmp_pi; @@ -1520,7 +1520,7 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, /* if a local path is being added with a non-zero esi look * for SYNC paths from ES peers and bubble up the sync-info */ - update_evpn_route_entry_sync_info(bgp, dest, attr, seq, setup_sync); + update_evpn_route_entry_sync_info(bgp, dest, attr, seq, vpn_rt); /* For non-GW MACs, update MAC mobility seq number, if needed. */ if (seq && !CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_GW)) @@ -1612,6 +1612,14 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, } } + /* MAC-IP routes in the VNI route table are linked to the + * destination ES + */ + if (route_change && vpn_rt + && (evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE)) + bgp_evpn_path_es_link(tmp_pi, vpn->vni, + bgp_evpn_attr_get_esi(tmp_pi->attr)); + /* Return back the route entry. */ *pi = tmp_pi; return route_change; @@ -2513,7 +2521,7 @@ static int install_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, if (!pi) { /* Create an info */ - (void)bgp_create_evpn_bgp_path_info(parent_pi, dest, + pi = bgp_create_evpn_bgp_path_info(parent_pi, dest, parent_pi->attr); } else { if (attrhash_cmp(pi->attr, parent_pi->attr) @@ -2539,6 +2547,11 @@ static int install_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, pi->uptime = bgp_clock(); } + /* MAC-IP routes in the VNI table are linked to the destination ES */ + if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) + bgp_evpn_path_es_link(pi, vpn->vni, + bgp_evpn_attr_get_esi(pi->attr)); + /* Perform route selection and update zebra, if required. */ ret = evpn_route_select_install(bgp, vpn, dest); @@ -2852,6 +2865,55 @@ static int bgp_evpn_route_rmac_self_check(struct bgp *bgp_vrf, return 0; } +/* don't import hosts that are locally attached */ +static inline bool +bgp_evpn_skip_vrf_import_of_local_es(const struct prefix_evpn *evp, + struct bgp_path_info *pi, int install) +{ + esi_t *esi; + struct in_addr nh; + + if (evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) { + esi = bgp_evpn_attr_get_esi(pi->attr); + + /* Don't import routes that point to a local destination */ + if (bgp_evpn_attr_is_local_es(pi->attr)) { + if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) { + char esi_buf[ESI_STR_LEN]; + + zlog_debug( + "vrf %s of evpn prefix %pFX skipped, local es %s", + install ? "import" : "unimport", evp, + esi_to_str(esi, esi_buf, + sizeof(esi_buf))); + } + return true; + } + + /* Don't import routes with ES as destination if the nexthop + * has not been advertised via the EAD-ES + */ + if (pi->attr) + nh = pi->attr->nexthop; + else + nh.s_addr = 0; + if (install && !bgp_evpn_es_is_vtep_active(esi, nh)) { + if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) { + char esi_buf[ESI_STR_LEN]; + + zlog_debug( + "vrf %s of evpn prefix %pFX skipped, nh %pI4 inactive in es %s", + install ? "import" : "unimport", evp, + &nh, + esi_to_str(esi, esi_buf, + sizeof(esi_buf))); + } + return true; + } + } + return false; +} + /* * Install or uninstall mac-ip routes are appropriate for this * particular VRF. @@ -2909,6 +2971,12 @@ static int install_uninstall_routes_for_vrf(struct bgp *bgp_vrf, int install) && pi->sub_type == BGP_ROUTE_NORMAL)) continue; + /* don't import hosts that are locally attached + */ + if (bgp_evpn_skip_vrf_import_of_local_es( + evp, pi, install)) + continue; + if (is_route_matching_for_vrf(bgp_vrf, pi)) { if (bgp_evpn_route_rmac_self_check( bgp_vrf, evp, pi)) @@ -3115,6 +3183,10 @@ static int install_uninstall_route_in_vrfs(struct bgp *bgp_def, afi_t afi, || is_evpn_prefix_ipaddr_v6(evp))) return 0; + /* don't import hosts that are locally attached */ + if (bgp_evpn_skip_vrf_import_of_local_es(evp, pi, install)) + return 0; + for (ALL_LIST_ELEMENTS(vrfs, node, nnode, bgp_vrf)) { int ret; @@ -3177,9 +3249,11 @@ static int install_uninstall_route_in_vnis(struct bgp *bgp, afi_t afi, /* * Install or uninstall route for appropriate VNIs/ESIs. */ -static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi, - const struct prefix *p, - struct bgp_path_info *pi, int import) +static int bgp_evpn_install_uninstall_table(struct bgp *bgp, afi_t afi, + safi_t safi, const struct prefix *p, + struct bgp_path_info *pi, + int import, bool in_vni_rt, + bool in_vrf_rt) { struct prefix_evpn *evp = (struct prefix_evpn *)p; struct attr *attr = pi->attr; @@ -3241,13 +3315,13 @@ static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi, evp->prefix.route_type == BGP_EVPN_AD_ROUTE || evp->prefix.route_type == BGP_EVPN_IP_PREFIX_ROUTE) { - irt = lookup_import_rt(bgp, eval); + irt = in_vni_rt ? lookup_import_rt(bgp, eval) : NULL; if (irt) install_uninstall_route_in_vnis( bgp, afi, safi, evp, pi, irt->vnis, import); - vrf_irt = lookup_vrf_import_rt(eval); + vrf_irt = in_vrf_rt ? lookup_vrf_import_rt(eval) : NULL; if (vrf_irt) install_uninstall_route_in_vrfs( bgp, afi, safi, evp, pi, vrf_irt->vrfs, @@ -3266,8 +3340,11 @@ static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi, || type == ECOMMUNITY_ENCODE_IP) { memcpy(&eval_tmp, eval, ecom->unit_size); mask_ecom_global_admin(&eval_tmp, eval); - irt = lookup_import_rt(bgp, &eval_tmp); - vrf_irt = lookup_vrf_import_rt(&eval_tmp); + if (in_vni_rt) + irt = lookup_import_rt(bgp, &eval_tmp); + if (in_vrf_rt) + vrf_irt = + lookup_vrf_import_rt(&eval_tmp); } if (irt) @@ -3297,6 +3374,31 @@ static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi, } /* + * Install or uninstall route for appropriate VNIs/ESIs. + */ +static int install_uninstall_evpn_route(struct bgp *bgp, afi_t afi, safi_t safi, + const struct prefix *p, + struct bgp_path_info *pi, int import) +{ + return bgp_evpn_install_uninstall_table(bgp, afi, safi, p, pi, import, + true, true); +} + +/* Import the pi into vrf routing tables */ +void bgp_evpn_import_route_in_vrfs(struct bgp_path_info *pi, int import) +{ + struct bgp *bgp_evpn; + + bgp_evpn = bgp_get_evpn(); + if (!bgp_evpn) + return; + + bgp_evpn_install_uninstall_table(bgp_evpn, AFI_L2VPN, SAFI_EVPN, + &pi->net->p, pi, import, false /*vpn*/, + true /*vrf*/); +} + +/* * delete and withdraw all ipv4 and ipv6 routes in the vrf table as type-5 * routes */ diff --git a/bgpd/bgp_evpn.h b/bgpd/bgp_evpn.h index ba43191ebf..29d3d2c62f 100644 --- a/bgpd/bgp_evpn.h +++ b/bgpd/bgp_evpn.h @@ -77,17 +77,16 @@ static inline int advertise_type5_routes(struct bgp *bgp_vrf, } /* Flag if the route's parent is a EVPN route. */ -static inline int is_route_parent_evpn(struct bgp_path_info *ri) +static inline struct bgp_path_info * +get_route_parent_evpn(struct bgp_path_info *ri) { struct bgp_path_info *parent_ri; - struct bgp_table *table; - struct bgp_dest *dest; /* If not imported (or doesn't have a parent), bail. */ if (ri->sub_type != BGP_ROUTE_IMPORTED || !ri->extra || !ri->extra->parent) - return 0; + return NULL; /* Determine parent recursively */ for (parent_ri = ri->extra->parent; @@ -95,6 +94,20 @@ static inline int is_route_parent_evpn(struct bgp_path_info *ri) parent_ri = parent_ri->extra->parent) ; + return parent_ri; +} + +/* Flag if the route's parent is a EVPN route. */ +static inline int is_route_parent_evpn(struct bgp_path_info *ri) +{ + struct bgp_path_info *parent_ri; + struct bgp_table *table; + struct bgp_dest *dest; + + parent_ri = get_route_parent_evpn(ri); + if (!parent_ri) + return 0; + /* See if of family L2VPN/EVPN */ dest = parent_ri->net; if (!dest) diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index bf9a2f849a..4bc53b10e8 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -48,6 +48,8 @@ #include "bgpd/bgp_zebra.h" #include "bgpd/bgp_addpath.h" #include "bgpd/bgp_label.h" +#include "bgpd/bgp_nht.h" +#include "bgpd/bgp_mpath.h" static void bgp_evpn_local_es_down(struct bgp *bgp, struct bgp_evpn_es *es); @@ -63,6 +65,12 @@ static void bgp_evpn_es_vtep_del(struct bgp *bgp, static void bgp_evpn_es_cons_checks_pend_add(struct bgp_evpn_es *es); static void bgp_evpn_es_cons_checks_pend_del(struct bgp_evpn_es *es); static void bgp_evpn_local_es_evi_do_del(struct bgp_evpn_es_evi *es_evi); +static uint32_t bgp_evpn_es_get_active_vtep_cnt(struct bgp_evpn_es *es); +static void bgp_evpn_l3nhg_update_on_vtep_chg(struct bgp_evpn_es *es); +static struct bgp_evpn_es *bgp_evpn_es_new(struct bgp *bgp, const esi_t *esi); +static void bgp_evpn_es_free(struct bgp_evpn_es *es, const char *caller); +static void bgp_evpn_es_path_all_update(struct bgp_evpn_es_vtep *es_vtep, + bool active); esi_t zero_esi_buf, *zero_esi = &zero_esi_buf; @@ -1228,6 +1236,15 @@ static void bgp_evpn_es_vtep_re_eval_active(struct bgp *bgp, /* send remote ES to zebra */ bgp_zebra_send_remote_es_vtep(bgp, es_vtep, new_active); + /* The NHG is updated first for efficient failover handling. + * Note the NHG can be de-activated while there are bgp + * routes referencing it. Zebra is capable of handling that + * elegantly by holding the NHG till all routes using it are + * removed. + */ + bgp_evpn_l3nhg_update_on_vtep_chg(es_vtep->es); + bgp_evpn_es_path_all_update(es_vtep, new_active); + /* queue up the es for background consistency checks */ bgp_evpn_es_cons_checks_pend_add(es_vtep->es); } @@ -1303,6 +1320,164 @@ static void bgp_evpn_es_vtep_del(struct bgp *bgp, bgp_evpn_es_vtep_do_del(bgp, es_vtep, esr); } +bool bgp_evpn_es_is_vtep_active(esi_t *esi, struct in_addr nh) +{ + struct bgp_evpn_es *es; + struct bgp_evpn_es_vtep *es_vtep; + struct listnode *node = NULL; + bool rc = false; + + if (!memcmp(esi, zero_esi, sizeof(*esi)) || !nh.s_addr) + return true; + + es = bgp_evpn_es_find(esi); + if (!es) + return false; + + for (ALL_LIST_ELEMENTS_RO(es->es_vtep_list, node, es_vtep)) { + if (es_vtep->vtep_ip.s_addr == nh.s_addr) { + if (CHECK_FLAG(es_vtep->flags, BGP_EVPNES_VTEP_ACTIVE)) + rc = true; + break; + } + } + return rc; +} + +/********************** ES MAC-IP paths ************************************* + * MAC-IP routes in the VNI routing table are linked to the destination + * ES for efficient updates on ES changes (such as VTEP add/del). + ****************************************************************************/ +void bgp_evpn_path_es_info_free(struct bgp_path_es_info *es_info) +{ + bgp_evpn_path_es_unlink(es_info); + XFREE(MTYPE_BGP_EVPN_PATH_ES_INFO, es_info); +} + +static struct bgp_path_es_info * +bgp_evpn_path_es_info_new(struct bgp_path_info *pi, vni_t vni) +{ + struct bgp_path_info_extra *e; + + e = bgp_path_info_extra_get(pi); + + /* If es_info doesn't exist allocate it */ + if (!e->es_info) { + e->es_info = XCALLOC(MTYPE_BGP_EVPN_PATH_ES_INFO, + sizeof(struct bgp_path_es_info)); + e->es_info->pi = pi; + e->es_info->vni = vni; + } + + return e->es_info; +} + +void bgp_evpn_path_es_unlink(struct bgp_path_es_info *es_info) +{ + struct bgp_evpn_es *es = es_info->es; + struct bgp_path_info *pi; + + if (!es) + return; + + pi = es_info->pi; + if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) + zlog_debug("vni %u path %pFX unlinked from es %s", es_info->vni, + &pi->net->p, es->esi_str); + + list_delete_node(es->macip_path_list, &es_info->es_listnode); + es_info->es = NULL; + + /* if there are no other references against the ES it + * needs to be freed + */ + bgp_evpn_es_free(es, __func__); + + /* Note we don't free the path es_info on unlink; it will be freed up + * along with the path. + */ +} + +void bgp_evpn_path_es_link(struct bgp_path_info *pi, vni_t vni, esi_t *esi) +{ + struct bgp_path_es_info *es_info; + struct bgp_evpn_es *es; + struct bgp *bgp_evpn = bgp_get_evpn(); + + es_info = pi->extra ? pi->extra->es_info : NULL; + /* if the esi is zero just unlink the path from the old es */ + if (!esi || !memcmp(esi, zero_esi, sizeof(*esi))) { + if (es_info) + bgp_evpn_path_es_unlink(es_info); + return; + } + + if (!bgp_evpn) + return; + + /* setup es_info against the path if it doesn't aleady exist */ + if (!es_info) + es_info = bgp_evpn_path_es_info_new(pi, vni); + + /* find-create ES */ + es = bgp_evpn_es_find(esi); + if (!es) + es = bgp_evpn_es_new(bgp_evpn, esi); + + /* dup check */ + if (es_info->es == es) + return; + + /* unlink old ES if any */ + bgp_evpn_path_es_unlink(es_info); + + if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) + zlog_debug("vni %u path %pFX linked to es %s", vni, &pi->net->p, + es->esi_str); + + /* link mac-ip path to the new destination ES */ + es_info->es = es; + listnode_init(&es_info->es_listnode, es_info); + listnode_add(es->macip_path_list, &es_info->es_listnode); +} + +static void bgp_evpn_es_path_all_update(struct bgp_evpn_es_vtep *es_vtep, + bool active) +{ + struct listnode *node; + struct bgp_path_es_info *es_info; + struct bgp_path_info *pi; + struct bgp_path_info *parent_pi; + struct bgp_evpn_es *es = es_vtep->es; + char prefix_buf[PREFIX_STRLEN]; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) + zlog_debug("update all paths linked to es %s", es->esi_str); + + for (ALL_LIST_ELEMENTS_RO(es->macip_path_list, node, es_info)) { + pi = es_info->pi; + if (!CHECK_FLAG(pi->flags, BGP_PATH_VALID)) + continue; + + if (pi->sub_type != BGP_ROUTE_IMPORTED) + continue; + + parent_pi = pi->extra ? pi->extra->parent : NULL; + if (!parent_pi || !parent_pi->attr) + continue; + + if (es_vtep->vtep_ip.s_addr != parent_pi->attr->nexthop.s_addr) + continue; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) + zlog_debug("update path %s linked to es %s", + prefix2str(&parent_pi->net->p, prefix_buf, + sizeof(prefix_buf)), + es->esi_str); + bgp_evpn_import_route_in_vrfs(parent_pi, active ? 1 : 0); + } +} + /* compare ES-IDs for the global ES RB tree */ static int bgp_es_rb_cmp(const struct bgp_evpn_es *es1, const struct bgp_evpn_es *es2) @@ -1351,6 +1526,14 @@ static struct bgp_evpn_es *bgp_evpn_es_new(struct bgp *bgp, const esi_t *esi) es->es_evi_list = list_new(); listset_app_node_mem(es->es_evi_list); + /* Initialise the ES-VRF list used for L3NHG management */ + es->es_vrf_list = list_new(); + listset_app_node_mem(es->es_vrf_list); + + /* Initialise the route list used for efficient event handling */ + es->macip_path_list = list_new(); + listset_app_node_mem(es->macip_path_list); + QOBJ_REG(es, bgp_evpn_es); return es; @@ -1362,7 +1545,8 @@ static struct bgp_evpn_es *bgp_evpn_es_new(struct bgp *bgp, const esi_t *esi) */ static void bgp_evpn_es_free(struct bgp_evpn_es *es, const char *caller) { - if (es->flags & (BGP_EVPNES_LOCAL | BGP_EVPNES_REMOTE)) + if ((es->flags & (BGP_EVPNES_LOCAL | BGP_EVPNES_REMOTE)) + || listcount(es->macip_path_list)) return; if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) @@ -1370,7 +1554,9 @@ static void bgp_evpn_es_free(struct bgp_evpn_es *es, const char *caller) /* cleanup resources maintained against the ES */ list_delete(&es->es_evi_list); + list_delete(&es->es_vrf_list); list_delete(&es->es_vtep_list); + list_delete(&es->macip_path_list); bgp_table_unlock(es->route_table); /* remove the entry from various databases */ @@ -1809,6 +1995,10 @@ static void bgp_evpn_es_show_entry_detail(struct vty *vty, ip_buf, sizeof(ip_buf))); json_object_int_add(json, "remoteVniCount", es->remote_es_evi_cnt); + json_object_int_add(json, "vrfCount", + listcount(es->es_vrf_list)); + json_object_int_add(json, "macipPathCount", + listcount(es->macip_path_list)); json_object_int_add(json, "inconsistentVniVtepCount", es->incons_evi_vtep_cnt); if (listcount(es->es_vtep_list)) { @@ -1853,6 +2043,9 @@ static void bgp_evpn_es_show_entry_detail(struct vty *vty, vty_out(vty, " VNI Count: %d\n", listcount(es->es_evi_list)); vty_out(vty, " Remote VNI Count: %d\n", es->remote_es_evi_cnt); + vty_out(vty, " VRF Count: %d\n", listcount(es->es_vrf_list)); + vty_out(vty, " MACIP Path Count: %d\n", + listcount(es->macip_path_list)); vty_out(vty, " Inconsistent VNI VTEP Count: %d\n", es->incons_evi_vtep_cnt); if (es->inconsistencies) { @@ -1941,6 +2134,517 @@ void bgp_evpn_es_show_esi(struct vty *vty, esi_t *esi, bool uj) } /*****************************************************************************/ +/* Ethernet Segment to VRF association - + * 1. Each ES-EVI entry is associated with a tenant VRF. This associaton + * triggers the creation of an ES-VRF entry. + * 2. The ES-VRF entry is maintained for the purpose of L3-NHG creation + * 3. Type-2/MAC-IP routes are imported into a tenant VRF and programmed as + * a /32 or host route entry in the dataplane. If the destination of + * the host route is a remote-ES the route is programmed with the + * corresponding (keyed in by {vrf,ES-id}) L3-NHG. + * 4. The reason for this indirection (route->L3-NHG, L3-NHG->list-of-VTEPs) + * is to avoid route updates to the dplane when a remote-ES link flaps i.e. + * instead of updating all the dependent routes the NHG's contents are updated. + * This reduces the amount of datplane updates (nhg updates vs. route updates) + * allowing for a faster failover. + * + * XXX - can the L3 SVI index change without change in vpn->bgp_vrf + * association? If yes we need to handle that by updating all the L3 NHGs + * in that VRF. + */ +/******************************** L3 NHG management *************************/ +static void bgp_evpn_l3nhg_zebra_add_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf, + bool v4_nhg) +{ + uint32_t nhg_id = v4_nhg ? es_vrf->nhg_id : es_vrf->v6_nhg_id; + struct bgp_evpn_es *es = es_vrf->es; + struct listnode *node; + struct bgp_evpn_es_vtep *es_vtep; + struct nexthop nh; + struct zapi_nexthop *api_nh; + struct zapi_nhg api_nhg = {}; + + /* Skip installation of L3-NHG if host routes used */ + if (!nhg_id) + return; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s vrf %u %s nhg %u to zebra", es->esi_str, + es_vrf->bgp_vrf->vrf_id, + v4_nhg ? "v4_nhg" : "v6_nhg", nhg_id); + + /* only the gateway ip changes for each NH. rest of the params + * are constant + */ + memset(&nh, 0, sizeof(nh)); + nh.vrf_id = es_vrf->bgp_vrf->vrf_id; + nh.flags = NEXTHOP_FLAG_ONLINK; + nh.ifindex = es_vrf->bgp_vrf->l3vni_svi_ifindex; + nh.weight = 1; + nh.type = + v4_nhg ? NEXTHOP_TYPE_IPV4_IFINDEX : NEXTHOP_TYPE_IPV6_IFINDEX; + + api_nhg.id = nhg_id; + for (ALL_LIST_ELEMENTS_RO(es->es_vtep_list, node, es_vtep)) { + if (!CHECK_FLAG(es_vtep->flags, BGP_EVPNES_VTEP_ACTIVE)) + continue; + + /* overwrite the gw */ + if (v4_nhg) + nh.gate.ipv4 = es_vtep->vtep_ip; + else + ipv4_to_ipv4_mapped_ipv6(&nh.gate.ipv6, + es_vtep->vtep_ip); + + /* convert to zapi format */ + api_nh = &api_nhg.nexthops[api_nhg.nexthop_num]; + zapi_nexthop_from_nexthop(api_nh, &nh); + + ++api_nhg.nexthop_num; + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("nhg %u vtep %pI4 l3-svi %d", api_nhg.id, + &es_vtep->vtep_ip, + es_vrf->bgp_vrf->l3vni_svi_ifindex); + } + + if (!api_nhg.nexthop_num) + return; + + if (api_nhg.nexthop_num > MULTIPATH_NUM) + return; + + zclient_nhg_send(zclient, ZEBRA_NHG_ADD, &api_nhg); +} + +static bool bgp_evpn_l3nhg_zebra_ok(struct bgp_evpn_es_vrf *es_vrf) +{ + if (!bgp_mh_info->host_routes_use_l3nhg && !bgp_mh_info->install_l3nhg) + return false; + + /* Check socket. */ + if (!zclient || zclient->sock < 0) + return false; + + return true; +} + +static void bgp_evpn_l3nhg_zebra_add(struct bgp_evpn_es_vrf *es_vrf) +{ + if (!bgp_evpn_l3nhg_zebra_ok(es_vrf)) + return; + + bgp_evpn_l3nhg_zebra_add_v4_or_v6(es_vrf, true /*v4_nhg*/); + bgp_evpn_l3nhg_zebra_add_v4_or_v6(es_vrf, false /*v4_nhg*/); +} + +static void bgp_evpn_l3nhg_zebra_del_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf, + bool v4_nhg) +{ + struct zapi_nhg api_nhg = {}; + + api_nhg.id = v4_nhg ? es_vrf->nhg_id : es_vrf->v6_nhg_id; + + /* Skip installation of L3-NHG if host routes used */ + if (!api_nhg.id) + return; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s vrf %u %s nhg %u to zebra", + es_vrf->es->esi_str, es_vrf->bgp_vrf->vrf_id, + v4_nhg ? "v4_nhg" : "v6_nhg", api_nhg.id); + + zclient_nhg_send(zclient, ZEBRA_NHG_DEL, &api_nhg); +} + +static void bgp_evpn_l3nhg_zebra_del(struct bgp_evpn_es_vrf *es_vrf) +{ + if (!bgp_evpn_l3nhg_zebra_ok(es_vrf)) + return; + + bgp_evpn_l3nhg_zebra_del_v4_or_v6(es_vrf, true /*v4_nhg*/); + bgp_evpn_l3nhg_zebra_del_v4_or_v6(es_vrf, false /*v4_nhg*/); +} + +static void bgp_evpn_l3nhg_deactivate(struct bgp_evpn_es_vrf *es_vrf) +{ + if (!(es_vrf->flags & BGP_EVPNES_VRF_NHG_ACTIVE)) + return; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s vrf %u nhg %u de-activate", + es_vrf->es->esi_str, es_vrf->bgp_vrf->vrf_id, + es_vrf->nhg_id); + bgp_evpn_l3nhg_zebra_del(es_vrf); + es_vrf->flags &= ~BGP_EVPNES_VRF_NHG_ACTIVE; +} + +static void bgp_evpn_l3nhg_activate(struct bgp_evpn_es_vrf *es_vrf, bool update) +{ + if (!bgp_evpn_es_get_active_vtep_cnt(es_vrf->es)) { + bgp_evpn_l3nhg_deactivate(es_vrf); + return; + } + + if (es_vrf->flags & BGP_EVPNES_VRF_NHG_ACTIVE) { + if (!update) + return; + } else { + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s vrf %u nhg %u activate", + es_vrf->es->esi_str, es_vrf->bgp_vrf->vrf_id, + es_vrf->nhg_id); + es_vrf->flags |= BGP_EVPNES_VRF_NHG_ACTIVE; + } + + bgp_evpn_l3nhg_zebra_add(es_vrf); +} + +/* when a VTEP is activated or de-activated against an ES associated + * VRFs' NHG needs to be updated + */ +static void bgp_evpn_l3nhg_update_on_vtep_chg(struct bgp_evpn_es *es) +{ + struct bgp_evpn_es_vrf *es_vrf; + struct listnode *es_vrf_node; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s nhg update on vtep chg", es->esi_str); + + for (ALL_LIST_ELEMENTS_RO(es->es_vrf_list, es_vrf_node, es_vrf)) + bgp_evpn_l3nhg_activate(es_vrf, true /* update */); +} + +/* compare ES-IDs for the ES-VRF RB tree maintained per-VRF */ +static int bgp_es_vrf_rb_cmp(const struct bgp_evpn_es_vrf *es_vrf1, + const struct bgp_evpn_es_vrf *es_vrf2) +{ + return memcmp(&es_vrf1->es->esi, &es_vrf2->es->esi, ESI_BYTES); +} +RB_GENERATE(bgp_es_vrf_rb_head, bgp_evpn_es_vrf, rb_node, bgp_es_vrf_rb_cmp); + +/* Initialize the ES tables maintained per-tenant vrf */ +void bgp_evpn_vrf_es_init(struct bgp *bgp_vrf) +{ + /* Initialize the ES-VRF RB tree */ + RB_INIT(bgp_es_vrf_rb_head, &bgp_vrf->es_vrf_rb_tree); +} + +/* find the ES-VRF in the per-VRF RB tree */ +static struct bgp_evpn_es_vrf *bgp_evpn_es_vrf_find(struct bgp_evpn_es *es, + struct bgp *bgp_vrf) +{ + struct bgp_evpn_es_vrf es_vrf; + + es_vrf.es = es; + + return RB_FIND(bgp_es_vrf_rb_head, &bgp_vrf->es_vrf_rb_tree, &es_vrf); +} + +/* allocate a new ES-VRF and setup L3NHG for it */ +static struct bgp_evpn_es_vrf *bgp_evpn_es_vrf_create(struct bgp_evpn_es *es, + struct bgp *bgp_vrf) +{ + struct bgp_evpn_es_vrf *es_vrf; + + es_vrf = XCALLOC(MTYPE_BGP_EVPN_ES_VRF, sizeof(*es_vrf)); + + es_vrf->es = es; + es_vrf->bgp_vrf = bgp_vrf; + + /* insert into the VRF-ESI rb tree */ + if (RB_INSERT(bgp_es_vrf_rb_head, &bgp_vrf->es_vrf_rb_tree, es_vrf)) { + XFREE(MTYPE_BGP_EVPN_ES_VRF, es_vrf); + return NULL; + } + + /* add to the ES's VRF list */ + listnode_init(&es_vrf->es_listnode, es_vrf); + listnode_add(es->es_vrf_list, &es_vrf->es_listnode); + + /* setup the L3 NHG id for the ES */ + es_vrf->nhg_id = bgp_l3nhg_id_alloc(); + es_vrf->v6_nhg_id = bgp_l3nhg_id_alloc(); + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s vrf %u nhg %u v6_nhg %d create", es->esi_str, + bgp_vrf->vrf_id, es_vrf->nhg_id, es_vrf->v6_nhg_id); + bgp_evpn_l3nhg_activate(es_vrf, false /* update */); + + return es_vrf; +} + +/* remove the L3-NHG associated with the ES-VRF and free it */ +static void bgp_evpn_es_vrf_delete(struct bgp_evpn_es_vrf *es_vrf) +{ + struct bgp_evpn_es *es = es_vrf->es; + struct bgp *bgp_vrf = es_vrf->bgp_vrf; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es %s vrf %u nhg %u delete", es->esi_str, + bgp_vrf->vrf_id, es_vrf->nhg_id); + + /* Remove the NHG resources */ + bgp_evpn_l3nhg_deactivate(es_vrf); + if (es_vrf->nhg_id) + bgp_l3nhg_id_free(es_vrf->nhg_id); + es_vrf->nhg_id = 0; + if (es_vrf->v6_nhg_id) + bgp_l3nhg_id_free(es_vrf->v6_nhg_id); + es_vrf->v6_nhg_id = 0; + + /* remove from the ES's VRF list */ + list_delete_node(es->es_vrf_list, &es_vrf->es_listnode); + + /* remove from the VRF-ESI rb tree */ + RB_REMOVE(bgp_es_vrf_rb_head, &bgp_vrf->es_vrf_rb_tree, es_vrf); + + XFREE(MTYPE_BGP_EVPN_ES_VRF, es_vrf); +} + +/* deref and delete if there are no references */ +void bgp_evpn_es_vrf_deref(struct bgp_evpn_es_evi *es_evi) +{ + struct bgp_evpn_es_vrf *es_vrf = es_evi->es_vrf; + + if (!es_vrf) + return; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es-evi %s vni %u vrf %u de-ref", + es_evi->es->esi_str, es_evi->vpn->vni, + es_vrf->bgp_vrf->vrf_id); + + es_evi->es_vrf = NULL; + if (es_vrf->ref_cnt) + --es_vrf->ref_cnt; + + if (!es_vrf->ref_cnt) + bgp_evpn_es_vrf_delete(es_vrf); +} + +/* find or create and reference */ +void bgp_evpn_es_vrf_ref(struct bgp_evpn_es_evi *es_evi, struct bgp *bgp_vrf) +{ + struct bgp_evpn_es *es = es_evi->es; + struct bgp_evpn_es_vrf *es_vrf = es_evi->es_vrf; + struct bgp *old_bgp_vrf = NULL; + + if (es_vrf) + old_bgp_vrf = es_vrf->bgp_vrf; + + if (old_bgp_vrf == bgp_vrf) + return; + + /* deref the old ES-VRF */ + bgp_evpn_es_vrf_deref(es_evi); + + if (!bgp_vrf) + return; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es-evi %s vni %u vrf %u ref", es_evi->es->esi_str, + es_evi->vpn->vni, bgp_vrf->vrf_id); + + /* find-create the new ES-VRF */ + es_vrf = bgp_evpn_es_vrf_find(es, bgp_vrf); + if (!es_vrf) + es_vrf = bgp_evpn_es_vrf_create(es, bgp_vrf); + if (!es_vrf) + return; + + es_evi->es_vrf = es_vrf; + ++es_vrf->ref_cnt; +} + +/* When the L2-VNI is associated with a L3-VNI/VRF update all the + * associated ES-EVI entries + */ +void bgp_evpn_es_evi_vrf_deref(struct bgpevpn *vpn) +{ + struct bgp_evpn_es_evi *es_evi; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es-vrf de-ref for vni %u", vpn->vni); + + RB_FOREACH (es_evi, bgp_es_evi_rb_head, &vpn->es_evi_rb_tree) + bgp_evpn_es_vrf_deref(es_evi); +} +void bgp_evpn_es_evi_vrf_ref(struct bgpevpn *vpn) +{ + struct bgp_evpn_es_evi *es_evi; + + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("es-vrf ref for vni %u", vpn->vni); + + RB_FOREACH (es_evi, bgp_es_evi_rb_head, &vpn->es_evi_rb_tree) + bgp_evpn_es_vrf_ref(es_evi, vpn->bgp_vrf); +} + +/* returns false if legacy-exploded mp needs to be used for route install */ +bool bgp_evpn_path_es_use_nhg(struct bgp *bgp_vrf, struct bgp_path_info *pi, + uint32_t *nhg_p) +{ + esi_t *esi; + struct bgp_evpn_es *es; + struct bgp_evpn_es_vrf *es_vrf; + struct bgp_path_info *parent_pi; + struct bgp_node *rn; + struct prefix_evpn *evp; + struct bgp_path_info *mpinfo; + + *nhg_p = 0; + + /* L3NHG support is disabled, use legacy-exploded multipath */ + if (!bgp_mh_info->host_routes_use_l3nhg) + return false; + + parent_pi = get_route_parent_evpn(pi); + if (!parent_pi) + return false; + + rn = parent_pi->net; + if (!rn) + return false; + + evp = (struct prefix_evpn *)&rn->p; + if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE) + return false; + + /* non-es path, use legacy-exploded multipath */ + esi = bgp_evpn_attr_get_esi(parent_pi->attr); + if (!memcmp(esi, zero_esi, sizeof(*esi))) + return false; + + /* if the ES-VRF is not setup or if the NHG has not been installed + * we cannot install the route yet, return a 0-NHG to indicate + * that + */ + es = bgp_evpn_es_find(esi); + if (!es) + return true; + es_vrf = bgp_evpn_es_vrf_find(es, bgp_vrf); + if (!es_vrf || !(es_vrf->flags & BGP_EVPNES_VRF_NHG_ACTIVE)) + return true; + + /* this needs to be set the v6NHG if v6route */ + if (is_evpn_prefix_ipaddr_v6(evp)) + *nhg_p = es_vrf->v6_nhg_id; + else + *nhg_p = es_vrf->nhg_id; + + for (mpinfo = bgp_path_info_mpath_next(pi); mpinfo; + mpinfo = bgp_path_info_mpath_next(mpinfo)) { + /* if any of the paths of have a different ESI we can't use + * the NHG associated with the ES. fallback to legacy-exploded + * multipath + */ + if (memcmp(esi, bgp_evpn_attr_get_esi(mpinfo->attr), + sizeof(*esi))) + return false; + } + + return true; +} + +static void bgp_evpn_es_vrf_show_entry(struct vty *vty, + struct bgp_evpn_es_vrf *es_vrf, + json_object *json) +{ + struct bgp_evpn_es *es = es_vrf->es; + struct bgp *bgp_vrf = es_vrf->bgp_vrf; + + if (json) { + json_object *json_types; + + json_object_string_add(json, "esi", es->esi_str); + json_object_string_add(json, "vrf", bgp_vrf->name); + + if (es_vrf->flags & (BGP_EVPNES_VRF_NHG_ACTIVE)) { + json_types = json_object_new_array(); + if (es_vrf->flags & BGP_EVPNES_VRF_NHG_ACTIVE) + json_array_string_add(json_types, "active"); + json_object_object_add(json, "flags", json_types); + } + + json_object_int_add(json, "ipv4NHG", es_vrf->nhg_id); + json_object_int_add(json, "ipv6NHG", es_vrf->v6_nhg_id); + json_object_int_add(json, "refCount", es_vrf->ref_cnt); + } else { + char flags_str[4]; + + flags_str[0] = '\0'; + if (es_vrf->flags & BGP_EVPNES_VRF_NHG_ACTIVE) + strlcat(flags_str, "A", sizeof(flags_str)); + + vty_out(vty, "%-30s %-15s %-5s %-8u %-8u %u\n", es->esi_str, + bgp_vrf->name, flags_str, es_vrf->nhg_id, + es_vrf->v6_nhg_id, es_vrf->ref_cnt); + } +} + +static void bgp_evpn_es_vrf_show_es(struct vty *vty, json_object *json_array, + struct bgp_evpn_es *es) +{ + json_object *json = NULL; + struct listnode *es_vrf_node; + struct bgp_evpn_es_vrf *es_vrf; + + for (ALL_LIST_ELEMENTS_RO(es->es_vrf_list, es_vrf_node, es_vrf)) { + /* create a separate json object for each ES-VRF */ + if (json_array) + json = json_object_new_object(); + bgp_evpn_es_vrf_show_entry(vty, es_vrf, json); + /* add ES-VRF to the json array */ + if (json_array) + json_object_array_add(json_array, json); + } +} + +/* Display all ES VRFs */ +void bgp_evpn_es_vrf_show(struct vty *vty, bool uj, struct bgp_evpn_es *es) +{ + json_object *json_array = NULL; + + if (uj) { + /* create an array of ESs */ + json_array = json_object_new_array(); + } else { + vty_out(vty, "ES-VRF Flags: A Active\n"); + vty_out(vty, "%-30s %-15s %-5s %-8s %-8s %s\n", "ESI", "VRF", + "Flags", "IPv4-NHG", "IPv6-NHG", "Ref"); + } + + if (es) { + bgp_evpn_es_vrf_show_es(vty, json_array, es); + } else { + RB_FOREACH (es, bgp_es_rb_head, &bgp_mh_info->es_rb_tree) + bgp_evpn_es_vrf_show_es(vty, json_array, es); + } + + /* print the array of json-ESs */ + if (uj) { + vty_out(vty, "%s\n", + json_object_to_json_string_ext( + json_array, JSON_C_TO_STRING_PRETTY)); + json_object_free(json_array); + } +} + +/* Display specific ES VRF */ +void bgp_evpn_es_vrf_show_esi(struct vty *vty, esi_t *esi, bool uj) +{ + struct bgp_evpn_es *es; + + es = bgp_evpn_es_find(esi); + if (es) { + bgp_evpn_es_vrf_show(vty, uj, es); + } else { + if (!uj) + vty_out(vty, "ESI not found\n"); + } +} + +/*****************************************************************************/ /* Ethernet Segment to EVI association - * 1. The ES-EVI entry is maintained as a RB tree per L2-VNI * (bgpevpn->es_evi_rb_tree). @@ -2152,6 +2856,8 @@ static struct bgp_evpn_es_evi *bgp_evpn_es_evi_new(struct bgp_evpn_es *es, listnode_init(&es_evi->es_listnode, es_evi); listnode_add(es->es_evi_list, &es_evi->es_listnode); + bgp_evpn_es_vrf_ref(es_evi, vpn->bgp_vrf); + return es_evi; } @@ -2169,6 +2875,8 @@ static void bgp_evpn_es_evi_free(struct bgp_evpn_es_evi *es_evi) if (es_evi->flags & (BGP_EVPNES_EVI_LOCAL | BGP_EVPNES_EVI_REMOTE)) return; + bgp_evpn_es_vrf_deref(es_evi); + /* remove from the ES's VNI list */ list_delete_node(es->es_evi_list, &es_evi->es_listnode); @@ -2995,6 +3703,8 @@ void bgp_evpn_mh_init(void) /* config knobs - XXX add cli to control it */ bgp_mh_info->ead_evi_adv_for_down_links = true; bgp_mh_info->consistency_checking = true; + bgp_mh_info->install_l3nhg = false; + bgp_mh_info->host_routes_use_l3nhg = BGP_EVPN_MH_USE_ES_L3NHG_DEF; if (bgp_mh_info->consistency_checking) thread_add_timer(bm->master, bgp_evpn_run_consistency_checks, diff --git a/bgpd/bgp_evpn_mh.h b/bgpd/bgp_evpn_mh.h index d719524bdd..d2f6a7b054 100644 --- a/bgpd/bgp_evpn_mh.h +++ b/bgpd/bgp_evpn_mh.h @@ -34,6 +34,7 @@ #define BGP_EVPN_CONS_CHECK_INTERVAL 60 +#define BGP_EVPN_MH_USE_ES_L3NHG_DEF true /* Ethernet Segment entry - * - Local and remote ESs are maintained in a global RB tree, @@ -96,6 +97,14 @@ struct bgp_evpn_es { /* List of ES-EVIs associated with this ES */ struct list *es_evi_list; + /* List of ES-VRFs associated with this ES */ + struct list *es_vrf_list; + + /* List of MAC-IP global routes using this ES as destination - + * element is bgp_path_info_extra->es_info + */ + struct list *macip_path_list; + /* Number of remote VNIs referencing this ES */ uint32_t remote_es_evi_cnt; @@ -142,6 +151,34 @@ struct bgp_evpn_es_vtep { struct listnode es_listnode; }; +/* ES-VRF element needed for managing L3 NHGs. It is implicitly created + * when an ES-EVI is associated with a tenant VRF + */ +struct bgp_evpn_es_vrf { + struct bgp_evpn_es *es; + struct bgp *bgp_vrf; + + uint32_t flags; +/* NHG can only be activated if there are active VTEPs in the ES and + * there is a valid L3-VNI associated with the VRF + */ +#define BGP_EVPNES_VRF_NHG_ACTIVE (1 << 0) + + /* memory used for adding the es_vrf to + * es_vrf->bgp_vrf->es_vrf_rb_tree + */ + RB_ENTRY(bgp_evpn_es_vrf) rb_node; + + /* memory used for linking the es_vrf to es_vrf->es->es_vrf_list */ + struct listnode es_listnode; + + uint32_t nhg_id; + uint32_t v6_nhg_id; + + /* Number of ES-EVI entries associated with this ES-VRF */ + uint32_t ref_cnt; +}; + /* ES per-EVI info * - ES-EVIs are maintained per-L2-VNI (vpn->es_evi_rb_tree) * - ES-EVIs are also linked to the parent ES (es->es_evi_list) @@ -175,6 +212,8 @@ struct bgp_evpn_es_evi { /* list of PEs (bgp_evpn_es_evi_vtep) attached to the ES for this VNI */ struct list *es_evi_vtep_list; + + struct bgp_evpn_es_vrf *es_vrf; }; /* PE attached to an ES for a VNI. This entry is created when an EAD-per-ES @@ -219,6 +258,9 @@ struct bgp_evpn_mh_info { bool ead_evi_adv_for_down_links; /* Enable ES consistency checking */ bool consistency_checking; + /* Use L3 NHGs for host routes in symmetric IRB */ + bool install_l3nhg; + bool host_routes_use_l3nhg; }; /****************************************************************************/ @@ -308,5 +350,19 @@ void bgp_evpn_es_evi_show_vni(struct vty *vty, vni_t vni, void bgp_evpn_es_evi_show(struct vty *vty, bool uj, bool detail); struct bgp_evpn_es *bgp_evpn_es_find(const esi_t *esi); extern bool bgp_evpn_is_esi_local(esi_t *esi); +extern void bgp_evpn_vrf_es_init(struct bgp *bgp_vrf); +extern void bgp_evpn_es_vrf_deref(struct bgp_evpn_es_evi *es_evi); +extern void bgp_evpn_es_vrf_ref(struct bgp_evpn_es_evi *es_evi, + struct bgp *bgp_vrf); +extern void bgp_evpn_path_es_info_free(struct bgp_path_es_info *es_info); +extern void bgp_evpn_path_es_unlink(struct bgp_path_es_info *es_info); +extern void bgp_evpn_path_es_link(struct bgp_path_info *pi, vni_t vni, + esi_t *esi); +extern bool bgp_evpn_es_is_vtep_active(esi_t *esi, struct in_addr nh); +extern bool bgp_evpn_path_es_use_nhg(struct bgp *bgp_vrf, + struct bgp_path_info *pi, uint32_t *nhg_p); +extern void bgp_evpn_es_vrf_show(struct vty *vty, bool uj, + struct bgp_evpn_es *es); +extern void bgp_evpn_es_vrf_show_esi(struct vty *vty, esi_t *esi, bool uj); #endif /* _FRR_BGP_EVPN_MH_H */ diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h index c47576c00c..cd4920e3d0 100644 --- a/bgpd/bgp_evpn_private.h +++ b/bgpd/bgp_evpn_private.h @@ -218,6 +218,9 @@ static inline struct list *bgpevpn_get_vrf_import_rtl(struct bgpevpn *vpn) return vpn->bgp_vrf->vrf_import_rtl; } +extern void bgp_evpn_es_evi_vrf_ref(struct bgpevpn *vpn); +extern void bgp_evpn_es_evi_vrf_deref(struct bgpevpn *vpn); + static inline void bgpevpn_unlink_from_l3vni(struct bgpevpn *vpn) { /* bail if vpn is not associated to bgp_vrf */ @@ -227,6 +230,8 @@ static inline void bgpevpn_unlink_from_l3vni(struct bgpevpn *vpn) UNSET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS); listnode_delete(vpn->bgp_vrf->l2vnis, vpn); + bgp_evpn_es_evi_vrf_deref(vpn); + /* remove the backpointer to the vrf instance */ bgp_unlock(vpn->bgp_vrf); vpn->bgp_vrf = NULL; @@ -255,6 +260,8 @@ static inline void bgpevpn_link_to_l3vni(struct bgpevpn *vpn) if (bgp_vrf->l3vni && !CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_L3VNI_PREFIX_ROUTES_ONLY)) SET_FLAG(vpn->flags, VNI_FLAG_USE_TWO_LABELS); + + bgp_evpn_es_evi_vrf_ref(vpn); } static inline int is_vni_configured(struct bgpevpn *vpn) @@ -623,4 +630,13 @@ extern struct bgp_dest * bgp_global_evpn_node_lookup(struct bgp_table *table, afi_t afi, safi_t safi, const struct prefix_evpn *evp, struct prefix_rd *prd); +extern struct bgp_node *bgp_global_evpn_node_get(struct bgp_table *table, + afi_t afi, safi_t safi, + const struct prefix_evpn *evp, + struct prefix_rd *prd); +extern struct bgp_node * +bgp_global_evpn_node_lookup(struct bgp_table *table, afi_t afi, safi_t safi, + const struct prefix_evpn *evp, + struct prefix_rd *prd); +extern void bgp_evpn_import_route_in_vrfs(struct bgp_path_info *pi, int import); #endif /* _BGP_EVPN_PRIVATE_H */ diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index e9e2aafebb..f957103df7 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -686,6 +686,78 @@ static void show_esi_routes(struct bgp *bgp, } } +/* Display all MAC-IP VNI routes linked to an ES */ +static void bgp_evpn_show_routes_mac_ip_es(struct vty *vty, esi_t *esi, + json_object *json, int detail) +{ + struct bgp_node *rn; + struct bgp_path_info *pi; + int header = detail ? 0 : 1; + uint32_t path_cnt; + struct listnode *node; + struct bgp_evpn_es *es; + struct bgp_path_es_info *es_info; + struct bgp *bgp = bgp_get_evpn(); + json_object *json_paths = NULL; + + if (!bgp) + return; + + path_cnt = 0; + + if (json) + json_paths = json_object_new_array(); + + RB_FOREACH (es, bgp_es_rb_head, &bgp_mh_info->es_rb_tree) { + + if (esi && memcmp(esi, &es->esi, sizeof(*esi))) + continue; + + for (ALL_LIST_ELEMENTS_RO(es->macip_path_list, node, es_info)) { + json_object *json_path = NULL; + + pi = es_info->pi; + rn = pi->net; + + if (!CHECK_FLAG(pi->flags, BGP_PATH_VALID)) + continue; + + /* Overall header/legend displayed once. */ + if (header) { + bgp_evpn_show_route_header(vty, bgp, 0, json); + header = 0; + } + + path_cnt++; + + if (json) + json_path = json_object_new_array(); + + if (detail) + route_vty_out_detail(vty, bgp, rn, pi, + AFI_L2VPN, SAFI_EVPN, + json_path); + else + route_vty_out(vty, &rn->p, pi, 0, SAFI_EVPN, + json_path, false); + + if (json) + json_object_array_add(json_paths, json_path); + } + } + + if (json) { + json_object_object_add(json, "paths", json_paths); + json_object_int_add(json, "numPaths", path_cnt); + } else { + if (path_cnt == 0) + vty_out(vty, "There are no MAC-IP ES paths"); + else + vty_out(vty, "\nDisplayed %u paths\n", path_cnt); + vty_out(vty, "\n"); + } +} + static void show_vni_routes(struct bgp *bgp, struct bgpevpn *vpn, int type, struct vty *vty, struct in_addr vtep_ip, json_object *json, int detail) @@ -3675,6 +3747,16 @@ DEFUN (no_bgp_evpn_advertise_type5, return CMD_SUCCESS; } +DEFPY (bgp_evpn_use_es_l3nhg, + bgp_evpn_use_es_l3nhg_cmd, + "[no$no] use-es-l3nhg", + NO_STR + "use L3 nexthop group for host routes with ES destination\n") +{ + bgp_mh_info->host_routes_use_l3nhg = no ? false :true; + return CMD_SUCCESS; +} + DEFPY (bgp_evpn_advertise_pip_ip_mac, bgp_evpn_advertise_pip_ip_mac_cmd, "[no$no] advertise-pip [ip <A.B.C.D> [mac <X:X:X:X:X:X|X:X:X:X:X:X/M>]]", @@ -3967,6 +4049,28 @@ DEFPY(show_bgp_l2vpn_evpn_es, return CMD_SUCCESS; } +DEFPY(show_bgp_l2vpn_evpn_es_vrf, show_bgp_l2vpn_evpn_es_vrf_cmd, + "show bgp l2vpn evpn es-vrf [NAME$esi_str] [json$uj]", + SHOW_STR BGP_STR L2VPN_HELP_STR EVPN_HELP_STR + "Ethernet Segment\n" + "ES ID\n" JSON_STR) +{ + esi_t esi; + + if (esi_str) { + if (!str_to_esi(esi_str, &esi)) { + vty_out(vty, "%%Malformed ESI\n"); + return CMD_WARNING; + } + bgp_evpn_es_vrf_show_esi(vty, &esi, uj); + } else { + + bgp_evpn_es_vrf_show(vty, uj, NULL); + } + + return CMD_SUCCESS; +} + /* * Display EVPN neighbor summary. */ @@ -4517,6 +4621,43 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_all, return CMD_SUCCESS; } +DEFPY_HIDDEN( + show_bgp_l2vpn_evpn_route_mac_ip_es, + show_bgp_l2vpn_evpn_route_mac_ip_es_cmd, + "show bgp l2vpn evpn route mac-ip-es [NAME$esi_str|detail$detail] [json$uj]", + SHOW_STR BGP_STR L2VPN_HELP_STR EVPN_HELP_STR + "EVPN route information\n" + "MAC IP routes linked to the ES\n" + "ES ID\n" + "Detailed information\n" JSON_STR) +{ + esi_t esi; + esi_t *esi_p; + json_object *json = NULL; + + if (esi_str) { + if (!str_to_esi(esi_str, &esi)) { + vty_out(vty, "%%Malformed ESI\n"); + return CMD_WARNING; + } + esi_p = &esi; + } else { + esi_p = NULL; + } + + if (uj) + json = json_object_new_object(); + bgp_evpn_show_routes_mac_ip_es(vty, esi_p, json, !!detail); + if (uj) { + vty_out(vty, "%s\n", + json_object_to_json_string_ext( + json, JSON_C_TO_STRING_PRETTY)); + json_object_free(json); + } + + return CMD_SUCCESS; +} + /* * Display EVPN import route-target hash table */ @@ -5602,6 +5743,14 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi, if (bgp->evpn_info->advertise_svi_macip) vty_out(vty, " advertise-svi-ip\n"); + if (bgp_mh_info->host_routes_use_l3nhg != + BGP_EVPN_MH_USE_ES_L3NHG_DEF) { + if (bgp_mh_info->host_routes_use_l3nhg) + vty_out(vty, " use-es-l3nhg\n"); + else + vty_out(vty, " no use-es-l3nhg\n"); + } + if (!bgp->evpn_info->dup_addr_detect) vty_out(vty, " no dup-addr-detection\n"); @@ -5746,6 +5895,7 @@ void bgp_ethernetvpn_init(void) install_element(BGP_EVPN_NODE, &no_dup_addr_detection_cmd); install_element(BGP_EVPN_NODE, &bgp_evpn_flood_control_cmd); install_element(BGP_EVPN_NODE, &bgp_evpn_advertise_pip_ip_mac_cmd); + install_element(BGP_EVPN_NODE, &bgp_evpn_use_es_l3nhg_cmd); /* test commands */ install_element(BGP_EVPN_NODE, &test_es_add_cmd); @@ -5754,6 +5904,7 @@ void bgp_ethernetvpn_init(void) /* "show bgp l2vpn evpn" commands. */ install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_es_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_es_evi_cmd); + install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_es_vrf_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_vni_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_summary_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_route_cmd); @@ -5765,6 +5916,7 @@ void bgp_ethernetvpn_init(void) &show_bgp_l2vpn_evpn_route_vni_multicast_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_route_vni_macip_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_route_vni_all_cmd); + install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_route_mac_ip_es_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_import_rt_cmd); install_element(VIEW_NODE, &show_bgp_l2vpn_evpn_vrf_import_rt_cmd); diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 21c880e95b..f961647778 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -63,6 +63,7 @@ #include "lib/routing_nb.h" #include "bgpd/bgp_nb.h" #include "bgpd/bgp_evpn_mh.h" +#include "bgpd/bgp_nht.h" #ifdef ENABLE_BGP_VNC #include "bgpd/rfapi/rfapi_backend.h" @@ -209,6 +210,7 @@ static __attribute__((__noreturn__)) void bgp_exit(int status) bgp_delete(bgp_default); bgp_evpn_mh_finish(); + bgp_l3nhg_finish(); /* reverse bgp_dump_init */ bgp_dump_finish(); diff --git a/bgpd/bgp_memory.c b/bgpd/bgp_memory.c index d8fc98e048..f9aac35d05 100644 --- a/bgpd/bgp_memory.c +++ b/bgpd/bgp_memory.c @@ -118,9 +118,11 @@ DEFINE_MTYPE(BGPD, LCOMMUNITY_VAL, "Large Community value") DEFINE_MTYPE(BGPD, BGP_EVPN, "BGP EVPN Information") DEFINE_MTYPE(BGPD, BGP_EVPN_MH_INFO, "BGP EVPN MH Information") DEFINE_MTYPE(BGPD, BGP_EVPN_ES_VTEP, "BGP EVPN ES VTEP") +DEFINE_MTYPE(BGPD, BGP_EVPN_PATH_ES_INFO, "BGP EVPN PATH ES Information") DEFINE_MTYPE(BGPD, BGP_EVPN_ES_EVI_VTEP, "BGP EVPN ES-EVI VTEP") DEFINE_MTYPE(BGPD, BGP_EVPN_ES, "BGP EVPN ESI Information") DEFINE_MTYPE(BGPD, BGP_EVPN_ES_EVI, "BGP EVPN ES-per-EVI Information") +DEFINE_MTYPE(BGPD, BGP_EVPN_ES_VRF, "BGP EVPN ES-per-VRF Information") DEFINE_MTYPE(BGPD, BGP_EVPN_IMPORT_RT, "BGP EVPN Import RT") DEFINE_MTYPE(BGPD, BGP_EVPN_VRF_IMPORT_RT, "BGP EVPN VRF Import RT") DEFINE_MTYPE(BGPD, BGP_EVPN_MACIP, "BGP EVPN MAC IP") diff --git a/bgpd/bgp_memory.h b/bgpd/bgp_memory.h index d1ae392c65..a95d9ef931 100644 --- a/bgpd/bgp_memory.h +++ b/bgpd/bgp_memory.h @@ -114,7 +114,9 @@ DECLARE_MTYPE(LCOMMUNITY_VAL) DECLARE_MTYPE(BGP_EVPN_MH_INFO) DECLARE_MTYPE(BGP_EVPN_ES) DECLARE_MTYPE(BGP_EVPN_ES_EVI) +DECLARE_MTYPE(BGP_EVPN_ES_VRF) DECLARE_MTYPE(BGP_EVPN_ES_VTEP) +DECLARE_MTYPE(BGP_EVPN_PATH_ES_INFO) DECLARE_MTYPE(BGP_EVPN_ES_EVI_VTEP) DECLARE_MTYPE(BGP_EVPN) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 9635fe1224..29ab3d9c6c 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -31,6 +31,7 @@ #include "nexthop.h" #include "vrf.h" #include "filter.h" +#include "nexthop_group.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_table.h" @@ -966,3 +967,83 @@ void bgp_nht_dereg_enhe_cap_intfs(struct peer *peer) 0); } } + +/**************************************************************************** + * L3 NHGs are used for fast failover of nexthops in the dplane. These are + * the APIs for allocating L3 NHG ids. Management of the L3 NHG itself is + * left to the application using it. + * PS: Currently EVPN host routes is the only app using L3 NHG for fast + * failover of remote ES links. + ***************************************************************************/ +static bitfield_t bgp_nh_id_bitmap; +static uint32_t bgp_l3nhg_start; + +/* XXX - currently we do nothing on the callbacks */ +static void bgp_l3nhg_add_cb(const char *name) +{ +} +static void bgp_l3nhg_add_nexthop_cb(const struct nexthop_group_cmd *nhgc, + const struct nexthop *nhop) +{ +} +static void bgp_l3nhg_del_nexthop_cb(const struct nexthop_group_cmd *nhgc, + const struct nexthop *nhop) +{ +} +static void bgp_l3nhg_del_cb(const char *name) +{ +} + +static void bgp_l3nhg_zebra_init(void) +{ + static bool bgp_l3nhg_zebra_inited; + if (bgp_l3nhg_zebra_inited) + return; + + bgp_l3nhg_zebra_inited = true; + bgp_l3nhg_start = zclient_get_nhg_start(ZEBRA_ROUTE_BGP); + nexthop_group_init(bgp_l3nhg_add_cb, bgp_l3nhg_add_nexthop_cb, + bgp_l3nhg_del_nexthop_cb, bgp_l3nhg_del_cb); +} + + +#define min(A, B) ((A) < (B) ? (A) : (B)) +void bgp_l3nhg_init(void) +{ + uint32_t id_max; + + id_max = min(ZEBRA_NHG_PROTO_SPACING - 1, 16 * 1024); + bf_init(bgp_nh_id_bitmap, id_max); + bf_assign_zero_index(bgp_nh_id_bitmap); + + if (BGP_DEBUG(nht, NHT) || BGP_DEBUG(evpn_mh, EVPN_MH_ES)) + zlog_debug("bgp l3_nhg range %u - %u", bgp_l3nhg_start + 1, + bgp_l3nhg_start + id_max); +} + +void bgp_l3nhg_finish(void) +{ + bf_free(bgp_nh_id_bitmap); +} + +uint32_t bgp_l3nhg_id_alloc(void) +{ + uint32_t nhg_id = 0; + + bgp_l3nhg_zebra_init(); + bf_assign_index(bgp_nh_id_bitmap, nhg_id); + if (nhg_id) + nhg_id += bgp_l3nhg_start; + + return nhg_id; +} + +void bgp_l3nhg_id_free(uint32_t nhg_id) +{ + if (!nhg_id || (nhg_id <= bgp_l3nhg_start)) + return; + + nhg_id -= bgp_l3nhg_start; + + bf_release_index(bgp_nh_id_bitmap, nhg_id); +} diff --git a/bgpd/bgp_nht.h b/bgpd/bgp_nht.h index 4e015e4aae..8451f0689d 100644 --- a/bgpd/bgp_nht.h +++ b/bgpd/bgp_nht.h @@ -90,4 +90,10 @@ extern void bgp_nht_register_nexthops(struct bgp *bgp); extern void bgp_nht_reg_enhe_cap_intfs(struct peer *peer); extern void bgp_nht_dereg_enhe_cap_intfs(struct peer *peer); +/* APIs for setting up and allocating L3 nexthop group ids */ +extern uint32_t bgp_l3nhg_id_alloc(void); +extern void bgp_l3nhg_id_free(uint32_t nhg_id); +extern void bgp_l3nhg_init(void); +void bgp_l3nhg_finish(void); + #endif /* _BGP_NHT_H */ diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 3d73e34235..cf7a265b11 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -1393,13 +1393,8 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size) || peer->afc_nego[AFI_IP][SAFI_ENCAP]) { if (peer->nexthop.v4.s_addr == INADDR_ANY) { #if defined(HAVE_CUMULUS) - flog_err( - EC_BGP_SND_FAIL, - "%s: No local IPv4 addr resetting connection, fd %d", - peer->host, peer->fd); - bgp_notify_send(peer, BGP_NOTIFY_CEASE, - BGP_NOTIFY_SUBCODE_UNSPECIFIC); - return BGP_Stop; + zlog_warn("%s: No local IPv4 addr, BGP routing may not work", + peer->host); #endif } } @@ -1410,13 +1405,8 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size) || peer->afc_nego[AFI_IP6][SAFI_ENCAP]) { if (IN6_IS_ADDR_UNSPECIFIED(&peer->nexthop.v6_global)) { #if defined(HAVE_CUMULUS) - flog_err( - EC_BGP_SND_FAIL, - "%s: No local IPv6 addr resetting connection, fd %d", - peer->host, peer->fd); - bgp_notify_send(peer, BGP_NOTIFY_CEASE, - BGP_NOTIFY_SUBCODE_UNSPECIFIC); - return BGP_Stop; + zlog_warn("%s: No local IPv6 address, BGP routing may not work", + peer->host); #endif } } diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index df30897dc6..db3eb95353 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -244,6 +244,9 @@ void bgp_path_info_extra_free(struct bgp_path_info_extra **extra) if (e->aggr_suppressors) list_delete(&e->aggr_suppressors); + if (e->es_info) + bgp_evpn_path_es_info_free(e->es_info); + if ((*extra)->bgp_fs_iprule) list_delete(&((*extra)->bgp_fs_iprule)); if ((*extra)->bgp_fs_pbr) @@ -8617,11 +8620,21 @@ void route_vty_out(struct vty *vty, const struct prefix *p, vty_out(vty, "\n"); if (safi == SAFI_EVPN) { + struct bgp_path_es_info *path_es_info = NULL; + + if (path->extra) + path_es_info = path->extra->es_info; + if (bgp_evpn_is_esi_valid(&attr->esi)) { + /* XXX - add these params to the json out */ vty_out(vty, "%*s", 20, " "); - vty_out(vty, "ESI:%s\n", - esi_to_str(&attr->esi, - esi_buf, sizeof(esi_buf))); + vty_out(vty, "ESI:%s", + esi_to_str(&attr->esi, esi_buf, + sizeof(esi_buf))); + if (path_es_info && path_es_info->es) + vty_out(vty, " VNI: %u", + path_es_info->vni); + vty_out(vty, "\n"); } if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)) { @@ -9298,7 +9311,9 @@ static const char *bgp_path_selection_reason2str( } static void route_vty_out_detail_es_info(struct vty *vty, - struct attr *attr, json_object *json_path) + struct bgp_path_info *pi, + struct attr *attr, + json_object *json_path) { char esi_buf[ESI_STR_LEN]; bool es_local = !!CHECK_FLAG(attr->es_flags, ATTR_ES_IS_LOCAL); @@ -9308,7 +9323,6 @@ static void route_vty_out_detail_es_info(struct vty *vty, ATTR_ES_PEER_ACTIVE); bool peer_proxy = !!CHECK_FLAG(attr->es_flags, ATTR_ES_PEER_PROXY); - esi_to_str(&attr->esi, esi_buf, sizeof(esi_buf)); if (json_path) { json_object *json_es_info = NULL; @@ -9843,7 +9857,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, if (safi == SAFI_EVPN && bgp_evpn_is_esi_valid(&attr->esi)) { - route_vty_out_detail_es_info(vty, attr, json_path); + route_vty_out_detail_es_info(vty, path, attr, json_path); } /* Line 3 display Origin, Med, Locpref, Weight, Tag, valid, diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 0b76d7504b..17ca3f8b38 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -102,6 +102,19 @@ enum bgp_show_adj_route_type { #define BGP_NLRI_PARSE_ERROR_EVPN_TYPE1_SIZE -15 #define BGP_NLRI_PARSE_ERROR -32 +/* MAC-IP/type-2 path_info in the global routing table is linked to the + * destination ES + */ +struct bgp_path_es_info { + /* back pointer to the route */ + struct bgp_path_info *pi; + vni_t vni; + /* destination ES */ + struct bgp_evpn_es *es; + /* memory used for linking the path to the destination ES */ + struct listnode es_listnode; +}; + /* Ancillary information to struct bgp_path_info, * used for uncommonly used data (aggregation, MPLS, etc.) * and lazily allocated to save memory. @@ -188,6 +201,8 @@ struct bgp_path_info_extra { struct list *bgp_fs_pbr; /* presence of FS pbr iprule based entry */ struct list *bgp_fs_iprule; + /* Destination Ethernet Segment links for EVPN MH */ + struct bgp_path_es_info *es_info; }; struct bgp_path_info { diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index b08ec827de..1a7a3543f9 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2352,12 +2352,12 @@ ALIAS_HIDDEN(no_bgp_maxpaths_ibgp, no_bgp_maxpaths_ibgp_hidden_cmd, static void bgp_config_write_maxpaths(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) { - if (bgp->maxpaths[afi][safi].maxpaths_ebgp != MULTIPATH_NUM) { + if (bgp->maxpaths[afi][safi].maxpaths_ebgp != multipath_num) { vty_out(vty, " maximum-paths %d\n", bgp->maxpaths[afi][safi].maxpaths_ebgp); } - if (bgp->maxpaths[afi][safi].maxpaths_ibgp != MULTIPATH_NUM) { + if (bgp->maxpaths[afi][safi].maxpaths_ibgp != multipath_num) { vty_out(vty, " maximum-paths ibgp %d", bgp->maxpaths[afi][safi].maxpaths_ibgp); if (CHECK_FLAG(bgp->maxpaths[afi][safi].ibgp_flags, @@ -4263,7 +4263,6 @@ int peer_conf_interface_create(struct bgp *bgp, const char *conf_if, afi_t afi, struct peer *peer; struct peer_group *group; int ret = 0; - union sockunion su; group = peer_group_lookup(bgp, conf_if); @@ -4338,7 +4337,7 @@ int peer_conf_interface_create(struct bgp *bgp, const char *conf_if, afi_t afi, return -1; } - ret = peer_group_bind(bgp, &su, peer, group, &as); + ret = peer_group_bind(bgp, NULL, peer, group, &as); } return bgp_nb_errmsg_return(errmsg, errmsg_len, ret); @@ -10810,36 +10809,74 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, peer->pcount[afi][pfx_rcd_safi]); if (paf && PAF_SUBGRP(paf)) - json_object_int_add(json_peer, - "pfxSnt", - (PAF_SUBGRP(paf))->scount); + json_object_int_add( + json_peer, "pfxSnt", + (PAF_SUBGRP(paf))->scount); + else + json_object_int_add(json_peer, "pfxSnt", + 0); + + /* BGP FSM state */ if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN) || CHECK_FLAG(peer->bgp->flags, BGP_FLAG_SHUTDOWN)) - json_object_string_add(json_peer, "state", + json_object_string_add(json_peer, + "state", "Idle (Admin)"); - else if (peer->status == Active - && CHECK_FLAG(peer->flags, PEER_FLAG_PASSIVE)) - json_object_string_add(json_peer, "state", - "Active (passive)"); - else if (peer->status == Active - && CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT)) - json_object_string_add(json_peer, "state", - "Active (NSF passive)"); else if (peer->afc_recv[afi][safi]) json_object_string_add( - json_peer, "state", - lookup_msg(bgp_status_msg, peer->status, - NULL)); - else if (CHECK_FLAG(peer->sflags, - PEER_STATUS_PREFIX_OVERFLOW)) - json_object_string_add(json_peer, "state", + json_peer, "state", + lookup_msg(bgp_status_msg, + peer->status, NULL)); + else if (CHECK_FLAG( + peer->sflags, + PEER_STATUS_PREFIX_OVERFLOW)) + json_object_string_add(json_peer, + "state", "Idle (PfxCt)"); else json_object_string_add( - json_peer, "state", - lookup_msg(bgp_status_msg, peer->status, - NULL)); + json_peer, "state", + lookup_msg(bgp_status_msg, + peer->status, NULL)); + + /* BGP peer state */ + if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN) + || CHECK_FLAG(peer->bgp->flags, + BGP_FLAG_SHUTDOWN)) + json_object_string_add(json_peer, + "peerState", + "Admin"); + else if (CHECK_FLAG( + peer->sflags, + PEER_STATUS_PREFIX_OVERFLOW)) + json_object_string_add(json_peer, + "peerState", + "PfxCt"); + else if (CHECK_FLAG(peer->flags, + PEER_FLAG_PASSIVE)) + json_object_string_add(json_peer, + "peerState", + "Passive"); + else if (CHECK_FLAG(peer->sflags, + PEER_STATUS_NSF_WAIT)) + json_object_string_add(json_peer, + "peerState", + "NSF passive"); + else if (CHECK_FLAG( + peer->bgp->flags, + BGP_FLAG_EBGP_REQUIRES_POLICY) + && (!bgp_inbound_policy_exists(peer, + filter) + || !bgp_outbound_policy_exists( + peer, filter))) + json_object_string_add(json_peer, + "peerState", + "Policy"); + else + json_object_string_add( + json_peer, "peerState", "OK"); + json_object_int_add(json_peer, "connectionsEstablished", peer->established); json_object_int_add(json_peer, "connectionsDropped", diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 5d43645c6e..12bc2e41bc 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1179,6 +1179,8 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, int nh_updated; bool do_wt_ecmp; uint64_t cum_bw = 0; + uint32_t nhg_id = 0; + bool is_add; /* Don't try to install if we're not connected to Zebra or Zebra doesn't * know of this instance. @@ -1257,7 +1259,17 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, if (do_wt_ecmp) cum_bw = bgp_path_info_mpath_cumbw(info); - for (mpinfo = info; mpinfo; mpinfo = bgp_path_info_mpath_next(mpinfo)) { + /* EVPN MAC-IP routes are installed with a L3 NHG id */ + if (bgp_evpn_path_es_use_nhg(bgp, info, &nhg_id)) { + mpinfo = NULL; + api.nhgid = nhg_id; + if (nhg_id) + SET_FLAG(api.message, ZAPI_MESSAGE_NHG); + } else { + mpinfo = info; + } + + for (; mpinfo; mpinfo = bgp_path_info_mpath_next(mpinfo)) { uint32_t nh_weight; if (valid_nh_count >= multipath_num) @@ -1395,6 +1407,8 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, valid_nh_count++; } + is_add = (valid_nh_count || nhg_id) ? true : false; + /* * When we create an aggregate route we must also * install a Null0 route in the RIB, so overwrite @@ -1428,9 +1442,10 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, zlog_debug( "Tx route %s VRF %u %pFX metric %u tag %" ROUTE_TAG_PRI - " count %d", + " count %d nhg %d", valid_nh_count ? "add" : "delete", bgp->vrf_id, - &api.prefix, api.metric, api.tag, api.nexthop_num); + &api.prefix, api.metric, api.tag, api.nexthop_num, + nhg_id); for (i = 0; i < api.nexthop_num; i++) { api_nh = &api.nexthops[i]; @@ -1487,8 +1502,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, __func__, buf_prefix, (recursion_flag ? "" : "NOT ")); } - zclient_route_send(valid_nh_count ? ZEBRA_ROUTE_ADD - : ZEBRA_ROUTE_DELETE, + zclient_route_send(is_add ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE, zclient, &api); } @@ -1820,7 +1834,6 @@ int bgp_redistribute_unreg(struct bgp *bgp, afi_t afi, int type, vrf_bitmap_unset(zclient->redist[afi][type], bgp->vrf_id); } - if (bgp_install_info_to_zebra(bgp)) { /* Send distribute delete message to zebra. */ if (BGP_DEBUG(zebra, ZEBRA)) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 25f3526a23..82ce0c3882 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3156,6 +3156,7 @@ static struct bgp *bgp_create(as_t *as, const char *name, sizeof(struct bgp_evpn_info)); bgp_evpn_init(bgp); + bgp_evpn_vrf_es_init(bgp); bgp_pbr_init(bgp); /*initilize global GR FSM */ @@ -7327,6 +7328,7 @@ void bgp_master_init(struct thread_master *master, const int buffer_size) /* mpls label dynamic allocation pool */ bgp_lp_init(bm->master, &bm->labelpool); + bgp_l3nhg_init(); bgp_evpn_mh_init(); QOBJ_REG(bm, bgp_master); } diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index d22fd008d8..965a35b345 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -302,6 +302,9 @@ enum bgp_link_bw_handling { BGP_LINK_BW_DEFWT_4_MISSING }; +RB_HEAD(bgp_es_vrf_rb_head, bgp_evpn_es_vrf); +RB_PROTOTYPE(bgp_es_vrf_rb_head, bgp_evpn_es_vrf, rb_node, bgp_es_vrf_rb_cmp); + /* BGP instance structure. */ struct bgp { /* AS number of this BGP instance. */ @@ -637,6 +640,9 @@ struct bgp { /* SVI associated with the L3-VNI corresponding to this vrf */ ifindex_t l3vni_svi_ifindex; + /* RB tree of ES-VRFs */ + struct bgp_es_vrf_rb_head es_vrf_rb_tree; + /* vrf flags */ uint32_t vrf_flags; #define BGP_VRF_AUTO (1 << 0) diff --git a/configure.ac b/configure.ac index 0b09e8db08..6a7353d51a 100755 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,13 @@ dnl ----------------------------------- AC_CANONICAL_BUILD() AC_CANONICAL_HOST() +AC_ARG_VAR([AR],[archiver command]) +AC_ARG_VAR([LD],[linker command]) +AC_ARG_VAR([OBJCOPY],[objcopy command]) +AC_ARG_VAR([OBJDUMP],[objdump command]) +AC_ARG_VAR([RANLIB],[ranlib command]) +AC_ARG_VAR([STRIP],[strip command]) + hosttools_clippy="false" build_clippy="true" diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst index 486ae5fad6..a00b994988 100644 --- a/doc/user/bgp.rst +++ b/doc/user/bgp.rst @@ -35,6 +35,8 @@ be specified (:ref:`common-invocation-options`). of ``0.0.0.0`` / ``::``. This can be useful to constrain bgpd to an internal address, or to run multiple bgpd processes on one host. + Note that this option implies the --no_kernel option, and no learned routes will be installed into the linux kernel. + .. option:: -n, --no_kernel Do not install learned routes into the linux kernel. This option is useful diff --git a/doc/user/snmp.rst b/doc/user/snmp.rst index b770b236bd..ebbe178e0b 100644 --- a/doc/user/snmp.rst +++ b/doc/user/snmp.rst @@ -11,7 +11,9 @@ a SNMP agent using the the AgentX protocol (:rfc:`2741`) and make the routing protocol MIBs available through it. Note that SNMP Support needs to be enabled at compile-time and loaded as module -on daemon startup. Refer to :ref:`loadable-module-support` on the latter. +on daemon startup. Refer to :ref:`loadable-module-support` on the latter. If +you do not start the daemons with snmp module support snmp will not work +properly. .. _getting-and-installing-an-snmp-agent: diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 203fa8eb8d..6c6d88ad53 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -170,15 +170,19 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, return CMD_SUCCESS; } ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); - - if (!vrf_name && ifp->vrf_id == VRF_DEFAULT) - vrf_name = VRF_DEFAULT_NAME; - - if (ifp->vrf_id != VRF_DEFAULT) { - vrf = vrf_lookup_by_id(ifp->vrf_id); - if (vrf && !vrf_name) - vrf_name = vrf->name; + if (!vrf_name) { + if (ifp) { + if (ifp->vrf_id == VRF_DEFAULT) + vrf_name = VRF_DEFAULT_NAME; + else { + vrf = vrf_lookup_by_id(ifp->vrf_id); + if (vrf && !vrf_name) + vrf_name = vrf->name; + } + } else + vrf_name = VRF_DEFAULT_NAME; } + area = isis_area_lookup_by_vrf(tag, vrf_name); if (!area) { isis_global_instance_create(vrf_name); @@ -235,7 +239,7 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, } /* check if the interface is a loopback and if so set it as passive */ - if (if_is_loopback(ifp)) + if (ifp && if_is_loopback(ifp)) nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, "true"); @@ -263,14 +267,19 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, return CMD_SUCCESS; ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); - if (!vrf_name && ifp->vrf_id == VRF_DEFAULT) - vrf_name = VRF_DEFAULT_NAME; - - if (ifp->vrf_id != VRF_DEFAULT) { - vrf = vrf_lookup_by_id(ifp->vrf_id); - if (vrf && !vrf_name) - vrf_name = vrf->name; + if (!vrf_name) { + if (ifp) { + if (ifp->vrf_id == VRF_DEFAULT) + vrf_name = VRF_DEFAULT_NAME; + else { + vrf = vrf_lookup_by_id(ifp->vrf_id); + if (vrf && !vrf_name) + vrf_name = vrf->name; + } + } else + vrf_name = VRF_DEFAULT_NAME; } + area = isis_area_lookup_by_vrf(tag, vrf_name); if (!area) { isis_global_instance_create(vrf_name); @@ -326,7 +335,7 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, } /* check if the interface is a loopback and if so set it as passive */ - if (if_is_loopback(ifp)) + if (ifp && if_is_loopback(ifp)) nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, "true"); diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 19cacde4fe..58b0cf2684 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1811,7 +1811,8 @@ static void isis_print_paths(struct vty *vty, struct isis_vertex_queue *queue, "Vertex Type Metric Next-Hop Interface Parent\n"); for (ALL_QUEUE_ELEMENTS_RO(queue, node, vertex)) { - if (memcmp(vertex->N.id, root_sysid, ISIS_SYS_ID_LEN) == 0) { + if (VTYPE_IS(vertex->type) + && memcmp(vertex->N.id, root_sysid, ISIS_SYS_ID_LEN) == 0) { vty_out(vty, "%-20s %-12s %-6s", print_sys_hostname(root_sysid), "", ""); vty_out(vty, "%-30s\n", ""); diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index b9958a6696..1b4b0c8f2f 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -207,35 +207,30 @@ static int isis_zebra_add_nexthops(struct isis *isis, struct list *nexthops, api_nh->ifindex = nexthop->ifindex; /* Add MPLS label(s). */ - switch (type) { - case ISIS_NEXTHOP_MAIN: - if (nexthop->sr.present) { - api_nh->label_num = 1; - api_nh->labels[0] = nexthop->sr.label; - } else if (mpls_lsp) + if (nexthop->label_stack) { + api_nh->label_num = nexthop->label_stack->num_labels; + memcpy(api_nh->labels, nexthop->label_stack->label, + sizeof(mpls_label_t) * api_nh->label_num); + } else if (nexthop->sr.present) { + api_nh->label_num = 1; + api_nh->labels[0] = nexthop->sr.label; + } else if (mpls_lsp) { + switch (type) { + case ISIS_NEXTHOP_MAIN: /* * Do not use non-SR enabled nexthops to prevent * broken LSPs from being formed. */ continue; - break; - case ISIS_NEXTHOP_BACKUP: - if (nexthop->label_stack) { - api_nh->label_num = - nexthop->label_stack->num_labels; - memcpy(api_nh->labels, - nexthop->label_stack->label, - sizeof(mpls_label_t) - * api_nh->label_num); - } else if (mpls_lsp) { + case ISIS_NEXTHOP_BACKUP: /* * This is necessary because zebra requires * the nexthops of MPLS LSPs to be labeled. */ api_nh->label_num = 1; api_nh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; + break; } - break; } /* Backup nexthop handling. */ @@ -263,9 +258,15 @@ void isis_zebra_route_add_route(struct isis *isis, struct prefix *prefix, struct zapi_route api; int count = 0; - if (zclient->sock < 0 || list_isempty(route_info->nexthops)) + if (zclient->sock < 0) return; + /* Uninstall the route if it doesn't have any valid nexthop. */ + if (list_isempty(route_info->nexthops)) { + isis_zebra_route_del_route(isis, prefix, src_p, route_info); + return; + } + memset(&api, 0, sizeof(api)); api.vrf_id = isis->vrf_id; api.type = PROTO_TYPE; diff --git a/ldpd/lde.c b/ldpd/lde.c index c2e11a0aee..5ed0ed4520 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -73,6 +73,7 @@ struct ldpd_conf *ldeconf; struct nbr_tree lde_nbrs = RB_INITIALIZER(&lde_nbrs); static struct imsgev *iev_ldpe; +static struct imsgev iev_main_sync_data; static struct imsgev *iev_main, *iev_main_sync; /* lde privileges */ @@ -148,8 +149,8 @@ lde(void) &iev_main->ev_read); iev_main->handler_write = ldp_write_handler; - if ((iev_main_sync = calloc(1, sizeof(struct imsgev))) == NULL) - fatal(NULL); + memset(&iev_main_sync_data, 0, sizeof(iev_main_sync_data)); + iev_main_sync = &iev_main_sync_data; imsg_init(&iev_main_sync->ibuf, LDPD_FD_SYNC); /* create base configuration */ @@ -203,7 +204,6 @@ lde_shutdown(void) if (iev_ldpe) free(iev_ldpe); free(iev_main); - free(iev_main_sync); log_info("label decision engine exiting"); diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index ffc1d17f51..f3f8b85102 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -49,6 +49,7 @@ struct ldpd_conf *leconf; struct ldpd_sysdep sysdep; #endif +static struct imsgev iev_main_data; static struct imsgev *iev_main, *iev_main_sync; static struct imsgev *iev_lde; #ifdef __OpenBSD__ @@ -124,8 +125,8 @@ ldpe(void) &iev_main->ev_read); iev_main->handler_write = ldp_write_handler; - if ((iev_main_sync = calloc(1, sizeof(struct imsgev))) == NULL) - fatal(NULL); + memset(&iev_main_data, 0, sizeof(iev_main_data)); + iev_main_sync = &iev_main_data; imsg_init(&iev_main_sync->ibuf, LDPD_FD_SYNC); /* create base configuration */ @@ -231,7 +232,6 @@ ldpe_shutdown(void) if (iev_lde) free(iev_lde); free(iev_main); - free(iev_main_sync); free(pkt_ptr); log_info("ldp engine exiting"); diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c index f9e11541fc..bdc65d23bf 100644 --- a/ospfd/ospf_routemap.c +++ b/ospfd/ospf_routemap.c @@ -416,7 +416,7 @@ static void *route_set_metric_compile(const char *arg) { struct ospf_metric *metric; - metric = XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t)); + metric = XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(*metric)); metric->used = false; if (all_digit(arg)) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 71dea80538..30aa0b80e1 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -583,7 +583,7 @@ DEFUN (ospf_network_area, "Please remove all ip ospf area x.x.x.x commands first.\n"); if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "%s ospf vrf %s num of %u ip osp area x config", + "%s ospf vrf %s num of %u ip ospf area x config", __func__, ospf->name ? ospf->name : "NIL", ospf->if_ospf_cli_count); return CMD_WARNING_CONFIG_FAILED; diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index a839806720..d8be19db9a 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -1603,7 +1603,8 @@ int ospf_area_nssa_unset(struct ospf *ospf, struct in_addr area_id, int argc) OSPF_NSSA_TRANS_STABLE_DEFAULT; ospf_area_type_set(area, OSPF_AREA_DEFAULT); } else { - area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE; + ospf_area_nssa_translator_role_set(ospf, area_id, + OSPF_NSSA_ROLE_CANDIDATE); } ospf_area_check_free(ospf, area_id); @@ -1620,7 +1621,19 @@ int ospf_area_nssa_translator_role_set(struct ospf *ospf, if (area == NULL) return 0; - area->NSSATranslatorRole = role; + if (role != area->NSSATranslatorRole) { + if ((area->NSSATranslatorRole == OSPF_NSSA_ROLE_ALWAYS) + || (role == OSPF_NSSA_ROLE_ALWAYS)) { + /* RFC 3101 3.1 + * if new role is OSPF_NSSA_ROLE_ALWAYS we need to set + * Nt bit, if the role was OSPF_NSSA_ROLE_ALWAYS we need + * to clear Nt bit + */ + area->NSSATranslatorRole = role; + ospf_router_lsa_update_area(area); + } else + area->NSSATranslatorRole = role; + } return 1; } diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index bdd09e1e76..192e542815 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -303,7 +303,7 @@ struct ospf { uint32_t rx_lsa_count; /* Counter of "ip ospf area x.x.x.x" used - * for multual exclusion of network command under + * for mutual exclusion of network command under * router ospf or ip ospf area x under interface. */ uint32_t if_ospf_cli_count; diff --git a/tests/topotests/Dockerfile b/tests/topotests/Dockerfile index b7c6298228..b7042d84c6 100644 --- a/tests/topotests/Dockerfile +++ b/tests/topotests/Dockerfile @@ -48,7 +48,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && rm -rf /var/lib/apt/lists/* RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5418F291D0D4A1AA \ + && wget -qO- https://deb.frrouting.org/frr/keys.asc | apt-key add - \ && echo "deb https://deb.frrouting.org/frr bionic frr-stable" > /etc/apt/sources.list.d/frr.list \ && apt-get update \ && apt-get install -y libyang-dev \ diff --git a/tests/topotests/all-protocol-startup/test_all_protocol_startup.py b/tests/topotests/all-protocol-startup/test_all_protocol_startup.py index 0254ff6af6..84bae74f6d 100644 --- a/tests/topotests/all-protocol-startup/test_all_protocol_startup.py +++ b/tests/topotests/all-protocol-startup/test_all_protocol_startup.py @@ -269,6 +269,9 @@ def test_error_messages_daemons(): error_logs += log log = net["r1"].getStdErr("nhrpd") + # NHRPD shows YANG model not embedded messages + # Ignore these + log = re.sub(r".*YANG model.*not embedded.*", "", log).rstrip() if log: error_logs += "r%s NHRPd StdErr Output:\n" % i error_logs += log @@ -285,7 +288,7 @@ def test_error_messages_daemons(): log = net["r%s" % i].getStdErr("zebra") if log: - error_logs += "r%s Zebra StdErr Output:\n" + error_logs += "r%s Zebra StdErr Output:\n" % i error_logs += log if error_logs: @@ -1065,7 +1068,7 @@ def test_bgp_ipv4(): if not success: resultstr = "No template matched.\n" - for f in diffresult.iterkeys(): + for f in diffresult.keys(): resultstr += "template %s: r%s failed SHOW BGP IPv4 check:\n%s\n" % ( f, i, @@ -1134,7 +1137,7 @@ def test_bgp_ipv6(): if not success: resultstr = "No template matched.\n" - for f in diffresult.iterkeys(): + for f in diffresult.keys(): resultstr += "template %s: r%s failed SHOW BGP IPv6 check:\n%s\n" % ( f, i, diff --git a/tests/topotests/bgp-auth/R1/bgpd_multi_vrf.conf b/tests/topotests/bgp-auth/R1/bgpd_multi_vrf.conf index aab35073cf..dde3c090b5 100644 --- a/tests/topotests/bgp-auth/R1/bgpd_multi_vrf.conf +++ b/tests/topotests/bgp-auth/R1/bgpd_multi_vrf.conf @@ -1,4 +1,3 @@ -log file /tmp/topotests/test_bgp_auth/R1/bgpd.log debugging debug bgp neighbor-events router bgp 65001 vrf blue diff --git a/tests/topotests/bgp-auth/R1/bgpd_vrf.conf b/tests/topotests/bgp-auth/R1/bgpd_vrf.conf index 73aa8c1a03..781f906d3a 100644 --- a/tests/topotests/bgp-auth/R1/bgpd_vrf.conf +++ b/tests/topotests/bgp-auth/R1/bgpd_vrf.conf @@ -1,4 +1,3 @@ -log file /tmp/topotests/test_bgp_auth/R1/bgpd.log debugging debug bgp neighbor-events router bgp 65001 vrf blue diff --git a/tests/topotests/bgp-auth/R1/zebra.conf b/tests/topotests/bgp-auth/R1/zebra.conf index d39915335a..a0b062c44c 100644 --- a/tests/topotests/bgp-auth/R1/zebra.conf +++ b/tests/topotests/bgp-auth/R1/zebra.conf @@ -1,4 +1,3 @@ -log file zebra.log ! interface lo ip address 1.1.1.1/32 @@ -18,4 +17,4 @@ interface R1-eth4 vrf red ip address 10.10.0.1/24 interface R1-eth5 vrf red ip address 10.20.0.1/24 -!
\ No newline at end of file +! diff --git a/tests/topotests/bgp-auth/R2/zebra.conf b/tests/topotests/bgp-auth/R2/zebra.conf index fece68472a..fed4c27c16 100644 --- a/tests/topotests/bgp-auth/R2/zebra.conf +++ b/tests/topotests/bgp-auth/R2/zebra.conf @@ -1,4 +1,3 @@ -log file zebra.log ! interface lo ip address 2.2.2.2/32 @@ -18,4 +17,4 @@ interface R2-eth4 vrf red ip address 10.10.0.2/24 interface R2-eth5 vrf red ip address 10.30.0.2/24 -!
\ No newline at end of file +! diff --git a/tests/topotests/bgp-auth/R3/zebra.conf b/tests/topotests/bgp-auth/R3/zebra.conf index 0fe3acdfd0..d49c98b168 100644 --- a/tests/topotests/bgp-auth/R3/zebra.conf +++ b/tests/topotests/bgp-auth/R3/zebra.conf @@ -1,4 +1,3 @@ -log file zebra.log ! interface lo ip address 3.3.3.3/32 @@ -18,4 +17,4 @@ interface R3-eth4 vrf red ip address 10.20.0.3/24 interface R3-eth5 vrf red ip address 10.30.0.3/24 -!
\ No newline at end of file +! diff --git a/tests/topotests/bgp_features/r1/ospf6d.conf b/tests/topotests/bgp_features/r1/ospf6d.conf index 532da39fb7..a38e4b862a 100644 --- a/tests/topotests/bgp_features/r1/ospf6d.conf +++ b/tests/topotests/bgp_features/r1/ospf6d.conf @@ -4,17 +4,16 @@ debug ospf6 neighbor ! interface r1-lo ! -interface r1-eth0 -! interface r1-eth1 + ipv6 ospf6 priority 10 ! interface r1-eth2 + ipv6 ospf6 priority 10 ! router ospf6 ospf6 router-id 192.168.0.1 log-adjacency-changes interface r1-lo area 0.0.0.0 - interface r1-eth0 area 0.0.0.0 interface r1-eth1 area 0.0.0.0 interface r1-eth2 area 0.0.0.0 ! diff --git a/tests/topotests/bgp_features/r1/ospf_neighbor.json b/tests/topotests/bgp_features/r1/ospf_neighbor.json index ecb97d8d74..e742c119da 100644 --- a/tests/topotests/bgp_features/r1/ospf_neighbor.json +++ b/tests/topotests/bgp_features/r1/ospf_neighbor.json @@ -2,14 +2,14 @@ "neighbors":{ "192.168.0.2":[ { - "priority":1, - "state":"Full\/DR" + "priority":5, + "state":"Full\/Backup" } ], "192.168.0.3":[ { - "priority":1, - "state":"Full\/DR" + "priority":5, + "state":"Full\/Backup" } ] } diff --git a/tests/topotests/bgp_features/r1/ospfd.conf b/tests/topotests/bgp_features/r1/ospfd.conf index 8f1711db7b..68a1bb5c75 100644 --- a/tests/topotests/bgp_features/r1/ospfd.conf +++ b/tests/topotests/bgp_features/r1/ospfd.conf @@ -3,6 +3,16 @@ log file ospfd.log debug ospf event debug ospf zebra ! +interface r1-eth1 + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf priority 10 +! +interface r1-eth2 + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf priority 10 +! router ospf ospf router-id 192.168.0.1 log-adjacency-changes @@ -13,11 +23,4 @@ router ospf refresh timer 10 ! line vty -interface r1-eth1 - ip ospf hello-interval 2 - ip ospf dead-interval 10 -! -interface r1-eth2 - ip ospf hello-interval 2 - ip ospf dead-interval 10 ! diff --git a/tests/topotests/bgp_features/r2/ospf6d.conf b/tests/topotests/bgp_features/r2/ospf6d.conf index 283d205489..47bd5a99cc 100644 --- a/tests/topotests/bgp_features/r2/ospf6d.conf +++ b/tests/topotests/bgp_features/r2/ospf6d.conf @@ -4,17 +4,16 @@ debug ospf6 neighbor ! interface r2-lo ! -interface r2-eth0 -! interface r2-eth1 + ipv6 ospf6 priority 5 ! interface r2-eth2 + ipv6 ospf6 priority 10 ! router ospf6 ospf6 router-id 192.168.0.2 log-adjacency-changes interface r2-lo area 0.0.0.0 - interface r2-eth0 area 0.0.0.0 interface r2-eth1 area 0.0.0.0 interface r2-eth2 area 0.0.0.0 ! diff --git a/tests/topotests/bgp_features/r2/ospf_neighbor.json b/tests/topotests/bgp_features/r2/ospf_neighbor.json index 5fcbd82ee1..2fd589ae25 100644 --- a/tests/topotests/bgp_features/r2/ospf_neighbor.json +++ b/tests/topotests/bgp_features/r2/ospf_neighbor.json @@ -2,14 +2,14 @@ "neighbors":{ "192.168.0.1":[ { - "priority":1, - "state":"Full\/Backup" + "priority":10, + "state":"Full\/DR" } ], "192.168.0.3":[ { - "priority":1, - "state":"Full\/DR" + "priority":5, + "state":"Full\/Backup" } ] } diff --git a/tests/topotests/bgp_features/r2/ospfd.conf b/tests/topotests/bgp_features/r2/ospfd.conf index 2174fddb11..6f608e454b 100644 --- a/tests/topotests/bgp_features/r2/ospfd.conf +++ b/tests/topotests/bgp_features/r2/ospfd.conf @@ -3,6 +3,16 @@ log file ospfd.log debug ospf event debug ospf zebra ! +int r2-eth1 + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf priority 5 +! +int r2-eth2 + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf priority 10 +! router ospf ospf router-id 192.168.0.2 log-adjacency-changes @@ -12,12 +22,5 @@ router ospf timers throttle lsa all 0 refresh timer 10 ! -int r2-eth1 - ip ospf hello-interval 2 - ip ospf dead-interval 10 -int r2-eth2 - ip ospf hello-interval 2 - ip ospf dead-interval 10 -! line vty ! diff --git a/tests/topotests/bgp_features/r3/ospf6d.conf b/tests/topotests/bgp_features/r3/ospf6d.conf index 7a6623f979..eb74901ba1 100644 --- a/tests/topotests/bgp_features/r3/ospf6d.conf +++ b/tests/topotests/bgp_features/r3/ospf6d.conf @@ -4,17 +4,16 @@ debug ospf6 neighbor ! interface r3-lo ! -interface r3-eth0 -! interface r3-eth1 + ipv6 ospf6 priority 5 ! interface r3-eth2 + ipv6 ospf6 priority 5 ! router ospf6 ospf6 router-id 192.168.0.3 log-adjacency-changes interface r3-lo area 0.0.0.0 - interface r3-eth0 area 0.0.0.0 interface r3-eth1 area 0.0.0.0 interface r3-eth2 area 0.0.0.0 ! diff --git a/tests/topotests/bgp_features/r3/ospf_neighbor.json b/tests/topotests/bgp_features/r3/ospf_neighbor.json index e90a70a8f6..80fc92c3bc 100644 --- a/tests/topotests/bgp_features/r3/ospf_neighbor.json +++ b/tests/topotests/bgp_features/r3/ospf_neighbor.json @@ -2,14 +2,14 @@ "neighbors":{ "192.168.0.1":[ { - "priority":1, - "state":"Full\/Backup" + "priority":10, + "state":"Full\/DR" } ], "192.168.0.2":[ { - "priority":1, - "state":"Full\/Backup" + "priority":10, + "state":"Full\/DR" } ] } diff --git a/tests/topotests/bgp_features/r3/ospfd.conf b/tests/topotests/bgp_features/r3/ospfd.conf index 795344fbe6..71e4f1e1df 100644 --- a/tests/topotests/bgp_features/r3/ospfd.conf +++ b/tests/topotests/bgp_features/r3/ospfd.conf @@ -3,6 +3,16 @@ log file ospfd.log debug ospf event debug ospf zebra ! +int r3-eth1 + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf priority 5 +! +int r3-eth2 + ip ospf hello-interval 2 + ip ospf dead-interval 10 + ip ospf priority 5 +! router ospf ospf router-id 192.168.0.3 log-adjacency-changes @@ -12,12 +22,5 @@ router ospf timers throttle lsa all 0 refresh timer 10 ! -int r3-eth1 - ip ospf hello-interval 2 - ip ospf dead-interval 10 -int r3-eth2 - ip ospf hello-interval 2 - ip ospf dead-interval 10 -! line vty ! diff --git a/tests/topotests/bgp_features/test_bgp_features.py b/tests/topotests/bgp_features/test_bgp_features.py index bd092c4340..9dce9d668b 100644 --- a/tests/topotests/bgp_features/test_bgp_features.py +++ b/tests/topotests/bgp_features/test_bgp_features.py @@ -102,7 +102,7 @@ def setup_module(module): # Starting Routers router_list = tgen.routers() - for rname, router in router_list.iteritems(): + for rname, router in router_list.items(): router.load_config( TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname)) ) diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py index 3f1157ad72..0deb181f3e 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/add_routes.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "r1", 'vtysh -c "show bgp next"', "99.0.0.. valid", "wait", "See CE static NH" diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/adjacencies.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/adjacencies.py index ea059c576e..789f93b837 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/adjacencies.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/adjacencies.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand("ce1", "ping 192.168.1.1 -c 1", " 0. packet loss", "pass", "CE->PE ping") luCommand("ce2", "ping 192.168.1.1 -c 1", " 0. packet loss", "pass", "CE->PE ping") diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/check_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/check_routes.py index 96b4978261..af39a951b7 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/check_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/check_routes.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "ce1", diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/cleanup_all.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/cleanup_all.py index 9f21d99913..38eac14c64 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/cleanup_all.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/scripts/cleanup_all.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "r1", diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py index 5c7427763d..375bca8a63 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/add_routes.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "r1", 'vtysh -c "add vrf r1-cust1 prefix 99.0.0.1/32"', ".", "none", "IP Address" diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/adjacencies.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/adjacencies.py index 53cf353fa0..f5145753a5 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/adjacencies.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/adjacencies.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand("ce1", 'vtysh -c "show bgp summary"', " 00:0", "wait", "Adjacencies up", 180) luCommand("ce2", 'vtysh -c "show bgp summary"', " 00:0", "wait", "Adjacencies up", 180) diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py index 20113b1058..a5f95f94bf 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_mpls.py @@ -1,4 +1,4 @@ -from lutil import luCommand, luLast +from lib.lutil import luCommand, luLast from lib import topotest ret = luCommand( diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py index b552ea0406..7c154ecd15 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand from customize import l3mdev_accept l3mdev_rtrs = ["r1", "r3", "r4", "ce4"] diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py index 98d2a3bafc..d55169a19e 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py @@ -1,5 +1,5 @@ -from lutil import luCommand -from bgprib import bgpribRequireVpnRoutes, bgpribRequireUnicastRoutes +from lib.lutil import luCommand +from lib.bgprib import bgpribRequireVpnRoutes, bgpribRequireUnicastRoutes ######################################################################## # CE routers: contain routes they originate diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py index af77ab01c1..a27b178548 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/cleanup_all.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "r1", diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/del_bgp_instances.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/del_bgp_instances.py index 477578bdbd..fcbc3df6ef 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/del_bgp_instances.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/del_bgp_instances.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "r1", diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py index 2b0a85a91a..dd2e24722f 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand rtrs = ["ce1", "ce2", "ce3", "r1", "r2", "r3", "r4"] for rtr in rtrs: diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_down.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_down.py index 7990533f3a..6ce81baf11 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_down.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_down.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand ret = luCommand( "ce1", diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py index 3c768640a1..04ca03973d 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_up.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand num = 50000 b = int(num / (256 * 256)) diff --git a/tests/topotests/bgp_multi_vrf_topo2/bgp_multi_vrf_topo2.json b/tests/topotests/bgp_multi_vrf_topo2/bgp_multi_vrf_topo2.json index ab570fcc16..bcee7e1a12 100644 --- a/tests/topotests/bgp_multi_vrf_topo2/bgp_multi_vrf_topo2.json +++ b/tests/topotests/bgp_multi_vrf_topo2/bgp_multi_vrf_topo2.json @@ -43,7 +43,10 @@ "neighbor": { "r1": { "dest_link": { - "red1-link1": {} + "red1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -54,7 +57,10 @@ "neighbor": { "r1": { "dest_link": { - "red1-link1": {} + "red1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -71,7 +77,10 @@ "neighbor": { "r1": { "dest_link": { - "red1-link2": {} + "red1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -82,7 +91,10 @@ "neighbor": { "r1": { "dest_link": { - "red1-link2": {} + "red1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -118,7 +130,10 @@ "neighbor": { "r1": { "dest_link": { - "blue1-link1": {} + "blue1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -129,7 +144,10 @@ "neighbor": { "r1": { "dest_link": { - "blue1-link1": {} + "blue1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -146,7 +164,10 @@ "neighbor": { "r1": { "dest_link": { - "blue1-link2": {} + "blue1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -157,7 +178,10 @@ "neighbor": { "r1": { "dest_link": { - "blue1-link2": {} + "blue1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -211,18 +235,28 @@ "neighbor": { "red1": { "dest_link": { - "r1-link1": {} + "r1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link1": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link1": {} + "r1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -233,18 +267,28 @@ "neighbor": { "red1": { "dest_link": { - "r1-link1": {} + "r1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link1": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link1": {} + "r1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -261,18 +305,28 @@ "neighbor": { "red1": { "dest_link": { - "r1-link2": {} + "r1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link2": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link2": {} + "r1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -283,18 +337,28 @@ "neighbor": { "red1": { "dest_link": { - "r1-link2": {} + "r1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link2": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link2": {} + "r1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -311,18 +375,28 @@ "neighbor": { "blue1": { "dest_link": { - "r1-link1": {} + "r1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link3": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link3": {} + "r1-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -333,18 +407,28 @@ "neighbor": { "blue1": { "dest_link": { - "r1-link1": {} + "r1-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link3": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link3": {} + "r1-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -361,18 +445,28 @@ "neighbor": { "blue1": { "dest_link": { - "r1-link2": {} + "r1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link4": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link4": {} + "r1-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -383,18 +477,28 @@ "neighbor": { "blue1": { "dest_link": { - "r1-link2": {} + "r1-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r2": { "dest_link": { "r1-link4": - { "next_hop_self": true } + { + "keepalivetimer": 1, + "holddowntimer": 3, + "next_hop_self": true + } } }, "r4": { "dest_link": { - "r1-link4": {} + "r1-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -444,12 +548,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link1": {} + "r2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link1": {} + "r2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -460,12 +570,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link1": {} + "r2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link1": {} + "r2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -482,12 +598,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link2": {} + "r2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link2": {} + "r2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -498,12 +620,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link2": {} + "r2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link2": {} + "r2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -520,12 +648,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link3": {} + "r2-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link3": {} + "r2-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -536,12 +670,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link3": {} + "r2-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link3": {} + "r2-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -558,12 +698,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link4": {} + "r2-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link4": {} + "r2-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -574,12 +720,18 @@ "neighbor": { "r1": { "dest_link": { - "r2-link4": {} + "r2-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r2-link4": {} + "r2-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -633,17 +785,26 @@ "neighbor": { "r2": { "dest_link": { - "r3-link1": {} + "r3-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r4": { "dest_link": { - "r3-link1": {} + "r3-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "red2": { "dest_link": { - "r3-link1": {} + "r3-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -658,7 +819,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -668,7 +831,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -678,7 +843,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } } @@ -696,17 +863,26 @@ "neighbor": { "r2": { "dest_link": { - "r3-link2": {} + "r3-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r4": { "dest_link": { - "r3-link2": {} + "r3-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "red2": { "dest_link": { - "r3-link2": {} + "r3-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -721,7 +897,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -731,7 +909,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -741,7 +921,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } } @@ -759,17 +941,26 @@ "neighbor": { "r2": { "dest_link": { - "r3-link3": {} + "r3-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r4": { "dest_link": { - "r3-link3": {} + "r3-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "blue2": { "dest_link": { - "r3-link1": {} + "r3-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -784,7 +975,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -794,7 +987,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -804,7 +999,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } } @@ -822,17 +1019,26 @@ "neighbor": { "r2": { "dest_link": { - "r3-link4": {} + "r3-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r4": { "dest_link": { - "r3-link4": {} + "r3-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "blue2": { "dest_link": { - "r3-link2": {} + "r3-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -847,7 +1053,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -857,7 +1065,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } }, @@ -867,7 +1077,9 @@ "route_maps": [{ "name": "rmap_global", "direction": "in" - }] + }], + "keepalivetimer": 1, + "holddowntimer": 3 } } } @@ -928,12 +1140,18 @@ "neighbor": { "r1": { "dest_link": { - "r4-link1": {} + "r4-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r4-link1": {} + "r4-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -945,6 +1163,8 @@ "r1": { "dest_link": { "r4-link1": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -955,6 +1175,8 @@ "r3": { "dest_link": { "r4-link1": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -976,12 +1198,18 @@ "neighbor": { "r1": { "dest_link": { - "r4-link2": {} + "r4-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r4-link2": {} + "r4-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -993,6 +1221,8 @@ "r1": { "dest_link": { "r4-link2": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -1003,6 +1233,8 @@ "r3": { "dest_link": { "r4-link2": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -1024,12 +1256,18 @@ "neighbor": { "r1": { "dest_link": { - "r4-link3": {} + "r4-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r4-link3": {} + "r4-link3": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1041,6 +1279,8 @@ "r1": { "dest_link": { "r4-link3": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -1051,6 +1291,8 @@ "r3": { "dest_link": { "r4-link3": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -1072,12 +1314,18 @@ "neighbor": { "r1": { "dest_link": { - "r4-link4": {} + "r4-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } }, "r3": { "dest_link": { - "r4-link4": {} + "r4-link4": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1089,6 +1337,8 @@ "r1": { "dest_link": { "r4-link4": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -1099,6 +1349,8 @@ "r3": { "dest_link": { "r4-link4": { + "keepalivetimer": 1, + "holddowntimer": 3, "route_maps": [{ "name": "rmap_global", "direction": "in" @@ -1149,7 +1401,10 @@ "neighbor": { "r3": { "dest_link": { - "red2-link1": {} + "red2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1160,7 +1415,10 @@ "neighbor": { "r3": { "dest_link": { - "red2-link1": {} + "red2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1177,7 +1435,10 @@ "neighbor": { "r3": { "dest_link": { - "red2-link2": {} + "red2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1188,7 +1449,10 @@ "neighbor": { "r3": { "dest_link": { - "red2-link2": {} + "red2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1224,7 +1488,10 @@ "neighbor": { "r3": { "dest_link": { - "blue2-link1": {} + "blue2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1235,7 +1502,10 @@ "neighbor": { "r3": { "dest_link": { - "blue2-link1": {} + "blue2-link1": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1252,7 +1522,10 @@ "neighbor": { "r3": { "dest_link": { - "blue2-link2": {} + "blue2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } @@ -1263,7 +1536,10 @@ "neighbor": { "r3": { "dest_link": { - "blue2-link2": {} + "blue2-link2": { + "keepalivetimer": 1, + "holddowntimer": 3 + } } } } diff --git a/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py b/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py index cafe758209..3190070223 100644 --- a/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py +++ b/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py @@ -35,7 +35,20 @@ CHAOS_5: CHAOS_9: Verify that all vrf instances fall back to backup path, if primary link goes down. - +CHAOS_6: + Restart BGPd daemon on DUT to check if all the + routes in respective vrfs are reinstalled.. +CHAOS_2: + Delete a VRF instance from DUT and check if the routes get + deleted from subsequent neighbour routers and appears again once VRF + is re-added. +CHAOS_4: + Verify that VRF names are locally significant + to a router, and end to end connectivity depends on unique + virtual circuits (using VLANs or separate physical interfaces). +CHAOS_8: + Restart all FRR services (reboot DUT) to check if all + the routes in respective vrfs are reinstalled. """ import os @@ -79,6 +92,10 @@ from lib.common_config import ( check_router_status, apply_raw_config, required_linux_kernel_version, + kill_router_daemons, + start_router_daemons, + stop_router, + start_router ) from lib.topolog import logger @@ -112,7 +129,7 @@ LOOPBACK_2 = { "ipv4": "20.20.20.20/32", "ipv6": "20::20:20/128", "ipv4_mask": "255.255.255.255", - "ipv6_mask": None, + "ipv6_mask": None } MAX_PATHS = 2 @@ -143,7 +160,7 @@ def setup_module(mod): * `mod`: module name """ # Required linux kernel version for this suite to run. - result = required_linux_kernel_version("4.15") + result = required_linux_kernel_version("4.14") if result is not True: pytest.skip("Kernel requirements are not met") @@ -1194,7 +1211,7 @@ def test_shut_noshut_p1(request): result = create_router_bgp(tgen, topo, input_dict_3) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Api call to modfiy BGP timerse") + step("Api call to modfiy BGP timers") input_dict_4 = { "r1": { @@ -1508,7 +1525,7 @@ def test_shut_noshut_p1(request): " when the interface is shut" ) - step("Sleeping for holddowntimer+1 sec..") + step("Sleeping for {}+1 sec..".format(HOLDDOWNTIMER)) sleep(HOLDDOWNTIMER + 1) result = verify_bgp_convergence(tgen, topo, expected=False) @@ -1718,7 +1735,7 @@ def test_vrf_vlan_routing_table_p1(request): tc_name, result ) - step("Api call to modfiy BGP timerse") + step("Api call to modfiy BGP timers") input_dict_4 = { "r3": { @@ -1780,7 +1797,7 @@ def test_vrf_vlan_routing_table_p1(request): tc_name, result ) - step("Sleeping for holdowntimer+1 sec..") + step("Sleeping for {}+1 sec..".format(HOLDDOWNTIMER)) sleep(HOLDDOWNTIMER + 1) for addr_type in ADDR_TYPES: @@ -1811,7 +1828,7 @@ def test_vrf_vlan_routing_table_p1(request): ) step( - "After deleting VRFs ipv6 addresses wil be deleted from kernel " + "After deleting VRFs ipv6 addresses will be deleted from kernel " " Adding back ipv6 addresses" ) @@ -1829,7 +1846,7 @@ def test_vrf_vlan_routing_table_p1(request): tgen, dut, intf_name, intf_ipv6, vrf, create=False ) - step("Sleeping for holdowntimer+1 sec..") + step("Sleeping for {}+1 sec..".format(HOLDDOWNTIMER)) sleep(HOLDDOWNTIMER + 1) for addr_type in ADDR_TYPES: @@ -2011,6 +2028,1782 @@ def test_vrf_route_leaking_next_hop_interface_flapping_p1(request): write_test_footer(tc_name) +def test_restart_bgpd_daemon_p1(request): + """ + CHAOS_6: + Restart BGPd daemon on DUT to check if all the + routes in respective vrfs are reinstalled.. + """ + + tgen = get_topogen() + tc_name = request.node.name + write_test_header(tc_name) + + if tgen.routers_have_failure(): + check_router_status(tgen) + + reset_config_on_routers(tgen) + + step( + "Advertise unique BGP prefixes(IPv4+IPv6) from RED_1" + " in vrf instances(RED_A and RED_B)." + ) + + for addr_type in ADDR_TYPES: + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_1) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step( + "Advertise unique BGP prefixes(IPv4+IPv6) from BLUE_1 in" + " vrf instances(BLUE_A and BLUE_B)." + ) + + for addr_type in ADDR_TYPES: + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_2) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step("Redistribute static..") + + input_dict_3 = {} + for dut in ["red1", "blue1"]: + temp = {dut: {"bgp": []}} + input_dict_3.update(temp) + + if "red" in dut: + VRFS = ["RED_A", "RED_B"] + AS_NUM = [500, 500] + elif "blue" in dut: + VRFS = ["BLUE_A", "BLUE_B"] + AS_NUM = [800, 800] + + for vrf, as_num in zip(VRFS, AS_NUM): + temp[dut]["bgp"].append( + { + "local_as": as_num, + "vrf": vrf, + "address_family": { + "ipv4": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + "ipv6": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + }, + } + ) + + result = create_router_bgp(tgen, topo, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Kill BGPd daemon on R1.") + kill_router_daemons(tgen, "r1", ["bgpd"]) + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + + result = verify_rib(tgen, addr_type, dut, input_dict_1, expected=False) + assert result is not True, "Testcase {} :Failed \n Error {}".format( + tc_name, result + ) + + result = verify_rib(tgen, addr_type, dut, input_dict_2, expected=False) + assert result is not True, "Testcase {} :Failed \n Error {}".format( + tc_name, result + ) + + step("Bring up BGPd daemon on R1.") + start_router_daemons(tgen, "r1", ["bgpd"]) + + result = verify_bgp_convergence(tgen, topo) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + + result = verify_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + write_test_footer(tc_name) + + +def test_delete_and_re_add_vrf_p1(request): + """ + CHAOS_2: + Delete a VRF instance from DUT and check if the routes get + deleted from subsequent neighbour routers and appears again once VRF + is re-added. + """ + + tgen = get_topogen() + tc_name = request.node.name + write_test_header(tc_name) + reset_config_on_routers(tgen) + + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + step( + "Advertise unique prefixes in BGP using static redistribution" + "for both vrfs (RED_A and RED_B) on router RED_1" + ) + + for addr_type in ADDR_TYPES: + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_1) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step( + "Advertise unique prefixes in BGP using static redistribution" + " for both vrfs (BLUE_A and BLUE_B) on router BLUE_1." + ) + + for addr_type in ADDR_TYPES: + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_2) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step("Redistribute static for vrfs RED_A and RED_B and BLUE_A and BLUE_B") + + input_dict_3 = {} + for dut in ["red1", "blue1"]: + temp = {dut: {"bgp": []}} + input_dict_3.update(temp) + + if "red" in dut: + VRFS = ["RED_A", "RED_B"] + AS_NUM = [500, 500] + elif "blue" in dut: + VRFS = ["BLUE_A", "BLUE_B"] + AS_NUM = [800, 800] + + for vrf, as_num in zip(VRFS, AS_NUM): + temp[dut]["bgp"].append( + { + "local_as": as_num, + "vrf": vrf, + "address_family": { + "ipv4": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + "ipv6": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + }, + } + ) + + result = create_router_bgp(tgen, topo, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Verifying RIB and FIB before deleting VRFs") + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + step("Api call to modfiy BGP timers") + + input_dict_4 = { + "r1": { + "bgp": [ + { + "local_as": "100", + "vrf": "RED_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "100", + "vrf": "RED_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "100", + "vrf": "BLUE_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link3": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link3": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "100", + "vrf": "BLUE_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link4": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r2": { + "dest_link": { + "r1-link4": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + ] + } + } + + result = create_router_bgp(tgen, topo, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + clear_bgp(tgen, addr_type, "r1", vrf=["RED_A", "RED_B", "BLUE_A", "BLUE_B"]) + + step("Delete vrfs RED_A and BLUE_A from R1.") + + input_dict = { + "r1": { + "vrfs": [ + {"name": "RED_A", "id": "1", "delete": True}, + {"name": "BLUE_A", "id": "3", "delete": True}, + ] + } + } + + result = create_vrf_cfg(tgen, input_dict) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + step( + "R2 must not receive the prefixes(in respective vrfs)" + "originated from RED_1 and BLUE_1." + ) + + step("Wait for {}+1 sec..".format(HOLDDOWNTIMER)) + sleep(HOLDDOWNTIMER + 1) + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_2 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + } + ] + }, + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + } + ] + }, + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2, expected=False) + assert result is not True, ( + "Testcase {} :Failed \n Expected Behaviour:" + " Routes are not present \n Error {}".format(tc_name, result) + ) + + result = verify_rib(tgen, addr_type, dut, input_dict_2, expected=False) + assert result is not True, ( + "Testcase {} :Failed \n Expected Behaviour:" + " Routes are not present \n Error {}".format(tc_name, result) + ) + + step("Add vrfs again RED_A and BLUE_A on R1.") + + result = create_vrf_cfg(tgen, {"r1": topo["routers"]["r1"]}) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + create_interfaces_cfg(tgen, {"r1": topo["routers"]["r1"]}) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + step( + "After deleting VRFs ipv6 addresses will be deleted from kernel " + " Adding back ipv6 addresses" + ) + + dut = "r1" + vrfs = ["RED_A", "BLUE_A"] + + for vrf in vrfs: + for c_link, c_data in topo["routers"][dut]["links"].items(): + if c_data["vrf"] != vrf: + continue + + intf_name = c_data["interface"] + intf_ipv6 = c_data["ipv6"] + + create_interface_in_kernel( + tgen, dut, intf_name, intf_ipv6, vrf, create=False + ) + + step( + "R2 should now receive the prefixes(in respective vrfs)" + "again. Check the debugging logs as well. For verification" + " use same commands as mention in step-3." + ) + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_2 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + } + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + dut = "r2" + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + } + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + write_test_footer(tc_name) + + +def test_vrf_name_significance_p1(request): + """ + CHAOS_4: + Verify that VRF names are locally significant + to a router, and end to end connectivity depends on unique + virtual circuits (using VLANs or separate physical interfaces). + """ + + tgen = get_topogen() + tc_name = request.node.name + write_test_header(tc_name) + reset_config_on_routers(tgen) + + if tgen.routers_have_failure(): + check_router_status(tgen) + + step( + "Advertise unique prefixes in BGP using static redistribution" + "for both vrfs (RED_A and RED_B) on router RED_1" + ) + + for addr_type in ADDR_TYPES: + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_1) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step( + "Advertise unique prefixes in BGP using static redistribution" + " for both vrfs (BLUE_A and BLUE_B) on router BLUE_1." + ) + + for addr_type in ADDR_TYPES: + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_2) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step("Redistribute static for vrfs RED_A and RED_B and BLUE_A and BLUE_B") + + input_dict_3 = {} + for dut in ["red1", "blue1"]: + temp = {dut: {"bgp": []}} + input_dict_3.update(temp) + + if "red" in dut: + VRFS = ["RED_A", "RED_B"] + AS_NUM = [500, 500] + elif "blue" in dut: + VRFS = ["BLUE_A", "BLUE_B"] + AS_NUM = [800, 800] + + for vrf, as_num in zip(VRFS, AS_NUM): + temp[dut]["bgp"].append( + { + "local_as": as_num, + "vrf": vrf, + "address_family": { + "ipv4": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + "ipv6": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + }, + } + ) + + result = create_router_bgp(tgen, topo, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Configure allowas-in on red2 and blue2") + + input_dict_4 = { + "red2": { + "bgp": [ + { + "local_as": "500", + "vrf": "RED_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link1": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link1": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + }, + }, + { + "local_as": "500", + "vrf": "RED_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link2": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link2": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + }, + }, + ] + }, + "blue2": { + "bgp": [ + { + "local_as": "800", + "vrf": "BLUE_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link1": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link1": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + }, + }, + { + "local_as": "800", + "vrf": "BLUE_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link2": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link2": { + "allowas-in": {"number_occurences": 2} + } + } + } + } + } + }, + }, + }, + ] + }, + } + + result = create_router_bgp(tgen, topo, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Verifying RIB and FIB before deleting VRFs") + + for addr_type in ADDR_TYPES: + dut = "red2" + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + } + ] + } + } + input_dict_2 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + } + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + dut = "blue2" + input_dict_3 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + } + ] + } + } + + input_dict_4 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + } + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + step("Api call to modfiy BGP timers") + + input_dict_4 = { + "r3": { + "bgp": [ + { + "local_as": "200", + "vrf": "RED_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "200", + "vrf": "RED_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "200", + "vrf": "BLUE_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "200", + "vrf": "BLUE_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + ] + }, + "red2": { + "bgp": [ + { + "local_as": "500", + "vrf": "RED_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "500", + "vrf": "RED_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "red2-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + ] + }, + "blue2": { + "bgp": [ + { + "local_as": "800", + "vrf": "BLUE_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "800", + "vrf": "BLUE_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "r3": { + "dest_link": { + "blue2-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + ] + }, + } + + result = create_router_bgp(tgen, topo, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + clear_bgp(tgen, addr_type, "r3", vrf=["RED_A", "RED_B", "BLUE_A", "BLUE_B"]) + + clear_bgp(tgen, addr_type, "red2", vrf=["RED_A", "RED_B"]) + + clear_bgp(tgen, addr_type, "blue2", vrf=["BLUE_A", "BLUE_B"]) + + step("Delete vrfs RED_A and BLUE_A from R3") + + input_dict = { + "r3": { + "vrfs": [ + {"name": "RED_A", "id": "1", "delete": True}, + {"name": "BLUE_A", "id": "3", "delete": True}, + ] + } + } + + result = create_vrf_cfg(tgen, input_dict) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + step("Waiting for {}+1..".format(HOLDDOWNTIMER)) + sleep(HOLDDOWNTIMER + 1) + + step("Verify RIB and FIB after deleting VRFs") + + for addr_type in ADDR_TYPES: + dut = "red2" + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + } + ] + } + } + + result = verify_rib(tgen, addr_type, dut, input_dict_1, expected=False) + assert ( + result is not True + ), "Testcase {} :Failed \n Expected Behaviour: Routes are not" + " present \n Error {}".format(tc_name, result) + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_1, expected=False) + assert ( + result is not True + ), "Testcase {} :Failed \n Expected Behaviour: Routes are not" + " present \n Error {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + dut = "blue2" + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + } + ] + } + } + + result = verify_rib(tgen, addr_type, dut, input_dict_2, expected=False) + assert result is not True, ( + "Testcase {} :Failed \n Expected Behaviour: Routes are not" + " present \n Error {}".format(tc_name, result) + ) + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2, expected=False) + assert result is not True, ( + "Testcase {} :Failed \n Expected Behaviour: Routes are not" + " present \n Error {}".format(tc_name, result) + ) + + step("Create 2 new VRFs PINK_A and GREY_A IN R3") + + topo_modify = deepcopy(topo) + topo_modify["routers"]["r3"]["vrfs"][0]["name"] = "PINK_A" + topo_modify["routers"]["r3"]["vrfs"][0]["id"] = "1" + topo_modify["routers"]["r3"]["vrfs"][2]["name"] = "GREY_A" + topo_modify["routers"]["r3"]["vrfs"][2]["id"] = "3" + + topo_modify["routers"]["r3"]["links"]["red2-link1"]["vrf"] = "PINK_A" + topo_modify["routers"]["r3"]["links"]["blue2-link1"]["vrf"] = "GREY_A" + + topo_modify["routers"]["r3"]["links"]["r2-link1"]["vrf"] = "PINK_A" + topo_modify["routers"]["r3"]["links"]["r2-link3"]["vrf"] = "GREY_A" + + topo_modify["routers"]["r3"]["links"]["r4-link1"]["vrf"] = "PINK_A" + topo_modify["routers"]["r3"]["links"]["r4-link3"]["vrf"] = "GREY_A" + + topo_modify["routers"]["r3"]["bgp"][0]["vrf"] = "PINK_A" + topo_modify["routers"]["r3"]["bgp"][2]["vrf"] = "GREY_A" + + result = create_vrf_cfg(tgen, {"r3": topo_modify["routers"]["r3"]}) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + create_interfaces_cfg(tgen, {"r3": topo_modify["routers"]["r3"]}) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = create_router_bgp(tgen, topo_modify["routers"]) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Api call to modfiy BGP timers") + + input_dict_4 = { + "r3": { + "bgp": [ + { + "local_as": "200", + "vrf": "PINK_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "200", + "vrf": "RED_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "red2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "200", + "vrf": "GREY_A", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link1": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + { + "local_as": "200", + "vrf": "BLUE_B", + "address_family": { + "ipv4": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + "ipv6": { + "unicast": { + "neighbor": { + "blue2": { + "dest_link": { + "r3-link2": { + "keepalivetimer": KEEPALIVETIMER, + "holddowntimer": HOLDDOWNTIMER, + } + } + } + } + } + }, + }, + }, + ] + } + } + + result = create_router_bgp(tgen, topo_modify, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + clear_bgp(tgen, addr_type, "r3", vrf=["PINK_A", "RED_B", "GREY_A", "BLUE_B"]) + + step( + "After deleting VRFs ipv6 addresses will be deleted from kernel " + " Adding back ipv6 addresses" + ) + + dut = "r3" + vrfs = ["GREY_A", "PINK_A"] + + for vrf in vrfs: + for c_link, c_data in topo_modify["routers"][dut]["links"].items(): + if c_data["vrf"] != vrf: + continue + + intf_name = c_data["interface"] + intf_ipv6 = c_data["ipv6"] + + create_interface_in_kernel( + tgen, dut, intf_name, intf_ipv6, vrf, create=False + ) + + step("Waiting for {}+1 sec..".format(HOLDDOWNTIMER)) + sleep(HOLDDOWNTIMER + 1) + + step( + "Advertised prefixes should appear again in respective VRF" + " table on routers RED_2 and BLUE_2. Verify fib and rib entries" + ) + + for addr_type in ADDR_TYPES: + dut = "red2" + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + } + ] + } + } + + input_dict_2 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + } + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + for addr_type in ADDR_TYPES: + dut = "blue2" + input_dict_3 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK3_1[addr_type]] + [NETWORK3_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + } + ] + } + } + + input_dict_4 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK4_1[addr_type]] + [NETWORK4_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + } + ] + } + } + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_4) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + write_test_footer(tc_name) + + +def test_restart_frr_services_p1(request): + """ + CHAOS_8: + Restart all FRR services (reboot DUT) to check if all + the routes in respective vrfs are reinstalled. + """ + + tgen = get_topogen() + tc_name = request.node.name + write_test_header(tc_name) + reset_config_on_routers(tgen) + + if tgen.routers_have_failure(): + check_router_status(tgen) + + step( + "Advertise unique BGP prefixes(IPv4+IPv6) from RED_1" + " in vrf instances(RED_A and RED_B)." + ) + + for addr_type in ADDR_TYPES: + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_1) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step( + "Advertise unique BGP prefixes(IPv4+IPv6) from BLUE_1 in" + " vrf instances(BLUE_A and BLUE_B)." + ) + + for addr_type in ADDR_TYPES: + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + result = create_static_routes(tgen, input_dict_2) + assert result is True, "Testcase {} : Failed \n Error: {}".format( + tc_name, result + ) + + step("Redistribute static..") + + input_dict_3 = {} + for dut in ["red1", "blue1"]: + temp = {dut: {"bgp": []}} + input_dict_3.update(temp) + + if "red" in dut: + VRFS = ["RED_A", "RED_B"] + AS_NUM = [500, 500] + elif "blue" in dut: + VRFS = ["BLUE_A", "BLUE_B"] + AS_NUM = [800, 800] + + for vrf, as_num in zip(VRFS, AS_NUM): + temp[dut]["bgp"].append( + { + "local_as": as_num, + "vrf": vrf, + "address_family": { + "ipv4": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + "ipv6": { + "unicast": {"redistribute": [{"redist_type": "static"}]} + }, + }, + } + ) + + result = create_router_bgp(tgen, topo, input_dict_3) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Restart frr on R1") + stop_router(tgen, "r1") + start_router(tgen, "r1") + + for addr_type in ADDR_TYPES: + dut = "r2" + + input_dict_1 = { + "red1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "RED_B", + }, + ] + } + } + + input_dict_2 = { + "blue1": { + "static_routes": [ + { + "network": [NETWORK1_1[addr_type]] + [NETWORK1_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_A", + }, + { + "network": [NETWORK2_1[addr_type]] + [NETWORK2_2[addr_type]], + "next_hop": NEXT_HOP_IP[addr_type], + "vrf": "BLUE_B", + }, + ] + } + } + + result = verify_rib(tgen, addr_type, dut, input_dict_1) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + result = verify_rib(tgen, addr_type, dut, input_dict_2) + assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result) + + write_test_footer(tc_name) + + if __name__ == "__main__": args = ["-s"] + sys.argv[1:] sys.exit(pytest.main(args)) diff --git a/tests/topotests/bgp_multiview_topo1/test_bgp_multiview_topo1.py b/tests/topotests/bgp_multiview_topo1/test_bgp_multiview_topo1.py index 6344f7bb40..7635f74125 100644 --- a/tests/topotests/bgp_multiview_topo1/test_bgp_multiview_topo1.py +++ b/tests/topotests/bgp_multiview_topo1/test_bgp_multiview_topo1.py @@ -332,7 +332,7 @@ def test_bgp_routingTable(): if not success: resultstr = "No template matched.\n" - for f in diffresult.iterkeys(): + for f in diffresult.keys(): resultstr += ( "template %s: r%s failed Routing Table Check for view %s:\n%s\n" % (f, i, view, diffresult[f]) diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py index f4b4da55d2..bc47dfc85c 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand holddownFactorSet = luCommand( "r1", diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py index 9fdef84cdf..e68fac86fa 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand holddownFactorSet = luCommand( "r1", diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py index 1caa827ce2..24b3cba96e 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand("r1", 'vtysh -c "show bgp ipv4 vpn"', "", "none", "VPN SAFI") luCommand("r2", 'vtysh -c "show bgp ipv4 vpn"', "", "none", "VPN SAFI") diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py index e68e9e93ab..f5c2db25ff 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand holddownFactorSet = luCommand( "r1", diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py index eea977bfaf..7201ac8111 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py @@ -1,4 +1,4 @@ -from lutil import luCommand +from lib.lutil import luCommand luCommand( "r1", diff --git a/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref index 387d3b43d7..b7d52cecca 100644 --- a/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref @@ -134,27 +134,6 @@ ] } ], - "10.0.2.0\/24":[ - { - "prefix":"10.0.2.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.2.4", - "afi":"ipv4", - "interfaceName":"eth-rt4-1" - }, - { - "ip":"10.0.3.4", - "afi":"ipv4", - "interfaceName":"eth-rt4-2", - "active":true - } - ] - } - ], "10.0.3.0\/24":[ { "prefix":"10.0.3.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref index 4dc0dd7cac..f2a54bf958 100644 --- a/tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref @@ -278,21 +278,6 @@ ] } ], - "10.0.7.0\/24":[ - { - "prefix":"10.0.7.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.7.6", - "afi":"ipv4", - "interfaceName":"eth-rt6" - } - ] - } - ], "10.0.8.0\/24":[ { "prefix":"10.0.8.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref index 620f5eac67..29f4782482 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref @@ -274,21 +274,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref index 19cdf9d896..dc61b86410 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref @@ -281,21 +281,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref index 48b5e6491e..2d983c43b6 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref @@ -254,21 +254,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref index 156beef0f1..0a64db60f6 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref @@ -281,21 +281,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref index dba5e8d8a2..88485477e3 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref @@ -275,21 +275,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref index 156beef0f1..0a64db60f6 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref @@ -281,21 +281,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref index ece747bdac..769bc4d31e 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref @@ -275,21 +275,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref index 156beef0f1..0a64db60f6 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref @@ -281,21 +281,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref index 90588c6708..34cbf68b21 100644 --- a/tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref +++ b/tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref @@ -281,21 +281,6 @@ ] } ], - "10.0.6.0\/24":[ - { - "prefix":"10.0.6.0\/24", - "protocol":"isis", - "distance":115, - "metric":20, - "nexthops":[ - { - "ip":"10.0.6.4", - "afi":"ipv4", - "interfaceName":"eth-rt4" - } - ] - } - ], "10.0.7.0\/24":[ { "prefix":"10.0.7.0\/24", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step1/show_mpls_table.ref b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_mpls_table.ref index e3ed7c20b2..aa0357d750 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step1/show_mpls_table.ref +++ b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_mpls_table.ref @@ -103,13 +103,13 @@ "type":"SR (IS-IS)", "outLabel":16060, "installed":true, - "nexthop":"10.0.1.2" + "nexthop":"10.0.1.3" }, { "type":"SR (IS-IS)", "outLabel":16060, "installed":true, - "nexthop":"10.0.1.3" + "nexthop":"10.0.1.2" } ] }, diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ip_route.ref.diff index 1a9307ddb9..10b336f5b8 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step3/show_ip_route.ref 2020-09-25 17:48:05.062911204 -0300 -+++ rt1/step4/show_ip_route.ref 2020-09-25 17:49:01.563647190 -0300 +--- a/rt1/step3/show_ip_route.ref ++++ b/rt1/step4/show_ip_route.ref @@ -60,10 +60,7 @@ "ip":"10.0.1.2", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ipv6_route.ref.diff index f5036aeda8..904aaa1ce2 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step3/show_ipv6_route.ref 2020-09-25 17:48:06.358928078 -0300 -+++ rt1/step4/show_ipv6_route.ref 2020-09-25 17:49:02.791663194 -0300 +--- a/rt1/step3/show_ipv6_route.ref ++++ b/rt1/step4/show_ipv6_route.ref @@ -57,10 +57,7 @@ "fib":true, "afi":"ipv6", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step4/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_mpls_table.ref.diff index 30c612b544..d7d8753131 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step4/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step3/show_mpls_table.ref 2020-09-25 17:48:03.782894539 -0300 -+++ rt1/step4/show_mpls_table.ref 2020-09-25 17:49:00.343631290 -0300 +--- a/rt1/step3/show_mpls_table.ref ++++ b/rt1/step4/show_mpls_table.ref @@ -47,30 +47,6 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ip_route.ref.diff index 79a452ef69..b583fa97bd 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step4/show_ip_route.ref 2020-09-25 17:49:01.563647190 -0300 -+++ rt1/step5/show_ip_route.ref 2020-09-25 17:50:12.144567593 -0300 +--- a/rt1/step4/show_ip_route.ref ++++ b/rt1/step5/show_ip_route.ref @@ -60,7 +60,10 @@ "ip":"10.0.1.2", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ipv6_route.ref.diff index 805266aaaa..d608abec98 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step4/show_ipv6_route.ref 2020-09-25 17:49:02.791663194 -0300 -+++ rt1/step5/show_ipv6_route.ref 2020-09-25 17:50:13.428584346 -0300 +--- a/rt1/step4/show_ipv6_route.ref ++++ b/rt1/step5/show_ipv6_route.ref @@ -57,7 +57,10 @@ "fib":true, "afi":"ipv6", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step5/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_mpls_table.ref.diff index d7ab66ee18..b5161fcd55 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step5/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step4/show_mpls_table.ref 2020-09-25 17:49:00.343631290 -0300 -+++ rt1/step5/show_mpls_table.ref 2020-09-25 17:50:10.868550944 -0300 +--- a/rt1/step4/show_mpls_table.ref ++++ b/rt1/step5/show_mpls_table.ref @@ -47,6 +47,30 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ip_route.ref.diff index 9aa0cd2e39..726aed514f 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step6/show_ip_route.ref 2020-09-25 17:51:15.105389461 -0300 -+++ rt1/step7/show_ip_route.ref 2020-09-25 17:52:02.014002243 -0300 +--- a/rt1/step6/show_ip_route.ref ++++ b/rt1/step7/show_ip_route.ref @@ -83,10 +83,7 @@ "ip":"10.0.1.3", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ipv6_route.ref.diff index 52fd7caf91..2049f6fa19 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step6/show_ipv6_route.ref 2020-09-25 17:51:16.345405655 -0300 -+++ rt1/step7/show_ipv6_route.ref 2020-09-25 17:52:03.230018133 -0300 +--- a/rt1/step6/show_ipv6_route.ref ++++ b/rt1/step7/show_ipv6_route.ref @@ -79,10 +79,7 @@ "fib":true, "afi":"ipv6", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step7/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_mpls_table.ref.diff index 53332be569..22301ba1ff 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step7/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step6/show_mpls_table.ref 2020-09-25 17:51:13.861373215 -0300 -+++ rt1/step7/show_mpls_table.ref 2020-09-25 17:52:00.769985988 -0300 +--- a/rt1/step6/show_mpls_table.ref ++++ b/rt1/step7/show_mpls_table.ref @@ -71,30 +71,6 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ip_route.ref.diff index af9f72e718..4a1d4805a4 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step7/show_ip_route.ref 2020-09-25 17:52:02.014002243 -0300 -+++ rt1/step8/show_ip_route.ref 2020-09-25 17:53:20.003021800 -0300 +--- a/rt1/step7/show_ip_route.ref ++++ b/rt1/step8/show_ip_route.ref @@ -83,7 +83,10 @@ "ip":"10.0.1.3", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ipv6_route.ref.diff index b733b33ed9..eaece74e48 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step7/show_ipv6_route.ref 2020-09-25 17:52:03.230018133 -0300 -+++ rt1/step8/show_ipv6_route.ref 2020-09-25 17:53:21.239037966 -0300 +--- a/rt1/step7/show_ipv6_route.ref ++++ b/rt1/step8/show_ipv6_route.ref @@ -79,7 +79,10 @@ "fib":true, "afi":"ipv6", diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step8/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_mpls_table.ref.diff index b6f8c962f0..46c17de019 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step8/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step7/show_mpls_table.ref 2020-09-25 17:52:00.769985988 -0300 -+++ rt1/step8/show_mpls_table.ref 2020-09-25 17:53:18.671004379 -0300 +--- a/rt1/step7/show_mpls_table.ref ++++ b/rt1/step8/show_mpls_table.ref @@ -71,6 +71,30 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ip_route.ref.diff index 1d96341557..06efdc96ce 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step8/show_ip_route.ref 2020-09-25 17:53:20.003021800 -0300 -+++ rt1/step9/show_ip_route.ref 2020-09-25 17:54:37.700038367 -0300 +--- a/rt1/step8/show_ip_route.ref ++++ b/rt1/step9/show_ip_route.ref @@ -85,7 +85,7 @@ "interfaceName":"eth-sw1", "active":true, diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ipv6_route.ref.diff index 232b823ac2..a58f2d447c 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step8/show_ipv6_route.ref 2020-09-25 17:53:21.239037966 -0300 -+++ rt1/step9/show_ipv6_route.ref 2020-09-25 17:54:38.912054230 -0300 +--- a/rt1/step8/show_ipv6_route.ref ++++ b/rt1/step9/show_ipv6_route.ref @@ -81,7 +81,7 @@ "interfaceName":"eth-sw1", "active":true, diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step9/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_mpls_table.ref.diff index 7f0d50f5f2..c0a1ac592b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt1/step9/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt1/step8/show_mpls_table.ref 2020-09-25 17:53:18.671004379 -0300 -+++ rt1/step9/show_mpls_table.ref 2020-09-25 17:54:36.428021718 -0300 +--- a/rt1/step8/show_mpls_table.ref ++++ b/rt1/step9/show_mpls_table.ref @@ -71,30 +71,6 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ip_route.ref b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ip_route.ref index 23e07b7cda..7e1ccd10a2 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ip_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ip_route.ref @@ -233,7 +233,10 @@ "ip":"10.0.1.3", "afi":"ipv4", "interfaceName":"eth-sw1", - "active":true + "active":true, + "labels":[ + 16060 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ipv6_route.ref b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ipv6_route.ref index d9bd04ef30..6d31f6f26b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ipv6_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ipv6_route.ref @@ -104,7 +104,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-rt4-1", "active":true, "backupIndex":[ 0 @@ -116,7 +116,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", "active":true, "backupIndex":[ 0 @@ -152,7 +152,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt4-1", "active":true, "labels":[ 16051 @@ -161,7 +161,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-sw1", "active":true, "labels":[ 16051 @@ -170,7 +170,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", "active":true, "labels":[ 16051 @@ -192,7 +192,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-rt4-1", "active":true, "backupIndex":[ 0 @@ -204,7 +204,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", "active":true, "backupIndex":[ 0 @@ -218,7 +218,10 @@ { "afi":"ipv6", "interfaceName":"eth-sw1", - "active":true + "active":true, + "labels":[ + 16061 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_mpls_table.ref b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_mpls_table.ref index cd2f879593..b9b906a31d 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_mpls_table.ref +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_mpls_table.ref @@ -247,7 +247,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16060, "nexthop":"10.0.1.3" } ] @@ -278,7 +278,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16061, "interface":"eth-sw1" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ip_route.ref.diff index 22b896f684..90e0895639 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step1/show_ip_route.ref 2020-09-25 17:46:27.537642781 -0300 -+++ rt2/step2/show_ip_route.ref 2020-09-25 17:46:57.306029668 -0300 +--- a/rt2/step1/show_ip_route.ref ++++ b/rt2/step2/show_ip_route.ref @@ -15,36 +15,10 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -74,7 +74,7 @@ ] } ], -@@ -248,40 +196,12 @@ +@@ -251,40 +199,12 @@ { "ip":"10.0.1.1", "afi":"ipv4", @@ -117,7 +117,7 @@ } ] } -@@ -377,24 +297,6 @@ +@@ -380,24 +300,6 @@ "ip":"10.0.1.3", "afi":"ipv4", "interfaceName":"eth-sw1", @@ -142,7 +142,7 @@ "active":true } ] -@@ -415,24 +317,6 @@ +@@ -418,24 +320,6 @@ "ip":"10.0.1.3", "afi":"ipv4", "interfaceName":"eth-sw1", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ipv6_route.ref.diff index 08c7d2b1fc..2d19f20f63 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step1/show_ipv6_route.ref 2020-09-25 17:46:28.865660035 -0300 -+++ rt2/step2/show_ipv6_route.ref 2020-09-25 17:46:58.514045373 -0300 +--- a/rt2/step1/show_ipv6_route.ref ++++ b/rt2/step2/show_ipv6_route.ref @@ -14,34 +14,10 @@ "afi":"ipv6", "interfaceName":"eth-sw1", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step2/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_mpls_table.ref.diff index 4feb927156..01fc74a60b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step2/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step1/show_mpls_table.ref 2020-09-25 17:46:26.261626203 -0300 -+++ rt2/step2/show_mpls_table.ref 2020-09-25 17:46:56.086013807 -0300 +--- a/rt2/step1/show_mpls_table.ref ++++ b/rt2/step2/show_mpls_table.ref @@ -7,23 +7,7 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ip_route.ref.diff index af1cebc76d..d93f036229 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step2/show_ip_route.ref 2020-09-25 17:46:57.306029668 -0300 -+++ rt2/step3/show_ip_route.ref 2020-09-25 17:48:05.274913964 -0300 +--- a/rt2/step2/show_ip_route.ref ++++ b/rt2/step3/show_ip_route.ref @@ -15,10 +15,36 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -74,7 +74,7 @@ ] } ], -@@ -196,12 +248,40 @@ +@@ -199,12 +251,40 @@ { "ip":"10.0.1.1", "afi":"ipv4", @@ -117,7 +117,7 @@ } ] } -@@ -297,6 +377,24 @@ +@@ -300,6 +380,24 @@ "ip":"10.0.1.3", "afi":"ipv4", "interfaceName":"eth-sw1", @@ -142,7 +142,7 @@ "active":true } ] -@@ -317,6 +415,24 @@ +@@ -320,6 +418,24 @@ "ip":"10.0.1.3", "afi":"ipv4", "interfaceName":"eth-sw1", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ipv6_route.ref.diff index 9809c316e8..68b618e91d 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step2/show_ipv6_route.ref 2020-09-25 17:46:58.514045373 -0300 -+++ rt2/step3/show_ipv6_route.ref 2020-09-25 17:48:06.570930838 -0300 +--- a/rt2/step2/show_ipv6_route.ref ++++ b/rt2/step3/show_ipv6_route.ref @@ -14,10 +14,34 @@ "afi":"ipv6", "interfaceName":"eth-sw1", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step3/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_mpls_table.ref.diff index 180323e4c8..966e153a6b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step3/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step2/show_mpls_table.ref 2020-09-25 17:46:56.086013807 -0300 -+++ rt2/step3/show_mpls_table.ref 2020-09-25 17:48:03.994897300 -0300 +--- a/rt2/step2/show_mpls_table.ref ++++ b/rt2/step3/show_mpls_table.ref @@ -7,7 +7,23 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ip_route.ref.diff index 12d45bbe07..dd75d76b9b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step3/show_ip_route.ref 2020-09-25 17:48:05.274913964 -0300 -+++ rt2/step4/show_ip_route.ref 2020-09-25 17:49:01.763649797 -0300 +--- a/rt2/step3/show_ip_route.ref ++++ b/rt2/step4/show_ip_route.ref @@ -15,36 +15,10 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -147,7 +147,7 @@ ] } ], -@@ -248,40 +177,12 @@ +@@ -251,40 +180,12 @@ { "ip":"10.0.1.1", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ipv6_route.ref.diff index fdf658d59d..63731237ec 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step3/show_ipv6_route.ref 2020-09-25 17:48:06.570930838 -0300 -+++ rt2/step4/show_ipv6_route.ref 2020-09-25 17:49:02.995665853 -0300 +--- a/rt2/step3/show_ipv6_route.ref ++++ b/rt2/step4/show_ipv6_route.ref @@ -14,34 +14,10 @@ "afi":"ipv6", "interfaceName":"eth-sw1", @@ -100,10 +100,10 @@ ] } ] -@@ -162,19 +107,13 @@ +@@ -153,10 +98,7 @@ "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-rt4-1", - "active":true, - "labels":[ - 16051 @@ -112,8 +112,10 @@ }, { "fib":true, +@@ -171,10 +113,7 @@ + "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", - "active":true, - "labels":[ - 16051 diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step4/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_mpls_table.ref.diff index a78f79c576..3872ce4980 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step4/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step3/show_mpls_table.ref 2020-09-25 17:48:03.994897300 -0300 -+++ rt2/step4/show_mpls_table.ref 2020-09-25 17:49:00.551634001 -0300 +--- a/rt2/step3/show_mpls_table.ref ++++ b/rt2/step4/show_mpls_table.ref @@ -7,23 +7,7 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ip_route.ref.diff index 7d20fad3f4..4d5636436c 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step4/show_ip_route.ref 2020-09-25 17:49:01.763649797 -0300 -+++ rt2/step5/show_ip_route.ref 2020-09-25 17:50:12.360570411 -0300 +--- a/rt2/step4/show_ip_route.ref ++++ b/rt2/step5/show_ip_route.ref @@ -15,10 +15,36 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -147,7 +147,7 @@ ] } ], -@@ -177,12 +248,40 @@ +@@ -180,12 +251,40 @@ { "ip":"10.0.1.1", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ipv6_route.ref.diff index 9330964338..f9e0276f85 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step4/show_ipv6_route.ref 2020-09-25 17:49:02.995665853 -0300 -+++ rt2/step5/show_ipv6_route.ref 2020-09-25 17:50:13.636587060 -0300 +--- a/rt2/step4/show_ipv6_route.ref ++++ b/rt2/step5/show_ipv6_route.ref @@ -14,10 +14,34 @@ "afi":"ipv6", "interfaceName":"eth-sw1", @@ -100,10 +100,10 @@ ] } ] -@@ -107,13 +162,19 @@ +@@ -98,7 +153,10 @@ "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-rt4-1", - "active":true + "active":true, + "labels":[ @@ -112,8 +112,10 @@ }, { "fib":true, +@@ -113,7 +171,10 @@ + "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", - "active":true + "active":true, + "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step5/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_mpls_table.ref.diff index b1e44a727f..6aebbd6c82 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step5/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step4/show_mpls_table.ref 2020-09-25 17:49:00.551634001 -0300 -+++ rt2/step5/show_mpls_table.ref 2020-09-25 17:50:11.068553553 -0300 +--- a/rt2/step4/show_mpls_table.ref ++++ b/rt2/step5/show_mpls_table.ref @@ -7,7 +7,23 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ip_route.ref.diff index c92195d704..5e73b97844 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step6/show_ip_route.ref 2020-09-25 17:51:15.313392177 -0300 -+++ rt2/step7/show_ip_route.ref 2020-09-25 17:52:02.210004805 -0300 +--- a/rt2/step6/show_ip_route.ref ++++ b/rt2/step7/show_ip_route.ref @@ -15,36 +15,10 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -144,7 +144,7 @@ } ] } -@@ -248,40 +169,12 @@ +@@ -251,40 +172,12 @@ { "ip":"10.0.1.1", "afi":"ipv4", @@ -187,7 +187,7 @@ } ] } -@@ -296,30 +189,13 @@ +@@ -299,30 +192,13 @@ { "ip":"10.0.2.4", "afi":"ipv4", @@ -220,7 +220,7 @@ } ] } -@@ -335,29 +211,12 @@ +@@ -338,29 +214,12 @@ "ip":"10.0.2.4", "afi":"ipv4", "interfaceName":"eth-rt4-1", @@ -252,7 +252,7 @@ } ] } -@@ -494,31 +353,14 @@ +@@ -497,31 +356,14 @@ "ip":"10.0.2.4", "afi":"ipv4", "interfaceName":"eth-rt4-1", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ipv6_route.ref.diff index 140c7b08bf..5dc4e59151 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step6/show_ipv6_route.ref 2020-09-25 17:51:16.549408319 -0300 -+++ rt2/step7/show_ipv6_route.ref 2020-09-25 17:52:03.438020851 -0300 +--- a/rt2/step6/show_ipv6_route.ref ++++ b/rt2/step7/show_ipv6_route.ref @@ -14,34 +14,10 @@ "afi":"ipv6", "interfaceName":"eth-sw1", @@ -72,7 +72,7 @@ ], @@ -106,9 +58,6 @@ "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-rt4-1", "active":true, - "backupIndex":[ - 0 @@ -82,7 +82,7 @@ ] @@ -118,24 +67,10 @@ "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", "active":true, - "backupIndex":[ - 0 @@ -108,7 +108,7 @@ @@ -153,28 +88,19 @@ "fib":true, "afi":"ipv6", - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt4-1", - "active":true, - "labels":[ - 16051 @@ -118,7 +118,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-sw1", - "active":true, - "labels":[ - 16051 @@ -128,7 +128,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", - "active":true, - "labels":[ - 16051 diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step7/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_mpls_table.ref.diff index f8476cd0bb..6c0d7392f0 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step7/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step6/show_mpls_table.ref 2020-09-25 17:51:14.073375985 -0300 -+++ rt2/step7/show_mpls_table.ref 2020-09-25 17:52:00.973988653 -0300 +--- a/rt2/step6/show_mpls_table.ref ++++ b/rt2/step7/show_mpls_table.ref @@ -7,23 +7,7 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ip_route.ref.diff index 7d5237e740..f5df607613 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step7/show_ip_route.ref 2020-09-25 17:52:02.210004805 -0300 -+++ rt2/step8/show_ip_route.ref 2020-09-25 17:53:20.207024469 -0300 +--- a/rt2/step7/show_ip_route.ref ++++ b/rt2/step8/show_ip_route.ref @@ -15,10 +15,36 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -144,7 +144,7 @@ } ] } -@@ -169,12 +248,40 @@ +@@ -172,12 +251,40 @@ { "ip":"10.0.1.1", "afi":"ipv4", @@ -187,7 +187,7 @@ } ] } -@@ -189,13 +296,30 @@ +@@ -192,13 +299,30 @@ { "ip":"10.0.2.4", "afi":"ipv4", @@ -220,7 +220,7 @@ } ] } -@@ -211,12 +335,29 @@ +@@ -214,12 +338,29 @@ "ip":"10.0.2.4", "afi":"ipv4", "interfaceName":"eth-rt4-1", @@ -252,7 +252,7 @@ } ] } -@@ -353,14 +494,31 @@ +@@ -356,14 +497,31 @@ "ip":"10.0.2.4", "afi":"ipv4", "interfaceName":"eth-rt4-1", diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ipv6_route.ref.diff index 45322214e6..125f36b1b4 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step7/show_ipv6_route.ref 2020-09-25 17:52:03.438020851 -0300 -+++ rt2/step8/show_ipv6_route.ref 2020-09-25 17:53:21.443040633 -0300 +--- a/rt2/step7/show_ipv6_route.ref ++++ b/rt2/step8/show_ipv6_route.ref @@ -14,10 +14,34 @@ "afi":"ipv6", "interfaceName":"eth-sw1", @@ -72,7 +72,7 @@ ], @@ -58,6 +106,9 @@ "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-rt4-1", "active":true, + "backupIndex":[ + 0 @@ -82,7 +82,7 @@ ] @@ -67,10 +118,24 @@ "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", "active":true, + "backupIndex":[ + 0 @@ -108,7 +108,7 @@ @@ -88,19 +153,28 @@ "fib":true, "afi":"ipv6", - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt4-1", - "active":true + "active":true, + "labels":[ @@ -118,7 +118,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-sw1", - "active":true + "active":true, + "labels":[ @@ -128,7 +128,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", - "active":true + "active":true, + "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step8/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_mpls_table.ref.diff index 083c647802..a1d5d795c5 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step8/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step7/show_mpls_table.ref 2020-09-25 17:52:00.973988653 -0300 -+++ rt2/step8/show_mpls_table.ref 2020-09-25 17:53:18.923007676 -0300 +--- a/rt2/step7/show_mpls_table.ref ++++ b/rt2/step8/show_mpls_table.ref @@ -7,7 +7,23 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ip_route.ref.diff index 15370a0a62..2475c639c1 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step8/show_ip_route.ref 2020-09-25 17:53:20.207024469 -0300 -+++ rt2/step9/show_ip_route.ref 2020-09-25 17:54:37.908041089 -0300 +--- a/rt2/step8/show_ip_route.ref ++++ b/rt2/step9/show_ip_route.ref @@ -31,7 +31,7 @@ "interfaceName":"eth-rt4-1", "active":true, @@ -72,7 +72,7 @@ ] } ] -@@ -271,7 +271,7 @@ +@@ -274,7 +274,7 @@ "interfaceName":"eth-rt4-1", "active":true, "labels":[ @@ -81,7 +81,7 @@ ] }, { -@@ -280,7 +280,7 @@ +@@ -283,7 +283,7 @@ "interfaceName":"eth-rt4-2", "active":true, "labels":[ @@ -90,7 +90,7 @@ ] } ] -@@ -318,7 +318,7 @@ +@@ -321,7 +321,7 @@ "interfaceName":"eth-sw1", "active":true, "labels":[ @@ -99,7 +99,7 @@ ] } ] -@@ -356,7 +356,7 @@ +@@ -359,7 +359,7 @@ "interfaceName":"eth-sw1", "active":true, "labels":[ @@ -108,7 +108,7 @@ ] } ] -@@ -517,7 +517,7 @@ +@@ -520,7 +520,7 @@ "interfaceName":"eth-sw1", "active":true, "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ipv6_route.ref.diff index 2585f32595..2d21fbcde2 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step8/show_ipv6_route.ref 2020-09-25 17:53:21.443040633 -0300 -+++ rt2/step9/show_ipv6_route.ref 2020-09-25 17:54:39.112056848 -0300 +--- a/rt2/step8/show_ipv6_route.ref ++++ b/rt2/step9/show_ipv6_route.ref @@ -29,7 +29,7 @@ "interfaceName":"eth-rt4-1", "active":true, @@ -46,7 +46,7 @@ ] } @@ -155,7 +155,7 @@ - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt4-1", "active":true, "labels":[ - 16051 @@ -55,7 +55,7 @@ }, { @@ -164,7 +164,7 @@ - "interfaceName":"eth-rt4-2", + "interfaceName":"eth-sw1", "active":true, "labels":[ - 16051 @@ -64,7 +64,7 @@ }, { @@ -173,7 +173,7 @@ - "interfaceName":"eth-rt4-1", + "interfaceName":"eth-rt4-2", "active":true, "labels":[ - 16051 diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step9/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_mpls_table.ref.diff index b90b889eba..bc0ec3157e 100644 --- a/tests/topotests/isis-tilfa-topo1/rt2/step9/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt2/step8/show_mpls_table.ref 2020-09-25 17:53:18.923007676 -0300 -+++ rt2/step9/show_mpls_table.ref 2020-09-25 17:54:36.640024493 -0300 +--- a/rt2/step8/show_mpls_table.ref ++++ b/rt2/step9/show_mpls_table.ref @@ -17,12 +17,12 @@ "backupNexthops":[ { diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ip_route.ref b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ip_route.ref index 8c37180daf..d70e9fe882 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ip_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ip_route.ref @@ -233,7 +233,10 @@ "ip":"10.0.1.2", "afi":"ipv4", "interfaceName":"eth-sw1", - "active":true + "active":true, + "labels":[ + 16060 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ipv6_route.ref b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ipv6_route.ref index 5ddb24af5a..058d33609b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ipv6_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ipv6_route.ref @@ -104,7 +104,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt5-1", "active":true, "labels":[ 16041 @@ -113,7 +113,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-sw1", "active":true, "labels":[ 16041 @@ -122,7 +122,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", "active":true, "labels":[ 16041 @@ -144,7 +144,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-rt5-1", "active":true, "backupIndex":[ 0 @@ -156,7 +156,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", "active":true, "backupIndex":[ 0 @@ -192,7 +192,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-rt5-1", "active":true, "backupIndex":[ 0 @@ -204,7 +204,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", "active":true, "backupIndex":[ 0 @@ -218,7 +218,10 @@ { "afi":"ipv6", "interfaceName":"eth-sw1", - "active":true + "active":true, + "labels":[ + 16061 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_mpls_table.ref b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_mpls_table.ref index f68d1f4244..1912df3f05 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_mpls_table.ref +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_mpls_table.ref @@ -247,7 +247,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16060, "nexthop":"10.0.1.2" } ] @@ -278,7 +278,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16061, "interface":"eth-sw1" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ip_route.ref.diff index 707f95495d..9ba73b057a 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step3/show_ip_route.ref 2020-09-25 17:48:05.506916984 -0300 -+++ rt3/step4/show_ip_route.ref 2020-09-25 17:49:01.963652403 -0300 +--- a/rt3/step3/show_ip_route.ref ++++ b/rt3/step4/show_ip_route.ref @@ -15,36 +15,10 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -144,7 +144,7 @@ ] } ], -@@ -248,40 +169,12 @@ +@@ -251,40 +172,12 @@ { "ip":"10.0.1.1", "afi":"ipv4", @@ -187,7 +187,7 @@ } ] } -@@ -372,30 +265,13 @@ +@@ -375,30 +268,13 @@ { "ip":"10.0.4.5", "afi":"ipv4", @@ -220,7 +220,7 @@ } ] } -@@ -411,29 +287,12 @@ +@@ -414,29 +290,12 @@ "ip":"10.0.4.5", "afi":"ipv4", "interfaceName":"eth-rt5-1", @@ -252,7 +252,7 @@ } ] } -@@ -528,31 +387,14 @@ +@@ -531,31 +390,14 @@ "ip":"10.0.4.5", "afi":"ipv4", "interfaceName":"eth-rt5-1", diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ipv6_route.ref.diff index 76d0ebc913..04f61c4eb4 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step3/show_ipv6_route.ref 2020-09-25 17:48:06.790933702 -0300 -+++ rt3/step4/show_ipv6_route.ref 2020-09-25 17:49:03.199668512 -0300 +--- a/rt3/step3/show_ipv6_route.ref ++++ b/rt3/step4/show_ipv6_route.ref @@ -14,34 +14,10 @@ "afi":"ipv6", "interfaceName":"eth-sw1", @@ -73,7 +73,7 @@ @@ -105,28 +57,19 @@ "fib":true, "afi":"ipv6", - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt5-1", - "active":true, - "labels":[ - 16041 @@ -83,7 +83,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-sw1", - "active":true, - "labels":[ - 16041 @@ -93,7 +93,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", - "active":true, - "labels":[ - 16041 @@ -104,7 +104,7 @@ } @@ -146,9 +89,6 @@ "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-rt5-1", "active":true, - "backupIndex":[ - 0 @@ -114,7 +114,7 @@ ] @@ -158,24 +98,10 @@ "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", "active":true, - "backupIndex":[ - 0 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step4/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_mpls_table.ref.diff index b888c9d273..b3588ca791 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step4/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step3/show_mpls_table.ref 2020-09-25 17:48:04.214900164 -0300 -+++ rt3/step4/show_mpls_table.ref 2020-09-25 17:49:00.759636711 -0300 +--- a/rt3/step3/show_mpls_table.ref ++++ b/rt3/step4/show_mpls_table.ref @@ -7,23 +7,7 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ip_route.ref.diff index 8eac75bec7..1af024fc2e 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step4/show_ip_route.ref 2020-09-25 17:49:01.963652403 -0300 -+++ rt3/step5/show_ip_route.ref 2020-09-25 17:50:12.592573438 -0300 +--- a/rt3/step4/show_ip_route.ref ++++ b/rt3/step5/show_ip_route.ref @@ -15,10 +15,36 @@ "afi":"ipv4", "interfaceName":"eth-sw1", @@ -144,7 +144,7 @@ ] } ], -@@ -169,12 +248,40 @@ +@@ -172,12 +251,40 @@ { "ip":"10.0.1.1", "afi":"ipv4", @@ -187,7 +187,7 @@ } ] } -@@ -265,13 +372,30 @@ +@@ -268,13 +375,30 @@ { "ip":"10.0.4.5", "afi":"ipv4", @@ -220,7 +220,7 @@ } ] } -@@ -287,12 +411,29 @@ +@@ -290,12 +414,29 @@ "ip":"10.0.4.5", "afi":"ipv4", "interfaceName":"eth-rt5-1", @@ -252,7 +252,7 @@ } ] } -@@ -387,14 +528,31 @@ +@@ -390,14 +531,31 @@ "ip":"10.0.4.5", "afi":"ipv4", "interfaceName":"eth-rt5-1", diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ipv6_route.ref.diff index fc55267ad1..7cc79d0e58 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step4/show_ipv6_route.ref 2020-09-25 17:49:03.199668512 -0300 -+++ rt3/step5/show_ipv6_route.ref 2020-09-25 17:50:13.840589722 -0300 +--- a/rt3/step4/show_ipv6_route.ref ++++ b/rt3/step5/show_ipv6_route.ref @@ -14,10 +14,34 @@ "afi":"ipv6", "interfaceName":"eth-sw1", @@ -73,7 +73,7 @@ @@ -57,19 +105,28 @@ "fib":true, "afi":"ipv6", - "interfaceName":"eth-sw1", + "interfaceName":"eth-rt5-1", - "active":true + "active":true, + "labels":[ @@ -83,7 +83,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-sw1", - "active":true + "active":true, + "labels":[ @@ -93,7 +93,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", - "active":true + "active":true, + "labels":[ @@ -104,7 +104,7 @@ } @@ -89,6 +146,9 @@ "afi":"ipv6", - "interfaceName":"eth-rt5-2", + "interfaceName":"eth-rt5-1", "active":true, + "backupIndex":[ + 0 @@ -114,7 +114,7 @@ ] @@ -98,10 +158,24 @@ "afi":"ipv6", - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", "active":true, + "backupIndex":[ + 0 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step5/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_mpls_table.ref.diff index 4ed491e241..75a0f01f55 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step5/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step4/show_mpls_table.ref 2020-09-25 17:49:00.759636711 -0300 -+++ rt3/step5/show_mpls_table.ref 2020-09-25 17:50:11.280556320 -0300 +--- a/rt3/step4/show_mpls_table.ref ++++ b/rt3/step5/show_mpls_table.ref @@ -7,7 +7,23 @@ "type":"SR (IS-IS)", "outLabel":3, diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ip_route.ref.diff index 9273c75352..c814a2876b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step5/show_ip_route.ref 2020-09-25 17:50:12.592573438 -0300 -+++ rt3/step6/show_ip_route.ref 2020-09-25 17:51:15.521394894 -0300 +--- a/rt3/step5/show_ip_route.ref ++++ b/rt3/step6/show_ip_route.ref @@ -31,7 +31,7 @@ "interfaceName":"eth-rt5-1", "active":true, @@ -81,7 +81,7 @@ ] } ], -@@ -271,7 +271,7 @@ +@@ -274,7 +274,7 @@ "interfaceName":"eth-rt5-1", "active":true, "labels":[ @@ -90,7 +90,7 @@ ] }, { -@@ -280,7 +280,7 @@ +@@ -283,7 +283,7 @@ "interfaceName":"eth-rt5-2", "active":true, "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ipv6_route.ref.diff index f50be893e4..6f9405f20c 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step5/show_ipv6_route.ref 2020-09-25 17:50:13.840589722 -0300 -+++ rt3/step6/show_ipv6_route.ref 2020-09-25 17:51:16.757411035 -0300 +--- a/rt3/step5/show_ipv6_route.ref ++++ b/rt3/step6/show_ipv6_route.ref @@ -29,7 +29,7 @@ "interfaceName":"eth-rt5-1", "active":true, @@ -36,8 +36,8 @@ 16021 ] } -@@ -116,7 +116,7 @@ - "interfaceName":"eth-rt5-2", +@@ -107,7 +107,7 @@ + "interfaceName":"eth-rt5-1", "active":true, "labels":[ - 16041 @@ -46,7 +46,7 @@ }, { @@ -125,7 +125,7 @@ - "interfaceName":"eth-rt5-1", + "interfaceName":"eth-rt5-2", "active":true, "labels":[ - 16041 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step6/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_mpls_table.ref.diff index b63a728ef1..d8c39685de 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step6/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step5/show_mpls_table.ref 2020-09-25 17:50:11.280556320 -0300 -+++ rt3/step6/show_mpls_table.ref 2020-09-25 17:51:14.281378700 -0300 +--- a/rt3/step5/show_mpls_table.ref ++++ b/rt3/step6/show_mpls_table.ref @@ -17,12 +17,12 @@ "backupNexthops":[ { diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ip_route.ref.diff index 0ae87afa3b..c928fcdb4b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step6/show_ip_route.ref 2020-09-25 17:51:15.521394894 -0300 -+++ rt3/step7/show_ip_route.ref 2020-09-25 17:52:02.414007470 -0300 +--- a/rt3/step6/show_ip_route.ref ++++ b/rt3/step7/show_ip_route.ref @@ -158,9 +158,6 @@ "active":true, "backupIndex":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ipv6_route.ref.diff index f392f644c0..0170971781 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step6/show_ipv6_route.ref 2020-09-25 17:51:16.757411035 -0300 -+++ rt3/step7/show_ipv6_route.ref 2020-09-25 17:52:03.650023622 -0300 +--- a/rt3/step6/show_ipv6_route.ref ++++ b/rt3/step7/show_ipv6_route.ref @@ -148,9 +148,6 @@ "active":true, "backupIndex":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step7/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_mpls_table.ref.diff index b74eb9579c..d7a3ed978f 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step7/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step6/show_mpls_table.ref 2020-09-25 17:51:14.281378700 -0300 -+++ rt3/step7/show_mpls_table.ref 2020-09-25 17:52:01.181991371 -0300 +--- a/rt3/step6/show_mpls_table.ref ++++ b/rt3/step7/show_mpls_table.ref @@ -159,68 +159,6 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ip_route.ref.diff index 25b42f2825..41a7ff3255 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step7/show_ip_route.ref 2020-09-25 17:52:02.414007470 -0300 -+++ rt3/step8/show_ip_route.ref 2020-09-25 17:53:20.419027241 -0300 +--- a/rt3/step7/show_ip_route.ref ++++ b/rt3/step8/show_ip_route.ref @@ -158,6 +158,9 @@ "active":true, "backupIndex":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ipv6_route.ref.diff index 42d9356c8a..bd49f8606b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step7/show_ipv6_route.ref 2020-09-25 17:52:03.650023622 -0300 -+++ rt3/step8/show_ipv6_route.ref 2020-09-25 17:53:21.643043250 -0300 +--- a/rt3/step7/show_ipv6_route.ref ++++ b/rt3/step8/show_ipv6_route.ref @@ -148,6 +148,9 @@ "active":true, "backupIndex":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step8/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_mpls_table.ref.diff index bd40f954eb..4cc69b66f2 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step8/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step7/show_mpls_table.ref 2020-09-25 17:52:01.181991371 -0300 -+++ rt3/step8/show_mpls_table.ref 2020-09-25 17:53:19.135010448 -0300 +--- a/rt3/step7/show_mpls_table.ref ++++ b/rt3/step8/show_mpls_table.ref @@ -159,6 +159,68 @@ } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ip_route.ref.diff index 687e84ad40..cc0a482eee 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step8/show_ip_route.ref 2020-09-25 17:53:20.419027241 -0300 -+++ rt3/step9/show_ip_route.ref 2020-09-25 17:54:38.112043759 -0300 +--- a/rt3/step8/show_ip_route.ref ++++ b/rt3/step9/show_ip_route.ref @@ -185,7 +185,7 @@ "active":true, "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ipv6_route.ref.diff index 4b76be66ac..650b982f0b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_ipv6_route.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step8/show_ipv6_route.ref 2020-09-25 17:53:21.643043250 -0300 -+++ rt3/step9/show_ipv6_route.ref 2020-09-25 17:54:39.320059571 -0300 +--- a/rt3/step8/show_ipv6_route.ref ++++ b/rt3/step9/show_ipv6_route.ref @@ -173,7 +173,7 @@ "active":true, "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step9/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_mpls_table.ref.diff index 6f6451e510..8ce4f1d266 100644 --- a/tests/topotests/isis-tilfa-topo1/rt3/step9/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt3/step8/show_mpls_table.ref 2020-09-25 17:53:19.135010448 -0300 -+++ rt3/step9/show_mpls_table.ref 2020-09-25 17:54:36.852027268 -0300 +--- a/rt3/step8/show_mpls_table.ref ++++ b/rt3/step9/show_mpls_table.ref @@ -159,13 +159,13 @@ } ] @@ -31,7 +31,7 @@ { "type":"SR (IS-IS)", - "outLabel":16040, -+ "outLabel":3, ++ "outLabel":16060, "nexthop":"10.0.1.2" } ] @@ -63,7 +63,7 @@ { "type":"SR (IS-IS)", - "outLabel":16041, -+ "outLabel":3, ++ "outLabel":16061, "interface":"eth-sw1" } ] @@ -94,7 +94,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16060, + "outLabel":16040, "nexthop":"10.0.1.2" } @@ -126,7 +126,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16061, + "outLabel":16041, "interface":"eth-sw1" } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ip_route.ref b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ip_route.ref index 168b90a3f6..0ef5d1bc3f 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ip_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ip_route.ref @@ -41,7 +41,10 @@ "ip":"10.0.6.5", "afi":"ipv4", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16010 + ] } ] } @@ -169,7 +172,10 @@ "ip":"10.0.7.6", "afi":"ipv4", "interfaceName":"eth-rt6", - "active":true + "active":true, + "labels":[ + 16050 + ] } ] } @@ -203,7 +209,10 @@ "ip":"10.0.6.5", "afi":"ipv4", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16060 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ipv6_route.ref b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ipv6_route.ref index a4442ee089..b640df30c1 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ipv6_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ipv6_route.ref @@ -12,7 +12,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, "backupIndex":[ 0 @@ -24,7 +24,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt2-1", "active":true, "backupIndex":[ 0 @@ -38,7 +38,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16011 + ] } ] } @@ -56,7 +59,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, "backupIndex":[ 0 @@ -68,7 +71,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt2-1", "active":true, "backupIndex":[ 0 @@ -104,7 +107,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, "labels":[ 16031 @@ -113,7 +116,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5", + "interfaceName":"eth-rt2-1", "active":true, "labels":[ 16031 @@ -122,7 +125,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt5", "active":true, "labels":[ 16031 @@ -158,7 +161,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt6", - "active":true + "active":true, + "labels":[ + 16051 + ] } ] } @@ -190,7 +196,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16061 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_mpls_table.ref b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_mpls_table.ref index 18354e947d..f60937ccbc 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_mpls_table.ref +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_mpls_table.ref @@ -25,7 +25,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16010, "nexthop":"10.0.6.5" } ] @@ -56,7 +56,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16011, "interface":"eth-rt5" } ] @@ -188,7 +188,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16050, "nexthop":"10.0.7.6" } ] @@ -210,7 +210,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16051, "interface":"eth-rt6" } ] @@ -232,7 +232,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16060, "nexthop":"10.0.6.5" } ] @@ -254,7 +254,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16061, "interface":"eth-rt5" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ip_route.ref.diff index 7dcdb744ac..8b115c2058 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step3/show_ip_route.ref 2020-09-25 17:48:05.722919797 -0300 -+++ rt4/step4/show_ip_route.ref 2020-09-25 17:49:02.163655010 -0300 +--- a/rt4/step3/show_ip_route.ref ++++ b/rt4/step4/show_ip_route.ref @@ -15,9 +15,6 @@ "afi":"ipv4", "interfaceName":"eth-rt2-1", @@ -10,29 +10,28 @@ "labels":[ 16010 ] -@@ -28,21 +25,10 @@ +@@ -28,20 +25,6 @@ "afi":"ipv4", "interfaceName":"eth-rt2-2", "active":true, - "backupIndex":[ - 0 - ], - "labels":[ - 16010 - ] - } +- "labels":[ +- 16010 +- ] +- } - ], - "backupNexthops":[ - { - "ip":"10.0.6.5", - "afi":"ipv4", - "interfaceName":"eth-rt5", -- "active":true -- } - ] - } - ], -@@ -62,9 +48,6 @@ +- "active":true, + "labels":[ + 16010 + ] +@@ -65,9 +48,6 @@ "afi":"ipv4", "interfaceName":"eth-rt2-1", "active":true, @@ -42,7 +41,7 @@ "labels":[ 3 ] -@@ -75,25 +58,10 @@ +@@ -78,25 +58,10 @@ "afi":"ipv4", "interfaceName":"eth-rt2-2", "active":true, @@ -68,7 +67,7 @@ ] } ], -@@ -156,21 +124,10 @@ +@@ -159,24 +124,10 @@ "afi":"ipv4", "interfaceName":"eth-rt5", "active":true, @@ -85,12 +84,15 @@ - "ip":"10.0.7.6", - "afi":"ipv4", - "interfaceName":"eth-rt6", -- "active":true +- "active":true, +- "labels":[ +- 16050 +- ] - } ] } ], -@@ -190,21 +147,10 @@ +@@ -196,24 +147,10 @@ "afi":"ipv4", "interfaceName":"eth-rt6", "active":true, @@ -107,12 +109,15 @@ - "ip":"10.0.6.5", - "afi":"ipv4", - "interfaceName":"eth-rt5", -- "active":true +- "active":true, +- "labels":[ +- 16060 +- ] - } ] } ], -@@ -223,27 +169,13 @@ +@@ -232,27 +169,13 @@ "ip":"10.0.2.2", "afi":"ipv4", "interfaceName":"eth-rt2-1", @@ -141,7 +146,7 @@ "active":true } ] -@@ -259,30 +191,13 @@ +@@ -268,30 +191,13 @@ { "ip":"10.0.2.2", "afi":"ipv4", @@ -174,7 +179,7 @@ } ] } -@@ -298,29 +213,12 @@ +@@ -307,29 +213,12 @@ "ip":"10.0.2.2", "afi":"ipv4", "interfaceName":"eth-rt2-1", @@ -206,7 +211,7 @@ } ] } -@@ -340,31 +238,6 @@ +@@ -349,31 +238,6 @@ "ip":"10.0.6.5", "afi":"ipv4", "interfaceName":"eth-rt5", @@ -238,7 +243,7 @@ "active":true } ] -@@ -385,31 +258,6 @@ +@@ -394,31 +258,6 @@ "ip":"10.0.6.5", "afi":"ipv4", "interfaceName":"eth-rt5", @@ -270,7 +275,7 @@ "active":true } ] -@@ -425,18 +273,7 @@ +@@ -434,18 +273,7 @@ { "ip":"10.0.6.5", "afi":"ipv4", @@ -290,7 +295,7 @@ } ] } -@@ -451,18 +288,7 @@ +@@ -460,18 +288,7 @@ { "ip":"10.0.7.6", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ipv6_route.ref.diff index b84ceaff1a..7f39285089 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ipv6_route.ref.diff @@ -1,8 +1,8 @@ ---- rt4/step3/show_ipv6_route.ref 2020-09-25 17:48:06.998936410 -0300 -+++ rt4/step4/show_ipv6_route.ref 2020-09-25 17:49:03.399671119 -0300 +--- a/rt4/step3/show_ipv6_route.ref ++++ b/rt4/step4/show_ipv6_route.ref @@ -14,9 +14,6 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, - "backupIndex":[ - 0 @@ -10,30 +10,29 @@ "labels":[ 16011 ] -@@ -26,20 +23,10 @@ +@@ -26,19 +23,6 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt2-1", "active":true, - "backupIndex":[ - 0 - ], - "labels":[ - 16011 - ] - } +- "labels":[ +- 16011 +- ] +- } - ], - "backupNexthops":[ - { - "afi":"ipv6", - "interfaceName":"eth-rt5", -- "active":true -- } - ] - } - ], -@@ -58,9 +45,6 @@ +- "active":true, + "labels":[ + 16011 + ] +@@ -61,9 +45,6 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, - "backupIndex":[ - 0 @@ -41,9 +40,9 @@ "labels":[ 3 ] -@@ -70,24 +54,10 @@ +@@ -73,24 +54,10 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt2-1", "active":true, - "backupIndex":[ - 0 @@ -66,7 +65,7 @@ ] } ], -@@ -146,20 +116,10 @@ +@@ -149,23 +116,10 @@ "afi":"ipv6", "interfaceName":"eth-rt5", "active":true, @@ -82,12 +81,15 @@ - { - "afi":"ipv6", - "interfaceName":"eth-rt6", -- "active":true +- "active":true, +- "labels":[ +- 16051 +- ] - } ] } ], -@@ -178,20 +138,10 @@ +@@ -184,23 +138,10 @@ "afi":"ipv6", "interfaceName":"eth-rt6", "active":true, @@ -103,7 +105,10 @@ - { - "afi":"ipv6", - "interfaceName":"eth-rt5", -- "active":true +- "active":true, +- "labels":[ +- 16061 +- ] - } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step4/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_mpls_table.ref.diff index 70e0108b0d..3dcd36c176 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step4/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step3/show_mpls_table.ref 2020-09-25 17:48:04.418902820 -0300 -+++ rt4/step4/show_mpls_table.ref 2020-09-25 17:49:00.959639319 -0300 +--- a/rt4/step3/show_mpls_table.ref ++++ b/rt4/step4/show_mpls_table.ref @@ -7,26 +7,13 @@ "type":"SR (IS-IS)", "outLabel":16010, @@ -23,7 +23,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16010, - "nexthop":"10.0.6.5" + "nexthop":"10.0.2.2" } @@ -52,7 +52,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16011, - "interface":"eth-rt5" + "interface":"eth-rt2-1" } @@ -129,7 +129,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16050, - "nexthop":"10.0.7.6" + "nexthop":"10.0.6.5" } @@ -148,7 +148,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16051, - "interface":"eth-rt6" + "interface":"eth-rt5" } @@ -167,7 +167,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16060, - "nexthop":"10.0.6.5" + "nexthop":"10.0.7.6" } @@ -186,7 +186,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16061, - "interface":"eth-rt5" + "interface":"eth-rt6" } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ip_route.ref.diff index aa319a3232..484a3147dc 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step4/show_ip_route.ref 2020-09-25 17:49:02.163655010 -0300 -+++ rt4/step5/show_ip_route.ref 2020-09-25 17:50:12.800576153 -0300 +--- a/rt4/step4/show_ip_route.ref ++++ b/rt4/step5/show_ip_route.ref @@ -15,6 +15,9 @@ "afi":"ipv4", "interfaceName":"eth-rt2-1", @@ -10,29 +10,28 @@ "labels":[ 16010 ] -@@ -25,10 +28,21 @@ +@@ -25,6 +28,20 @@ "afi":"ipv4", "interfaceName":"eth-rt2-2", "active":true, + "backupIndex":[ + 0 + ], - "labels":[ - 16010 - ] - } ++ "labels":[ ++ 16010 ++ ] ++ } + ], + "backupNexthops":[ + { + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", -+ "active":true -+ } - ] - } - ], -@@ -48,6 +62,9 @@ ++ "active":true, + "labels":[ + 16010 + ] +@@ -48,6 +65,9 @@ "afi":"ipv4", "interfaceName":"eth-rt2-1", "active":true, @@ -42,7 +41,7 @@ "labels":[ 3 ] -@@ -58,10 +75,25 @@ +@@ -58,10 +78,25 @@ "afi":"ipv4", "interfaceName":"eth-rt2-2", "active":true, @@ -68,7 +67,7 @@ ] } ], -@@ -124,10 +156,21 @@ +@@ -124,10 +159,24 @@ "afi":"ipv4", "interfaceName":"eth-rt5", "active":true, @@ -85,12 +84,15 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", -+ "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + } ] } ], -@@ -147,10 +190,21 @@ +@@ -147,10 +196,24 @@ "afi":"ipv4", "interfaceName":"eth-rt6", "active":true, @@ -107,12 +109,15 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", -+ "active":true ++ "active":true, ++ "labels":[ ++ 16060 ++ ] + } ] } ], -@@ -169,13 +223,27 @@ +@@ -169,13 +232,27 @@ "ip":"10.0.2.2", "afi":"ipv4", "interfaceName":"eth-rt2-1", @@ -141,7 +146,7 @@ "active":true } ] -@@ -191,13 +259,30 @@ +@@ -191,13 +268,30 @@ { "ip":"10.0.2.2", "afi":"ipv4", @@ -174,7 +179,7 @@ } ] } -@@ -213,12 +298,29 @@ +@@ -213,12 +307,29 @@ "ip":"10.0.2.2", "afi":"ipv4", "interfaceName":"eth-rt2-1", @@ -206,7 +211,7 @@ } ] } -@@ -238,6 +340,31 @@ +@@ -238,6 +349,31 @@ "ip":"10.0.6.5", "afi":"ipv4", "interfaceName":"eth-rt5", @@ -238,7 +243,7 @@ "active":true } ] -@@ -258,6 +385,31 @@ +@@ -258,6 +394,31 @@ "ip":"10.0.6.5", "afi":"ipv4", "interfaceName":"eth-rt5", @@ -270,7 +275,7 @@ "active":true } ] -@@ -273,7 +425,18 @@ +@@ -273,7 +434,18 @@ { "ip":"10.0.6.5", "afi":"ipv4", @@ -290,7 +295,7 @@ } ] } -@@ -288,7 +451,18 @@ +@@ -288,7 +460,18 @@ { "ip":"10.0.7.6", "afi":"ipv4", diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ipv6_route.ref.diff index 1bd207854c..3ad0085120 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ipv6_route.ref.diff @@ -1,8 +1,8 @@ ---- rt4/step4/show_ipv6_route.ref 2020-09-25 17:49:03.399671119 -0300 -+++ rt4/step5/show_ipv6_route.ref 2020-09-25 17:50:14.040592332 -0300 +--- a/rt4/step4/show_ipv6_route.ref ++++ b/rt4/step5/show_ipv6_route.ref @@ -14,6 +14,9 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, + "backupIndex":[ + 0 @@ -10,30 +10,29 @@ "labels":[ 16011 ] -@@ -23,10 +26,20 @@ +@@ -23,6 +26,19 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt2-1", "active":true, + "backupIndex":[ + 0 + ], - "labels":[ - 16011 - ] - } ++ "labels":[ ++ 16011 ++ ] ++ } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", -+ "active":true -+ } - ] - } - ], -@@ -45,6 +58,9 @@ ++ "active":true, + "labels":[ + 16011 + ] +@@ -45,6 +61,9 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-1", + "interfaceName":"eth-rt2-2", "active":true, + "backupIndex":[ + 0 @@ -41,9 +40,9 @@ "labels":[ 3 ] -@@ -54,10 +70,24 @@ +@@ -54,10 +73,24 @@ "afi":"ipv6", - "interfaceName":"eth-rt2-2", + "interfaceName":"eth-rt2-1", "active":true, + "backupIndex":[ + 0 @@ -66,7 +65,7 @@ ] } ], -@@ -116,10 +146,20 @@ +@@ -116,10 +149,23 @@ "afi":"ipv6", "interfaceName":"eth-rt5", "active":true, @@ -82,12 +81,15 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", -+ "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + } ] } ], -@@ -138,10 +178,20 @@ +@@ -138,10 +184,23 @@ "afi":"ipv6", "interfaceName":"eth-rt6", "active":true, @@ -103,7 +105,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", -+ "active":true ++ "active":true, ++ "labels":[ ++ 16061 ++ ] + } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step5/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_mpls_table.ref.diff index 664b129a1b..20e363375b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step5/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step4/show_mpls_table.ref 2020-09-25 17:49:00.959639319 -0300 -+++ rt4/step5/show_mpls_table.ref 2020-09-25 17:50:11.488559034 -0300 +--- a/rt4/step4/show_mpls_table.ref ++++ b/rt4/step5/show_mpls_table.ref @@ -7,13 +7,26 @@ "type":"SR (IS-IS)", "outLabel":16010, @@ -24,7 +24,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16010, + "nexthop":"10.0.6.5" } ] @@ -53,7 +53,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16011, + "interface":"eth-rt5" } ] @@ -130,7 +130,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16050, + "nexthop":"10.0.7.6" } ] @@ -149,7 +149,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16051, + "interface":"eth-rt6" } ] @@ -168,7 +168,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16060, + "nexthop":"10.0.6.5" } ] @@ -187,7 +187,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16061, + "interface":"eth-rt5" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ip_route.ref.diff index c758b89839..9070414730 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ip_route.ref.diff @@ -1,6 +1,15 @@ ---- rt4/step5/show_ip_route.ref 2020-09-25 17:50:12.800576153 -0300 -+++ rt4/step6/show_ip_route.ref 2020-09-25 17:51:15.725397558 -0300 -@@ -90,7 +90,7 @@ +--- a/rt4/step5/show_ip_route.ref ++++ b/rt4/step6/show_ip_route.ref +@@ -43,7 +43,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16010 ++ 30010 + ] + } + ] +@@ -93,7 +93,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ @@ -9,7 +18,7 @@ 16020 ] } -@@ -134,7 +134,7 @@ +@@ -137,7 +137,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ @@ -18,7 +27,16 @@ ] } ] -@@ -281,7 +281,7 @@ +@@ -211,7 +211,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16060 ++ 30060 + ] + } + ] +@@ -290,7 +290,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ @@ -27,7 +45,7 @@ ] } ] -@@ -319,7 +319,7 @@ +@@ -328,7 +328,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ipv6_route.ref.diff index ca495216dd..57a57647a1 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ipv6_route.ref.diff @@ -1,6 +1,15 @@ ---- rt4/step5/show_ipv6_route.ref 2020-09-25 17:50:14.040592332 -0300 -+++ rt4/step6/show_ipv6_route.ref 2020-09-25 17:51:16.969413804 -0300 -@@ -84,7 +84,7 @@ +--- a/rt4/step5/show_ipv6_route.ref ++++ b/rt4/step6/show_ipv6_route.ref +@@ -40,7 +40,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16011 ++ 30011 + ] + } + ] +@@ -87,7 +87,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ @@ -9,12 +18,21 @@ 16021 ] } -@@ -116,7 +116,7 @@ +@@ -128,7 +128,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ - 16031 + 30031 ] - }, - { + } + ] +@@ -198,7 +198,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16061 ++ 30061 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step6/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_mpls_table.ref.diff index 630e0419cf..94f87854d1 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step6/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_mpls_table.ref.diff @@ -1,5 +1,23 @@ ---- rt4/step5/show_mpls_table.ref 2020-09-25 17:50:11.488559034 -0300 -+++ rt4/step6/show_mpls_table.ref 2020-09-25 17:51:14.481381312 -0300 +--- a/rt4/step5/show_mpls_table.ref ++++ b/rt4/step6/show_mpls_table.ref +@@ -25,7 +25,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16010, ++ "outLabel":30010, + "nexthop":"10.0.6.5" + } + ] +@@ -56,7 +56,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16011, ++ "outLabel":30011, + "interface":"eth-rt5" + } + ] @@ -87,7 +87,7 @@ "backupNexthops":[ { @@ -36,3 +54,21 @@ "installed":true, "interface":"eth-rt5" } +@@ -232,7 +232,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16060, ++ "outLabel":30060, + "nexthop":"10.0.6.5" + } + ] +@@ -254,7 +254,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16061, ++ "outLabel":30061, + "interface":"eth-rt5" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ip_route.ref.diff index 30e0dcf3c0..e54873d5ab 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ip_route.ref.diff @@ -1,6 +1,6 @@ ---- rt4/step6/show_ip_route.ref 2020-09-25 17:51:15.725397558 -0300 -+++ rt4/step7/show_ip_route.ref 2020-09-25 17:52:02.614010084 -0300 -@@ -158,9 +158,6 @@ +--- a/rt4/step6/show_ip_route.ref ++++ b/rt4/step7/show_ip_route.ref +@@ -161,9 +161,6 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -172,10 +169,7 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ipv6_route.ref.diff index 2606027d75..92e08f99a0 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ipv6_route.ref.diff @@ -1,6 +1,6 @@ ---- rt4/step6/show_ipv6_route.ref 2020-09-25 17:51:16.969413804 -0300 -+++ rt4/step7/show_ipv6_route.ref 2020-09-25 17:52:03.854026287 -0300 -@@ -148,9 +148,6 @@ +--- a/rt4/step6/show_ipv6_route.ref ++++ b/rt4/step7/show_ipv6_route.ref +@@ -151,9 +151,6 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -161,10 +158,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step7/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_mpls_table.ref.diff index 5334cfd048..fb614ebf6a 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step7/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step6/show_mpls_table.ref 2020-09-25 17:51:14.481381312 -0300 -+++ rt4/step7/show_mpls_table.ref 2020-09-25 17:52:01.385994037 -0300 +--- a/rt4/step6/show_mpls_table.ref ++++ b/rt4/step7/show_mpls_table.ref @@ -171,50 +171,6 @@ } ] @@ -21,7 +21,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16050, - "nexthop":"10.0.7.6" - } - ] @@ -43,7 +43,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16051, - "interface":"eth-rt6" - } - ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ip_route.ref.diff index b393970e42..252da6e764 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ip_route.ref.diff @@ -1,6 +1,6 @@ ---- rt4/step7/show_ip_route.ref 2020-09-25 17:52:02.614010084 -0300 -+++ rt4/step8/show_ip_route.ref 2020-09-25 17:53:20.623029909 -0300 -@@ -158,6 +158,9 @@ +--- a/rt4/step7/show_ip_route.ref ++++ b/rt4/step8/show_ip_route.ref +@@ -161,6 +161,9 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -169,7 +172,10 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ipv6_route.ref.diff index 8bad2edcf3..7057d2166a 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ipv6_route.ref.diff @@ -1,6 +1,6 @@ ---- rt4/step7/show_ipv6_route.ref 2020-09-25 17:52:03.854026287 -0300 -+++ rt4/step8/show_ipv6_route.ref 2020-09-25 17:53:21.843045865 -0300 -@@ -148,6 +148,9 @@ +--- a/rt4/step7/show_ipv6_route.ref ++++ b/rt4/step8/show_ipv6_route.ref +@@ -151,6 +151,9 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -158,7 +161,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step8/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_mpls_table.ref.diff index d296dbdcaf..3dc4303b9b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step8/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step7/show_mpls_table.ref 2020-09-25 17:52:01.385994037 -0300 -+++ rt4/step8/show_mpls_table.ref 2020-09-25 17:53:19.371013534 -0300 +--- a/rt4/step7/show_mpls_table.ref ++++ b/rt4/step8/show_mpls_table.ref @@ -171,6 +171,50 @@ } ] @@ -21,7 +21,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16050, + "nexthop":"10.0.7.6" + } + ] @@ -43,7 +43,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16051, + "interface":"eth-rt6" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ip_route.ref.diff index e69de29bb2..56f9cc534f 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ip_route.ref.diff @@ -0,0 +1,11 @@ +--- a/rt4/step8/show_ip_route.ref ++++ b/rt4/step9/show_ip_route.ref +@@ -174,7 +174,7 @@ + "interfaceName":"eth-rt6", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ipv6_route.ref.diff index e69de29bb2..41e552177a 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_ipv6_route.ref.diff @@ -0,0 +1,11 @@ +--- a/rt4/step8/show_ipv6_route.ref ++++ b/rt4/step9/show_ipv6_route.ref +@@ -163,7 +163,7 @@ + "interfaceName":"eth-rt6", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step9/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_mpls_table.ref.diff index 408cbfb0ba..627e292518 100644 --- a/tests/topotests/isis-tilfa-topo1/rt4/step9/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt4/step8/show_mpls_table.ref 2020-09-25 17:53:19.371013534 -0300 -+++ rt4/step9/show_mpls_table.ref 2020-09-25 17:54:37.064030042 -0300 +--- a/rt4/step8/show_mpls_table.ref ++++ b/rt4/step9/show_mpls_table.ref @@ -171,15 +171,15 @@ } ] @@ -19,11 +19,13 @@ "backupIndex":[ 0 ] -@@ -189,19 +189,19 @@ +@@ -188,20 +188,20 @@ + "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, +- "outLabel":16050, - "nexthop":"10.0.7.6" ++ "outLabel":30060, + "nexthop":"10.0.6.5" } ] @@ -43,11 +45,13 @@ "backupIndex":[ 0 ] -@@ -211,19 +211,19 @@ +@@ -210,20 +210,20 @@ + "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, +- "outLabel":16051, - "interface":"eth-rt6" ++ "outLabel":30061, + "interface":"eth-rt5" } ] @@ -67,11 +71,13 @@ "backupIndex":[ 0 ] -@@ -233,19 +233,19 @@ +@@ -232,20 +232,20 @@ + "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, +- "outLabel":30060, - "nexthop":"10.0.6.5" ++ "outLabel":16500, + "nexthop":"10.0.7.6" } ] @@ -91,11 +97,13 @@ "backupIndex":[ 0 ] -@@ -255,7 +255,7 @@ +@@ -254,8 +254,8 @@ + "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, +- "outLabel":30061, - "interface":"eth-rt5" ++ "outLabel":16501, + "interface":"eth-rt6" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ip_route.ref b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ip_route.ref index f747065f9c..93740e22e0 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ip_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ip_route.ref @@ -41,7 +41,10 @@ "ip":"10.0.6.4", "afi":"ipv4", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16010 + ] } ] } @@ -169,7 +172,10 @@ "ip":"10.0.8.6", "afi":"ipv4", "interfaceName":"eth-rt6", - "active":true + "active":true, + "labels":[ + 16040 + ] } ] } @@ -203,7 +209,10 @@ "ip":"10.0.6.4", "afi":"ipv4", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16060 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ipv6_route.ref b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ipv6_route.ref index 6c0a5e0b9b..6dafa69adb 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ipv6_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ipv6_route.ref @@ -12,7 +12,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt3-1", + "interfaceName":"eth-rt3-2", "active":true, "backupIndex":[ 0 @@ -24,7 +24,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt3-2", + "interfaceName":"eth-rt3-1", "active":true, "backupIndex":[ 0 @@ -38,7 +38,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16011 + ] } ] } @@ -65,7 +68,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt3-1", + "interfaceName":"eth-rt3-2", "active":true, "labels":[ 16021 @@ -74,7 +77,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt3-2", + "interfaceName":"eth-rt3-1", "active":true, "labels":[ 16021 @@ -96,7 +99,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt3-1", + "interfaceName":"eth-rt3-2", "active":true, "backupIndex":[ 0 @@ -108,7 +111,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt3-2", + "interfaceName":"eth-rt3-1", "active":true, "backupIndex":[ 0 @@ -158,7 +161,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt6", - "active":true + "active":true, + "labels":[ + 16041 + ] } ] } @@ -190,7 +196,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16061 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_mpls_table.ref b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_mpls_table.ref index 2b70392adc..0c5861b5e8 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_mpls_table.ref +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_mpls_table.ref @@ -25,7 +25,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16010, "nexthop":"10.0.6.4" } ] @@ -56,7 +56,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16011, "interface":"eth-rt4" } ] @@ -188,7 +188,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16040, "nexthop":"10.0.8.6" } ] @@ -210,7 +210,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16041, "interface":"eth-rt6" } ] @@ -232,7 +232,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16060, "nexthop":"10.0.6.4" } ] @@ -254,7 +254,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16061, "interface":"eth-rt4" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ip_route.ref.diff index 6402b51893..7545a31b9b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ip_route.ref.diff @@ -1,6 +1,18 @@ ---- rt5/step3/show_ip_route.ref 2020-09-25 17:48:05.950922766 -0300 -+++ rt5/step4/show_ip_route.ref 2020-09-25 17:49:02.363657616 -0300 -@@ -81,10 +81,7 @@ +--- a/rt5/step3/show_ip_route.ref ++++ b/rt5/step4/show_ip_route.ref +@@ -41,10 +41,7 @@ + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16010 +- ] ++ "active":true + } + ] + } +@@ -84,10 +81,7 @@ "ip":"10.0.6.4", "afi":"ipv4", "interfaceName":"eth-rt4", @@ -12,7 +24,7 @@ } ] } -@@ -105,9 +102,6 @@ +@@ -108,9 +102,6 @@ "afi":"ipv4", "interfaceName":"eth-rt3-1", "active":true, @@ -22,7 +34,7 @@ "labels":[ 3 ] -@@ -118,25 +112,10 @@ +@@ -121,25 +112,10 @@ "afi":"ipv4", "interfaceName":"eth-rt3-2", "active":true, @@ -48,7 +60,7 @@ ] } ], -@@ -158,9 +137,6 @@ +@@ -161,9 +137,6 @@ "active":true, "backupIndex":[ 0 @@ -58,7 +70,31 @@ ] } ], -@@ -349,30 +325,13 @@ +@@ -172,10 +145,7 @@ + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 16040 +- ] ++ "active":true + } + ] + } +@@ -209,10 +179,7 @@ + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16060 +- ] ++ "active":true + } + ] + } +@@ -358,30 +325,13 @@ { "ip":"10.0.4.3", "afi":"ipv4", @@ -91,7 +127,7 @@ } ] } -@@ -388,29 +347,12 @@ +@@ -397,29 +347,12 @@ "ip":"10.0.4.3", "afi":"ipv4", "interfaceName":"eth-rt3-1", diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ipv6_route.ref.diff index 7a0135bf04..1de62bb58e 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ipv6_route.ref.diff @@ -1,6 +1,18 @@ ---- rt5/step3/show_ipv6_route.ref 2020-09-25 17:48:07.218939274 -0300 -+++ rt5/step4/show_ipv6_route.ref 2020-09-25 17:49:03.599673726 -0300 -@@ -57,10 +57,7 @@ +--- a/rt5/step3/show_ipv6_route.ref ++++ b/rt5/step4/show_ipv6_route.ref +@@ -38,10 +38,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16011 +- ] ++ "active":true + } + ] + } +@@ -60,10 +57,7 @@ "fib":true, "afi":"ipv6", "interfaceName":"eth-rt4", @@ -12,9 +24,9 @@ }, { "fib":true, -@@ -98,9 +95,6 @@ +@@ -101,9 +95,6 @@ "afi":"ipv6", - "interfaceName":"eth-rt3-1", + "interfaceName":"eth-rt3-2", "active":true, - "backupIndex":[ - 0 @@ -22,9 +34,9 @@ "labels":[ 3 ] -@@ -110,24 +104,10 @@ +@@ -113,24 +104,10 @@ "afi":"ipv6", - "interfaceName":"eth-rt3-2", + "interfaceName":"eth-rt3-1", "active":true, - "backupIndex":[ - 0 @@ -47,7 +59,7 @@ ] } ], -@@ -148,9 +128,6 @@ +@@ -151,9 +128,6 @@ "active":true, "backupIndex":[ 0 @@ -57,3 +69,27 @@ ] } ], +@@ -161,10 +135,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 16041 +- ] ++ "active":true + } + ] + } +@@ -196,10 +167,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16061 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step4/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_mpls_table.ref.diff index 299dac7640..b3d5252430 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step4/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_mpls_table.ref.diff @@ -1,5 +1,23 @@ ---- rt5/step3/show_mpls_table.ref 2020-09-25 17:48:04.626905528 -0300 -+++ rt5/step4/show_mpls_table.ref 2020-09-25 17:49:01.159641924 -0300 +--- a/rt5/step3/show_mpls_table.ref ++++ b/rt5/step4/show_mpls_table.ref +@@ -25,7 +25,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16010, ++ "outLabel":3, + "nexthop":"10.0.6.4" + } + ] +@@ -56,7 +56,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16011, ++ "outLabel":3, + "interface":"eth-rt4" + } + ] @@ -76,12 +76,6 @@ "outLabel":16020, "installed":true, @@ -100,7 +118,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16040, - "nexthop":"10.0.8.6" - } - ] @@ -122,9 +140,27 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16041, - "interface":"eth-rt6" + "interface":"eth-rt3-1" } ] }, +@@ -232,7 +150,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16060, ++ "outLabel":3, + "nexthop":"10.0.6.4" + } + ] +@@ -254,7 +172,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16061, ++ "outLabel":3, + "interface":"eth-rt4" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ip_route.ref.diff index 31f70b17a3..be5d83f463 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ip_route.ref.diff @@ -1,6 +1,18 @@ ---- rt5/step4/show_ip_route.ref 2020-09-25 17:49:02.363657616 -0300 -+++ rt5/step5/show_ip_route.ref 2020-09-25 17:50:13.012578918 -0300 -@@ -81,7 +81,10 @@ +--- a/rt5/step4/show_ip_route.ref ++++ b/rt5/step5/show_ip_route.ref +@@ -41,7 +41,10 @@ + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16010 ++ ] + } + ] + } +@@ -81,7 +84,10 @@ "ip":"10.0.6.4", "afi":"ipv4", "interfaceName":"eth-rt4", @@ -12,7 +24,7 @@ } ] } -@@ -102,6 +105,9 @@ +@@ -102,6 +108,9 @@ "afi":"ipv4", "interfaceName":"eth-rt3-1", "active":true, @@ -22,7 +34,7 @@ "labels":[ 3 ] -@@ -112,10 +118,25 @@ +@@ -112,10 +121,25 @@ "afi":"ipv4", "interfaceName":"eth-rt3-2", "active":true, @@ -48,7 +60,7 @@ ] } ], -@@ -137,6 +158,9 @@ +@@ -137,6 +161,9 @@ "active":true, "backupIndex":[ 0 @@ -58,7 +70,31 @@ ] } ], -@@ -325,13 +349,30 @@ +@@ -145,7 +172,10 @@ + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 16040 ++ ] + } + ] + } +@@ -179,7 +209,10 @@ + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16060 ++ ] + } + ] + } +@@ -325,13 +358,30 @@ { "ip":"10.0.4.3", "afi":"ipv4", @@ -91,7 +127,7 @@ } ] } -@@ -347,12 +388,29 @@ +@@ -347,12 +397,29 @@ "ip":"10.0.4.3", "afi":"ipv4", "interfaceName":"eth-rt3-1", diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ipv6_route.ref.diff index 59d9755e18..a856019622 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ipv6_route.ref.diff @@ -1,6 +1,18 @@ ---- rt5/step4/show_ipv6_route.ref 2020-09-25 17:49:03.599673726 -0300 -+++ rt5/step5/show_ipv6_route.ref 2020-09-25 17:50:14.248595046 -0300 -@@ -57,7 +57,10 @@ +--- a/rt5/step4/show_ipv6_route.ref ++++ b/rt5/step5/show_ipv6_route.ref +@@ -38,7 +38,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16011 ++ ] + } + ] + } +@@ -57,7 +60,10 @@ "fib":true, "afi":"ipv6", "interfaceName":"eth-rt4", @@ -12,9 +24,9 @@ }, { "fib":true, -@@ -95,6 +98,9 @@ +@@ -95,6 +101,9 @@ "afi":"ipv6", - "interfaceName":"eth-rt3-1", + "interfaceName":"eth-rt3-2", "active":true, + "backupIndex":[ + 0 @@ -22,9 +34,9 @@ "labels":[ 3 ] -@@ -104,10 +110,24 @@ +@@ -104,10 +113,24 @@ "afi":"ipv6", - "interfaceName":"eth-rt3-2", + "interfaceName":"eth-rt3-1", "active":true, + "backupIndex":[ + 0 @@ -47,7 +59,7 @@ ] } ], -@@ -128,6 +148,9 @@ +@@ -128,6 +151,9 @@ "active":true, "backupIndex":[ 0 @@ -57,3 +69,27 @@ ] } ], +@@ -135,7 +161,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 16041 ++ ] + } + ] + } +@@ -167,7 +196,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16061 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step5/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_mpls_table.ref.diff index 669c07e344..74caa8620e 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step5/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_mpls_table.ref.diff @@ -1,5 +1,23 @@ ---- rt5/step4/show_mpls_table.ref 2020-09-25 17:49:01.159641924 -0300 -+++ rt5/step5/show_mpls_table.ref 2020-09-25 17:50:11.696561748 -0300 +--- a/rt5/step4/show_mpls_table.ref ++++ b/rt5/step5/show_mpls_table.ref +@@ -25,7 +25,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16010, + "nexthop":"10.0.6.4" + } + ] +@@ -56,7 +56,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16011, + "interface":"eth-rt4" + } + ] @@ -69,6 +69,12 @@ "type":"SR (IS-IS)", "outLabel":16020, @@ -101,7 +119,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16040, + "nexthop":"10.0.8.6" + } + ] @@ -123,8 +141,26 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16041, + "interface":"eth-rt6" } ] }, +@@ -150,7 +232,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16060, + "nexthop":"10.0.6.4" + } + ] +@@ -172,7 +254,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16061, + "interface":"eth-rt4" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step6/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step6/show_mpls_table.ref.diff index a4f82cbf10..2883c046fd 100644 --- a/tests/topotests/isis-tilfa-topo1/rt5/step6/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt5/step6/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt5/step5/show_mpls_table.ref 2020-09-25 17:50:11.696561748 -0300 -+++ rt5/step6/show_mpls_table.ref 2020-09-25 17:51:14.685383977 -0300 +--- a/rt5/step5/show_mpls_table.ref ++++ b/rt5/step6/show_mpls_table.ref @@ -1,6 +1,6 @@ { - "16010":{ diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ip_route.ref b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ip_route.ref index 5bcef4c2f6..b9b43c4139 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ip_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ip_route.ref @@ -61,7 +61,10 @@ "ip":"10.0.8.5", "afi":"ipv4", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16020 + ] } ] } @@ -95,7 +98,10 @@ "ip":"10.0.7.4", "afi":"ipv4", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16030 + ] } ] } @@ -129,7 +135,10 @@ "ip":"10.0.8.5", "afi":"ipv4", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16040 + ] } ] } @@ -163,7 +172,10 @@ "ip":"10.0.7.4", "afi":"ipv4", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16050 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ipv6_route.ref b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ipv6_route.ref index 8294b07136..1b1942939d 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ipv6_route.ref +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ipv6_route.ref @@ -12,7 +12,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt5", + "interfaceName":"eth-rt4", "active":true, "labels":[ 16011 @@ -21,7 +21,7 @@ { "fib":true, "afi":"ipv6", - "interfaceName":"eth-rt4", + "interfaceName":"eth-rt5", "active":true, "labels":[ 16011 @@ -57,7 +57,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16021 + ] } ] } @@ -89,7 +92,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16031 + ] } ] } @@ -121,7 +127,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt5", - "active":true + "active":true, + "labels":[ + 16041 + ] } ] } @@ -153,7 +162,10 @@ { "afi":"ipv6", "interfaceName":"eth-rt4", - "active":true + "active":true, + "labels":[ + 16051 + ] } ] } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_mpls_table.ref b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_mpls_table.ref index 33dbf59204..5b52a16f48 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_mpls_table.ref +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_mpls_table.ref @@ -7,13 +7,13 @@ "type":"SR (IS-IS)", "outLabel":16010, "installed":true, - "nexthop":"10.0.7.4" + "nexthop":"10.0.8.5" }, { "type":"SR (IS-IS)", "outLabel":16010, "installed":true, - "nexthop":"10.0.8.5" + "nexthop":"10.0.7.4" } ] }, @@ -25,13 +25,13 @@ "type":"SR (IS-IS)", "outLabel":16011, "installed":true, - "interface":"eth-rt4" + "interface":"eth-rt5" }, { "type":"SR (IS-IS)", "outLabel":16011, "installed":true, - "interface":"eth-rt5" + "interface":"eth-rt4" } ] }, @@ -52,7 +52,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16020, "nexthop":"10.0.8.5" } ] @@ -74,7 +74,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16021, "interface":"eth-rt5" } ] @@ -96,7 +96,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16030, "nexthop":"10.0.7.4" } ] @@ -118,7 +118,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16031, "interface":"eth-rt4" } ] @@ -140,7 +140,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16040, "nexthop":"10.0.8.5" } ] @@ -162,7 +162,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16041, "interface":"eth-rt5" } ] @@ -184,7 +184,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16050, "nexthop":"10.0.7.4" } ] @@ -206,7 +206,7 @@ "backupNexthops":[ { "type":"SR (IS-IS)", - "outLabel":3, + "outLabel":16051, "interface":"eth-rt4" } ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ip_route.ref.diff index 04adaefe78..7c2f00419a 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step3/show_ip_route.ref 2020-09-25 17:48:06.154925422 -0300 -+++ rt6/step4/show_ip_route.ref 2020-09-25 17:49:02.583660484 -0300 +--- a/rt6/step3/show_ip_route.ref ++++ b/rt6/step4/show_ip_route.ref @@ -14,10 +14,7 @@ "ip":"10.0.7.4", "afi":"ipv4", @@ -22,7 +22,19 @@ ] } ], -@@ -118,9 +112,6 @@ +@@ -98,10 +92,7 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16030 +- ] ++ "active":true + } + ] + } +@@ -124,9 +115,6 @@ "active":true, "backupIndex":[ 0 @@ -32,3 +44,27 @@ ] } ], +@@ -135,10 +123,7 @@ + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 16040 +- ] ++ "active":true + } + ] + } +@@ -172,10 +157,7 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ipv6_route.ref.diff index 20aa1ec83b..70f872e9de 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ipv6_route.ref.diff @@ -1,6 +1,6 @@ ---- rt6/step3/show_ipv6_route.ref 2020-09-25 17:48:07.434942087 -0300 -+++ rt6/step4/show_ipv6_route.ref 2020-09-25 17:49:03.847676958 -0300 -@@ -22,10 +22,7 @@ +--- a/rt6/step3/show_ipv6_route.ref ++++ b/rt6/step4/show_ipv6_route.ref +@@ -13,10 +13,7 @@ "fib":true, "afi":"ipv6", "interfaceName":"eth-rt4", @@ -9,9 +9,9 @@ - 16011 - ] + "active":true - } - ] - } + }, + { + "fib":true, @@ -47,9 +44,6 @@ "active":true, "backupIndex":[ @@ -22,7 +22,19 @@ ] } ], -@@ -111,9 +105,6 @@ +@@ -92,10 +86,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16031 +- ] ++ "active":true + } + ] + } +@@ -117,9 +108,6 @@ "active":true, "backupIndex":[ 0 @@ -32,3 +44,27 @@ ] } ], +@@ -127,10 +115,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 16041 +- ] ++ "active":true + } + ] + } +@@ -162,10 +147,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step4/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_mpls_table.ref.diff index 3f24547f6d..c191763a73 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step4/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_mpls_table.ref.diff @@ -1,35 +1,49 @@ ---- rt6/step3/show_mpls_table.ref 2020-09-25 17:48:04.842908340 -0300 -+++ rt6/step4/show_mpls_table.ref 2020-09-25 17:49:01.363644584 -0300 -@@ -7,12 +7,6 @@ - "type":"SR (IS-IS)", +--- a/rt6/step3/show_mpls_table.ref ++++ b/rt6/step4/show_mpls_table.ref +@@ -8,12 +8,6 @@ "outLabel":16010, "installed":true, -- "nexthop":"10.0.7.4" + "nexthop":"10.0.8.5" - }, - { - "type":"SR (IS-IS)", - "outLabel":16010, - "installed":true, - "nexthop":"10.0.8.5" +- "nexthop":"10.0.7.4" } ] -@@ -25,12 +19,6 @@ - "type":"SR (IS-IS)", + }, +@@ -26,12 +20,6 @@ "outLabel":16011, "installed":true, -- "interface":"eth-rt4" + "interface":"eth-rt5" - }, - { - "type":"SR (IS-IS)", - "outLabel":16011, - "installed":true, - "interface":"eth-rt5" +- "interface":"eth-rt4" } ] -@@ -123,50 +111,6 @@ + }, +@@ -96,7 +84,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16030, ++ "outLabel":3, + "nexthop":"10.0.7.4" } ] - }, +@@ -118,52 +106,8 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16031, +- "interface":"eth-rt4" +- } +- ] +- }, - "16040":{ - "inLabel":16040, - "installed":true, @@ -47,7 +61,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16040, - "nexthop":"10.0.8.5" - } - ] @@ -58,7 +72,7 @@ - "nexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, + "outLabel":3, - "installed":true, - "interface":"eth-rt4", - "backupIndex":[ @@ -69,11 +83,27 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16041, - "interface":"eth-rt5" -- } -- ] -- }, - "16050":{ - "inLabel":16050, - "installed":true, ++ "interface":"eth-rt4" + } + ] + }, +@@ -184,7 +128,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":3, + "nexthop":"10.0.7.4" + } + ] +@@ -206,7 +150,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":3, + "interface":"eth-rt4" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ip_route.ref.diff index 9f73a2904e..9f017d2492 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step4/show_ip_route.ref 2020-09-25 17:49:02.583660484 -0300 -+++ rt6/step5/show_ip_route.ref 2020-09-25 17:50:13.220581632 -0300 +--- a/rt6/step4/show_ip_route.ref ++++ b/rt6/step5/show_ip_route.ref @@ -14,7 +14,10 @@ "ip":"10.0.7.4", "afi":"ipv4", @@ -22,7 +22,19 @@ ] } ], -@@ -112,6 +118,9 @@ +@@ -92,7 +98,10 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16030 ++ ] + } + ] + } +@@ -115,6 +124,9 @@ "active":true, "backupIndex":[ 0 @@ -32,3 +44,27 @@ ] } ], +@@ -123,7 +135,10 @@ + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 16040 ++ ] + } + ] + } +@@ -157,7 +172,10 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ipv6_route.ref.diff index c9358d45b2..1209504e94 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ipv6_route.ref.diff @@ -1,6 +1,6 @@ ---- rt6/step4/show_ipv6_route.ref 2020-09-25 17:49:03.847676958 -0300 -+++ rt6/step5/show_ipv6_route.ref 2020-09-25 17:50:14.456597760 -0300 -@@ -22,7 +22,10 @@ +--- a/rt6/step4/show_ipv6_route.ref ++++ b/rt6/step5/show_ipv6_route.ref +@@ -13,7 +13,10 @@ "fib":true, "afi":"ipv6", "interfaceName":"eth-rt4", @@ -9,9 +9,9 @@ + "labels":[ + 16011 + ] - } - ] - } + }, + { + "fib":true, @@ -44,6 +47,9 @@ "active":true, "backupIndex":[ @@ -22,7 +22,19 @@ ] } ], -@@ -105,6 +111,9 @@ +@@ -86,7 +92,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16031 ++ ] + } + ] + } +@@ -108,6 +117,9 @@ "active":true, "backupIndex":[ 0 @@ -32,3 +44,27 @@ ] } ], +@@ -115,7 +127,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 16041 ++ ] + } + ] + } +@@ -147,7 +162,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step5/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_mpls_table.ref.diff index c9d67955ef..abf7c2a32d 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step5/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step4/show_mpls_table.ref 2020-09-25 17:49:01.363644584 -0300 -+++ rt6/step5/show_mpls_table.ref 2020-09-25 17:50:11.904564461 -0300 +--- a/rt6/step4/show_mpls_table.ref ++++ b/rt6/step5/show_mpls_table.ref @@ -7,6 +7,12 @@ "type":"SR (IS-IS)", "outLabel":16010, @@ -26,7 +26,22 @@ "interface":"eth-rt5" } ] -@@ -111,6 +123,50 @@ +@@ -84,7 +96,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16030, + "nexthop":"10.0.7.4" + } + ] +@@ -106,11 +118,55 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16031, + "interface":"eth-rt4" } ] }, @@ -47,7 +62,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16040, + "nexthop":"10.0.8.5" + } + ] @@ -69,7 +84,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16041, + "interface":"eth-rt5" + } + ] @@ -77,3 +92,21 @@ "16050":{ "inLabel":16050, "installed":true, +@@ -128,7 +184,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16050, + "nexthop":"10.0.7.4" + } + ] +@@ -150,7 +206,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16051, + "interface":"eth-rt4" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ip_route.ref.diff index 527ec74958..f318f95e21 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ip_route.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step5/show_ip_route.ref 2020-09-25 17:50:13.220581632 -0300 -+++ rt6/step6/show_ip_route.ref 2020-09-25 17:51:16.137402938 -0300 +--- a/rt6/step5/show_ip_route.ref ++++ b/rt6/step6/show_ip_route.ref @@ -26,7 +26,7 @@ "interfaceName":"eth-rt5", "active":true, @@ -9,7 +9,16 @@ ] } ] -@@ -86,7 +86,7 @@ +@@ -63,7 +63,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16020 ++ 30020 + ] + } + ] +@@ -89,7 +89,7 @@ 0 ], "labels":[ @@ -18,3 +27,12 @@ ] } ], +@@ -137,7 +137,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ipv6_route.ref.diff index 7b8f8022f2..9208491fc8 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ipv6_route.ref.diff @@ -1,15 +1,24 @@ ---- rt6/step5/show_ipv6_route.ref 2020-09-25 17:50:14.456597760 -0300 -+++ rt6/step6/show_ipv6_route.ref 2020-09-25 17:51:17.401419446 -0300 -@@ -15,7 +15,7 @@ +--- a/rt6/step5/show_ipv6_route.ref ++++ b/rt6/step6/show_ipv6_route.ref +@@ -24,7 +24,7 @@ "interfaceName":"eth-rt5", "active":true, "labels":[ - 16011 + 30011 ] - }, - { -@@ -81,7 +81,7 @@ + } + ] +@@ -59,7 +59,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16021 ++ 30021 + ] + } + ] +@@ -84,7 +84,7 @@ 0 ], "labels":[ @@ -18,3 +27,12 @@ ] } ], +@@ -129,7 +129,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step6/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_mpls_table.ref.diff index edd5afeeb8..aee8969ded 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step6/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step5/show_mpls_table.ref 2020-09-25 17:50:11.904564461 -0300 -+++ rt6/step6/show_mpls_table.ref 2020-09-25 17:51:14.893386692 -0300 +--- a/rt6/step5/show_mpls_table.ref ++++ b/rt6/step6/show_mpls_table.ref @@ -11,7 +11,7 @@ }, { @@ -18,6 +18,24 @@ "installed":true, "interface":"eth-rt5" } +@@ -52,7 +52,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16020, ++ "outLabel":30020, + "nexthop":"10.0.8.5" + } + ] +@@ -74,7 +74,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16021, ++ "outLabel":30021, + "interface":"eth-rt5" + } + ] @@ -85,7 +85,7 @@ "nexthops":[ { @@ -36,3 +54,21 @@ "installed":true, "interface":"eth-rt5", "backupIndex":[ +@@ -140,7 +140,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "nexthop":"10.0.8.5" + } + ] +@@ -162,7 +162,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "interface":"eth-rt5" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ip_route.ref.diff index 7553dd22e5..0e6c3ff5cd 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ip_route.ref.diff @@ -1,6 +1,6 @@ ---- rt6/step6/show_ip_route.ref 2020-09-25 17:51:16.137402938 -0300 -+++ rt6/step7/show_ip_route.ref 2020-09-25 17:52:03.018015363 -0300 -@@ -152,9 +152,6 @@ +--- a/rt6/step6/show_ip_route.ref ++++ b/rt6/step7/show_ip_route.ref +@@ -161,9 +161,6 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -172,10 +169,7 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ipv6_route.ref.diff index b56890de0f..2fe46c8265 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ipv6_route.ref.diff @@ -1,6 +1,6 @@ ---- rt6/step6/show_ipv6_route.ref 2020-09-25 17:51:17.401419446 -0300 -+++ rt6/step7/show_ipv6_route.ref 2020-09-25 17:52:04.270031723 -0300 -@@ -143,9 +143,6 @@ +--- a/rt6/step6/show_ipv6_route.ref ++++ b/rt6/step7/show_ipv6_route.ref +@@ -152,9 +152,6 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -162,10 +159,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step7/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_mpls_table.ref.diff index ff043fb0bf..179a4f460b 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step7/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step6/show_mpls_table.ref 2020-09-25 17:51:14.893386692 -0300 -+++ rt6/step7/show_mpls_table.ref 2020-09-25 17:52:01.809999577 -0300 +--- a/rt6/step6/show_mpls_table.ref ++++ b/rt6/step7/show_mpls_table.ref @@ -166,49 +166,5 @@ "interface":"eth-rt5" } @@ -22,7 +22,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16050, - "nexthop":"10.0.7.4" - } - ] @@ -44,7 +44,7 @@ - "backupNexthops":[ - { - "type":"SR (IS-IS)", -- "outLabel":3, +- "outLabel":16051, - "interface":"eth-rt4" - } - ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ip_route.ref.diff index d0b25bffa3..9d5c440a22 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ip_route.ref.diff @@ -1,6 +1,6 @@ ---- rt6/step7/show_ip_route.ref 2020-09-25 17:52:03.018015363 -0300 -+++ rt6/step8/show_ip_route.ref 2020-09-25 17:53:21.035035298 -0300 -@@ -152,6 +152,9 @@ +--- a/rt6/step7/show_ip_route.ref ++++ b/rt6/step8/show_ip_route.ref +@@ -161,6 +161,9 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -169,7 +172,10 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ipv6_route.ref.diff index 203175510c..21cab20a47 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ipv6_route.ref.diff @@ -1,6 +1,6 @@ ---- rt6/step7/show_ipv6_route.ref 2020-09-25 17:52:04.270031723 -0300 -+++ rt6/step8/show_ipv6_route.ref 2020-09-25 17:53:22.239051045 -0300 -@@ -143,6 +143,9 @@ +--- a/rt6/step7/show_ipv6_route.ref ++++ b/rt6/step8/show_ipv6_route.ref +@@ -152,6 +152,9 @@ "active":true, "backupIndex":[ 0 @@ -10,3 +10,15 @@ ] } ], +@@ -159,7 +162,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step8/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_mpls_table.ref.diff index 535f30bf35..760c5542cb 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step8/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step7/show_mpls_table.ref 2020-09-25 17:52:01.809999577 -0300 -+++ rt6/step8/show_mpls_table.ref 2020-09-25 17:53:19.799019132 -0300 +--- a/rt6/step7/show_mpls_table.ref ++++ b/rt6/step8/show_mpls_table.ref @@ -166,5 +166,49 @@ "interface":"eth-rt5" } @@ -22,7 +22,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16050, + "nexthop":"10.0.7.4" + } + ] @@ -44,7 +44,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", -+ "outLabel":3, ++ "outLabel":16051, + "interface":"eth-rt4" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ip_route.ref.diff index e69de29bb2..ee296470c0 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ip_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ip_route.ref.diff @@ -0,0 +1,11 @@ +--- a/rt6/step8/show_ip_route.ref ++++ b/rt6/step9/show_ip_route.ref +@@ -174,7 +174,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ipv6_route.ref.diff index e69de29bb2..bebca4dcf1 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ipv6_route.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_ipv6_route.ref.diff @@ -0,0 +1,11 @@ +--- a/rt6/step8/show_ipv6_route.ref ++++ b/rt6/step9/show_ipv6_route.ref +@@ -164,7 +164,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step9/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_mpls_table.ref.diff index b6e5396554..57347d15be 100644 --- a/tests/topotests/isis-tilfa-topo1/rt6/step9/show_mpls_table.ref.diff +++ b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_mpls_table.ref.diff @@ -1,5 +1,5 @@ ---- rt6/step8/show_mpls_table.ref 2020-09-25 17:53:19.799019132 -0300 -+++ rt6/step9/show_mpls_table.ref 2020-09-25 17:54:37.492035644 -0300 +--- a/rt6/step8/show_mpls_table.ref ++++ b/rt6/step9/show_mpls_table.ref @@ -167,8 +167,8 @@ } ] @@ -11,7 +11,13 @@ "installed":true, "nexthops":[ { -@@ -189,8 +189,8 @@ +@@ -184,13 +184,13 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16500, + "nexthop":"10.0.7.4" } ] }, @@ -22,3 +28,12 @@ "installed":true, "nexthops":[ { +@@ -206,7 +206,7 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16501, + "interface":"eth-rt4" + } + ] diff --git a/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py b/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py index 6bc097b0e7..514ea53552 100755 --- a/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py +++ b/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py @@ -179,7 +179,7 @@ def setup_module(mod): router_list = tgen.routers() # For all registered routers, load the zebra configuration file - for rname, router in router_list.iteritems(): + for rname, router in router_list.items(): router.load_config( TopoRouter.RD_ZEBRA, os.path.join(CWD, '{}/zebra.conf'.format(rname)) diff --git a/tests/topotests/ldp-oc-acl-topo1/r1/ospfd.conf b/tests/topotests/ldp-oc-acl-topo1/r1/ospfd.conf index 87d5703d9e..877e14ff36 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r1/ospfd.conf +++ b/tests/topotests/ldp-oc-acl-topo1/r1/ospfd.conf @@ -8,4 +8,5 @@ router ospf int r1-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! diff --git a/tests/topotests/ldp-oc-acl-topo1/r1/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-acl-topo1/r1/show_ip_ospf_neighbor.json index 2c493173f5..aa3f74fc5f 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r1/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-acl-topo1/r1/show_ip_ospf_neighbor.json @@ -2,7 +2,7 @@ "neighbors":{ "2.2.2.2":[ { - "priority":1, + "priority":2, "state":"Full\/DR", "address":"10.0.1.2", "ifaceName":"r1-eth0:10.0.1.1" diff --git a/tests/topotests/ldp-oc-acl-topo1/r2/ospfd.conf b/tests/topotests/ldp-oc-acl-topo1/r2/ospfd.conf index 51317202bb..8cba1529e8 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r2/ospfd.conf +++ b/tests/topotests/ldp-oc-acl-topo1/r2/ospfd.conf @@ -8,8 +8,10 @@ router ospf int r2-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! int r2-eth1 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! diff --git a/tests/topotests/ldp-oc-acl-topo1/r2/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-acl-topo1/r2/show_ip_ospf_neighbor.json index 55f12359e5..aa68198957 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r2/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-acl-topo1/r2/show_ip_ospf_neighbor.json @@ -5,15 +5,12 @@ "priority":1, "state":"Full\/Backup", "address":"10.0.1.1", - "ifaceName":"r2-eth0:10.0.1.2", - "retransmitCounter":0, - "requestCounter":0, - "dbSummaryCounter":0 + "ifaceName":"r2-eth0:10.0.1.2" } ], "3.3.3.3":[ { - "priority":1, + "priority":2, "state":"Full\/Backup", "address":"10.0.2.3", "ifaceName":"r2-eth1:10.0.2.2" @@ -21,7 +18,7 @@ ], "4.4.4.4":[ { - "priority":1, + "priority":3, "state":"Full\/DR", "address":"10.0.2.4", "ifaceName":"r2-eth1:10.0.2.2" diff --git a/tests/topotests/ldp-oc-acl-topo1/r3/ospfd.conf b/tests/topotests/ldp-oc-acl-topo1/r3/ospfd.conf index 4566976b7b..0d3a74c4ac 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r3/ospfd.conf +++ b/tests/topotests/ldp-oc-acl-topo1/r3/ospfd.conf @@ -9,4 +9,5 @@ router ospf int r3-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! diff --git a/tests/topotests/ldp-oc-acl-topo1/r3/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-acl-topo1/r3/show_ip_ospf_neighbor.json index 24502ed813..905774fc46 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r3/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-acl-topo1/r3/show_ip_ospf_neighbor.json @@ -10,7 +10,7 @@ ], "4.4.4.4":[ { - "priority":1, + "priority":3, "state":"Full\/DR", "address":"10.0.2.4", "ifaceName":"r3-eth0:10.0.2.3" diff --git a/tests/topotests/ldp-oc-acl-topo1/r4/ospfd.conf b/tests/topotests/ldp-oc-acl-topo1/r4/ospfd.conf index 5aae885a12..7bbd228d02 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r4/ospfd.conf +++ b/tests/topotests/ldp-oc-acl-topo1/r4/ospfd.conf @@ -8,4 +8,5 @@ router ospf int r4-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 3 ! diff --git a/tests/topotests/ldp-oc-acl-topo1/r4/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-acl-topo1/r4/show_ip_ospf_neighbor.json index 794410522d..67593952ca 100644 --- a/tests/topotests/ldp-oc-acl-topo1/r4/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-acl-topo1/r4/show_ip_ospf_neighbor.json @@ -11,7 +11,7 @@ ], "3.3.3.3":[ { - "priority":1, + "priority":2, "state":"Full\/Backup", "address":"10.0.2.3", "ifaceName":"r4-eth0:10.0.2.4" diff --git a/tests/topotests/ldp-oc-topo1/r1/ospfd.conf b/tests/topotests/ldp-oc-topo1/r1/ospfd.conf index 87d5703d9e..877e14ff36 100644 --- a/tests/topotests/ldp-oc-topo1/r1/ospfd.conf +++ b/tests/topotests/ldp-oc-topo1/r1/ospfd.conf @@ -8,4 +8,5 @@ router ospf int r1-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! diff --git a/tests/topotests/ldp-oc-topo1/r1/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-topo1/r1/show_ip_ospf_neighbor.json index 2c493173f5..aa3f74fc5f 100644 --- a/tests/topotests/ldp-oc-topo1/r1/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-topo1/r1/show_ip_ospf_neighbor.json @@ -2,7 +2,7 @@ "neighbors":{ "2.2.2.2":[ { - "priority":1, + "priority":2, "state":"Full\/DR", "address":"10.0.1.2", "ifaceName":"r1-eth0:10.0.1.1" diff --git a/tests/topotests/ldp-oc-topo1/r2/ospfd.conf b/tests/topotests/ldp-oc-topo1/r2/ospfd.conf index 51317202bb..8cba1529e8 100644 --- a/tests/topotests/ldp-oc-topo1/r2/ospfd.conf +++ b/tests/topotests/ldp-oc-topo1/r2/ospfd.conf @@ -8,8 +8,10 @@ router ospf int r2-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! int r2-eth1 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! diff --git a/tests/topotests/ldp-oc-topo1/r2/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-topo1/r2/show_ip_ospf_neighbor.json index 55f12359e5..aa68198957 100644 --- a/tests/topotests/ldp-oc-topo1/r2/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-topo1/r2/show_ip_ospf_neighbor.json @@ -5,15 +5,12 @@ "priority":1, "state":"Full\/Backup", "address":"10.0.1.1", - "ifaceName":"r2-eth0:10.0.1.2", - "retransmitCounter":0, - "requestCounter":0, - "dbSummaryCounter":0 + "ifaceName":"r2-eth0:10.0.1.2" } ], "3.3.3.3":[ { - "priority":1, + "priority":2, "state":"Full\/Backup", "address":"10.0.2.3", "ifaceName":"r2-eth1:10.0.2.2" @@ -21,7 +18,7 @@ ], "4.4.4.4":[ { - "priority":1, + "priority":3, "state":"Full\/DR", "address":"10.0.2.4", "ifaceName":"r2-eth1:10.0.2.2" diff --git a/tests/topotests/ldp-oc-topo1/r3/ospfd.conf b/tests/topotests/ldp-oc-topo1/r3/ospfd.conf index 4566976b7b..0d3a74c4ac 100644 --- a/tests/topotests/ldp-oc-topo1/r3/ospfd.conf +++ b/tests/topotests/ldp-oc-topo1/r3/ospfd.conf @@ -9,4 +9,5 @@ router ospf int r3-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! diff --git a/tests/topotests/ldp-oc-topo1/r3/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-topo1/r3/show_ip_ospf_neighbor.json index 24502ed813..905774fc46 100644 --- a/tests/topotests/ldp-oc-topo1/r3/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-topo1/r3/show_ip_ospf_neighbor.json @@ -10,7 +10,7 @@ ], "4.4.4.4":[ { - "priority":1, + "priority":3, "state":"Full\/DR", "address":"10.0.2.4", "ifaceName":"r3-eth0:10.0.2.3" diff --git a/tests/topotests/ldp-oc-topo1/r4/ospfd.conf b/tests/topotests/ldp-oc-topo1/r4/ospfd.conf index 5aae885a12..7bbd228d02 100644 --- a/tests/topotests/ldp-oc-topo1/r4/ospfd.conf +++ b/tests/topotests/ldp-oc-topo1/r4/ospfd.conf @@ -8,4 +8,5 @@ router ospf int r4-eth0 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 3 ! diff --git a/tests/topotests/ldp-oc-topo1/r4/show_ip_ospf_neighbor.json b/tests/topotests/ldp-oc-topo1/r4/show_ip_ospf_neighbor.json index 794410522d..67593952ca 100644 --- a/tests/topotests/ldp-oc-topo1/r4/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-oc-topo1/r4/show_ip_ospf_neighbor.json @@ -11,7 +11,7 @@ ], "3.3.3.3":[ { - "priority":1, + "priority":2, "state":"Full\/Backup", "address":"10.0.2.3", "ifaceName":"r4-eth0:10.0.2.4" diff --git a/tests/topotests/ldp-vpls-topo1/r1/ospfd.conf b/tests/topotests/ldp-vpls-topo1/r1/ospfd.conf index 76ea32fb61..a66fb92ba3 100644 --- a/tests/topotests/ldp-vpls-topo1/r1/ospfd.conf +++ b/tests/topotests/ldp-vpls-topo1/r1/ospfd.conf @@ -8,8 +8,10 @@ router ospf int r1-eth1 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! int r1-eth2 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! diff --git a/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.json b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.json index 6e6c3c8cb8..7e281abb5f 100644 --- a/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-vpls-topo1/r1/show_ip_ospf_neighbor.json @@ -4,8 +4,8 @@ { "dbSummaryCounter": 0, "retransmitCounter": 0, - "priority": 1, - "state": "Full/DR", + "priority": 2, + "state": "Full\/DR", "address": "10.0.1.2", "ifaceName": "r1-eth1:10.0.1.1", "requestCounter": 0 @@ -15,8 +15,8 @@ { "dbSummaryCounter": 0, "retransmitCounter": 0, - "priority": 1, - "state": "Full/DR", + "priority": 2, + "state": "Full\/DR", "address": "10.0.2.3", "ifaceName": "r1-eth2:10.0.2.1", "requestCounter": 0 diff --git a/tests/topotests/ldp-vpls-topo1/r2/ospfd.conf b/tests/topotests/ldp-vpls-topo1/r2/ospfd.conf index 7b3ddfe371..b4692feec8 100644 --- a/tests/topotests/ldp-vpls-topo1/r2/ospfd.conf +++ b/tests/topotests/ldp-vpls-topo1/r2/ospfd.conf @@ -8,8 +8,10 @@ router ospf int r2-eth1 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! int r2-eth2 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 1 ! diff --git a/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.json b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.json index b5b10cc535..22fd98f519 100644 --- a/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-vpls-topo1/r2/show_ip_ospf_neighbor.json @@ -3,7 +3,7 @@ "1.1.1.1": [ { "priority":1, - "state":"Full/Backup", + "state":"Full\/Backup", "address":"10.0.1.1", "ifaceName":"r2-eth1:10.0.1.2", "retransmitCounter":0, @@ -13,8 +13,8 @@ ], "3.3.3.3": [ { - "priority":1, - "state":"Full/DR", + "priority":2, + "state":"Full\/DR", "address":"10.0.3.3", "ifaceName":"r2-eth2:10.0.3.2", "retransmitCounter":0, diff --git a/tests/topotests/ldp-vpls-topo1/r3/ospfd.conf b/tests/topotests/ldp-vpls-topo1/r3/ospfd.conf index b424f2e108..2413bfa9d5 100644 --- a/tests/topotests/ldp-vpls-topo1/r3/ospfd.conf +++ b/tests/topotests/ldp-vpls-topo1/r3/ospfd.conf @@ -8,8 +8,10 @@ router ospf int r3-eth1 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! int r3-eth2 ip ospf hello-interval 2 ip ospf dead-interval 10 + ip ospf priority 2 ! diff --git a/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.json b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.json index bc7bb1e894..970eb2fc1d 100644 --- a/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.json +++ b/tests/topotests/ldp-vpls-topo1/r3/show_ip_ospf_neighbor.json @@ -3,7 +3,7 @@ "1.1.1.1": [ { "priority":1, - "state":"Full/Backup", + "state":"Full\/Backup", "address":"10.0.2.1", "ifaceName":"r3-eth1:10.0.2.3", "retransmitCounter":0, @@ -14,7 +14,7 @@ "2.2.2.2": [ { "priority":1, - "state":"Full/Backup", + "state":"Full\/Backup", "address":"10.0.3.2", "ifaceName":"r3-eth2:10.0.3.3", "retransmitCounter":0, diff --git a/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.pdf b/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.pdf Binary files differindex dd7c6f74d0..4d26732ea7 100644 --- a/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.pdf +++ b/tests/topotests/ldp-vpls-topo1/test_ldp_vpls_topo1.pdf diff --git a/tests/topotests/lib/bgprib.py b/tests/topotests/lib/bgprib.py index a23092de83..abab9600a1 100644 --- a/tests/topotests/lib/bgprib.py +++ b/tests/topotests/lib/bgprib.py @@ -45,7 +45,7 @@ class BgpRib: def routes_include_wanted(self, pfxtbl, want, debug): # helper function to RequireVpnRoutes - for pfx in pfxtbl.iterkeys(): + for pfx in pfxtbl.keys(): if debug: self.log("trying pfx %s" % pfx) if pfx != want["p"]: @@ -107,7 +107,7 @@ class BgpRib: found = 0 if debug: self.log("want rd %s" % want["rd"]) - for rd in rds.iterkeys(): + for rd in rds.keys(): if rd != want["rd"]: continue if debug: diff --git a/tests/topotests/lib/lutil.py b/tests/topotests/lib/lutil.py index 1fb4f48b0f..9cbea67af1 100644 --- a/tests/topotests/lib/lutil.py +++ b/tests/topotests/lib/lutil.py @@ -23,7 +23,7 @@ import time import datetime import json import math -from topolog import logger +from lib.topolog import logger from mininet.net import Mininet @@ -58,14 +58,14 @@ class lUtil: def log(self, str, level=6): if self.l_level > 0: if self.fout == "": - self.fout = open(self.fout_name, "w", 0) + self.fout = open(self.fout_name, "w") self.fout.write(str + "\n") if level <= self.l_level: print(str) def summary(self, str): if self.fsum == "": - self.fsum = open(self.fsum_name, "w", 0) + self.fsum = open(self.fsum_name, "w") self.fsum.write( "\ ******************************************************************************\n" @@ -380,7 +380,8 @@ def luInclude(filename, CallOnFail=None): LUtil.setCallOnFail(CallOnFail) if filename.endswith(".py"): LUtil.log("luInclude: execfile " + tstFile) - execfile(tstFile) + with open(tstFile) as infile: + exec(infile.read()) else: LUtil.log("luInclude: execTestFile " + tstFile) LUtil.execTestFile(tstFile) diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py index 3e92bd7565..7ae4223f72 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -336,7 +336,7 @@ class Topogen(object): for gear in self.gears.values(): errors += gear.stop() if len(errors) > 0: - assert "Errors found post shutdown - details follow:" == 0, errors + logger.error("Errors found post shutdown - details follow: {}".format(errors)) self.net.stop() @@ -714,7 +714,7 @@ class TopoRouter(TopoGear): """ self.logger.debug("stopping") self.__stop_internal(False, False) - return self.__stop_internal() + return self.__stop_internal(True, False) def startDaemons(self, daemons): """ diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 4b18862101..7047c52b18 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -910,31 +910,63 @@ def sleep(amount, reason=None): time.sleep(amount) -def checkAddressSanitizerError(output, router, component): +def checkAddressSanitizerError(output, router, component, logdir=""): "Checks for AddressSanitizer in output. If found, then logs it and returns true, false otherwise" - addressSantizerError = re.search( - "(==[0-9]+==)ERROR: AddressSanitizer: ([^\s]*) ", output - ) - if addressSantizerError: + def processAddressSanitizerError(asanErrorRe, output, router, component): sys.stderr.write( "%s: %s triggered an exception by AddressSanitizer\n" % (router, component) ) # Sanitizer Error found in log - pidMark = addressSantizerError.group(1) + pidMark = asanErrorRe.group(1) addressSantizerLog = re.search( "%s(.*)%s" % (pidMark, pidMark), output, re.DOTALL ) if addressSantizerLog: - callingTest = os.path.basename( - sys._current_frames().values()[0].f_back.f_back.f_globals["__file__"] - ) - callingProc = sys._getframe(2).f_code.co_name + # Find Calling Test. Could be multiple steps back + testframe=sys._current_frames().values()[0] + level=0 + while level < 10: + test=os.path.splitext(os.path.basename(testframe.f_globals["__file__"]))[0] + if (test != "topotest") and (test != "topogen"): + # Found the calling test + callingTest=os.path.basename(testframe.f_globals["__file__"]) + break + level=level+1 + testframe=testframe.f_back + if (level >= 10): + # somehow couldn't find the test script. + callingTest="unknownTest" + # + # Now finding Calling Procedure + level=0 + while level < 20: + callingProc=sys._getframe(level).f_code.co_name + if ((callingProc != "processAddressSanitizerError") and + (callingProc != "checkAddressSanitizerError") and + (callingProc != "checkRouterCores") and + (callingProc != "stopRouter") and + (callingProc != "__stop_internal") and + (callingProc != "stop") and + (callingProc != "stop_topology") and + (callingProc != "checkRouterRunning") and + (callingProc != "check_router_running") and + (callingProc != "routers_have_failure")): + # Found the calling test + break + level=level+1 + if (level >= 20): + # something wrong - couldn't found the calling test function + callingProc="unknownProc" with open("/tmp/AddressSanitzer.txt", "a") as addrSanFile: sys.stderr.write( + "AddressSanitizer error in topotest `%s`, test `%s`, router `%s`\n\n" + % (callingTest, callingProc, router) + ) + sys.stderr.write( "\n".join(addressSantizerLog.group(1).splitlines()) + "\n" ) - addrSanFile.write("## Error: %s\n\n" % addressSantizerError.group(2)) + addrSanFile.write("## Error: %s\n\n" % asanErrorRe.group(2)) addrSanFile.write( "### AddressSanitizer error in topotest `%s`, test `%s`, router `%s`\n\n" % (callingTest, callingProc, router) @@ -945,7 +977,29 @@ def checkAddressSanitizerError(output, router, component): + "\n" ) addrSanFile.write("\n---------------\n") + return + + + addressSantizerError = re.search( + "(==[0-9]+==)ERROR: AddressSanitizer: ([^\s]*) ", output + ) + if addressSantizerError: + processAddressSanitizerError(addressSantizerError, output, router, component) return True + + # No Address Sanitizer Error in Output. Now check for AddressSanitizer daemon file + if logdir: + filepattern=logdir+"/"+router+"/"+component+".asan.*" + sys.stderr.write("Log check for %s on %s, pattern %s\n" % (component, router, filepattern)) + for file in glob.glob(filepattern): + with open(file, "r") as asanErrorFile: + asanError=asanErrorFile.read() + addressSantizerError = re.search( + "(==[0-9]+==)ERROR: AddressSanitizer: ([^\s]*) ", asanError + ) + if addressSantizerError: + processAddressSanitizerError(addressSantizerError, asanError, router, component) + return True return False @@ -1011,7 +1065,7 @@ class Router(Node): if self.logdir is None: cur_test = os.environ["PYTEST_CURRENT_TEST"] self.logdir = "/tmp/topotests/" + cur_test[ - 0 : cur_test.find(".py") + cur_test.find("/")+1 : cur_test.find(".py") ].replace("/", ".") # If the logdir is not created, then create it and set the @@ -1019,6 +1073,8 @@ class Router(Node): if not os.path.isdir(self.logdir): os.system("mkdir -p " + self.logdir + "/" + name) os.system("chmod -R go+rw /tmp/topotests") + # Erase logs of previous run + os.system("rm -rf " + self.logdir + "/" + name) self.daemondir = None self.hasmpls = False @@ -1185,7 +1241,7 @@ class Router(Node): if self.checkRouterVersion("<", minErrorVersion): # ignore errors in old versions errors = "" - if assertOnError and len(errors) > 0: + if assertOnError and errors is not None and len(errors) > 0: assert "Errors found - details follow:" == 0, errors return errors @@ -1324,6 +1380,7 @@ class Router(Node): # Starts actual daemons without init (ie restart) # cd to per node directory + self.cmd("install -d {}/{}".format(self.logdir, self.name)) self.cmd("cd {}/{}".format(self.logdir, self.name)) self.cmd("umask 000") @@ -1353,7 +1410,7 @@ class Router(Node): zebra_path = os.path.join(self.daemondir, "zebra") zebra_option = self.daemons_options["zebra"] self.cmd( - "{0} {1} --log stdout --log-level debug -s 90000000 -d > zebra.out 2> zebra.err".format( + "ASAN_OPTIONS=log_path=zebra.asan {0} {1} --log file:zebra.log --log-level debug -s 90000000 -d > zebra.out 2> zebra.err".format( zebra_path, zebra_option, self.logdir, self.name ) ) @@ -1368,7 +1425,7 @@ class Router(Node): staticd_path = os.path.join(self.daemondir, "staticd") staticd_option = self.daemons_options["staticd"] self.cmd( - "{0} {1} --log stdout --log-level debug -d > staticd.out 2> staticd.err".format( + "ASAN_OPTIONS=log_path=staticd.asan {0} {1} --log file:staticd.log --log-level debug -d > staticd.out 2> staticd.err".format( staticd_path, staticd_option, self.logdir, self.name ) ) @@ -1392,7 +1449,7 @@ class Router(Node): daemon_path = os.path.join(self.daemondir, daemon) self.cmd( - "{0} {1} --log stdout --log-level debug -d > {2}.out 2> {2}.err".format( + "ASAN_OPTIONS=log_path={2}.asan {0} {1} --log file:{2}.log --log-level debug -d > {2}.out 2> {2}.err".format( daemon_path, self.daemons_options.get(daemon, ""), daemon ) ) @@ -1514,7 +1571,7 @@ class Router(Node): reportMade = True # Look for AddressSanitizer Errors and append to /tmp/AddressSanitzer.txt if found if checkAddressSanitizerError( - self.getStdErr(daemon), self.name, daemon + self.getStdErr(daemon), self.name, daemon, self.logdir ): sys.stderr.write( "%s: Daemon %s killed by AddressSanitizer" % (self.name, daemon) @@ -1578,7 +1635,7 @@ class Router(Node): # Look for AddressSanitizer Errors and append to /tmp/AddressSanitzer.txt if found if checkAddressSanitizerError( - self.getStdErr(daemon), self.name, daemon + self.getStdErr(daemon), self.name, daemon, self.logdir ): return "%s: Daemon %s not running - killed by AddressSanitizer" % ( self.name, diff --git a/tests/topotests/route-scale/r1/installed.routes.json b/tests/topotests/route-scale/r1/installed.routes.json index 24a45dca81..25d209f9eb 100644 --- a/tests/topotests/route-scale/r1/installed.routes.json +++ b/tests/topotests/route-scale/r1/installed.routes.json @@ -6,11 +6,11 @@ "type":"connected" }, { - "fib":200000, - "rib":200000, + "fib":1000000, + "rib":1000000, "type":"sharp" } ], - "routesTotal":200032, - "routesTotalFib":200032 + "routesTotal":1000032, + "routesTotalFib":1000032 } diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 243a7c943f..ace4139551 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1720,11 +1720,16 @@ DEFUNSH(VTYSH_BGPD, address_family_evpn, address_family_evpn_cmd, } #if defined(HAVE_CUMULUS) +#if CONFDATE > 20211115 +CPP_NOTICE("Use of `address-family evpn` is deprecated please remove don't forget frr-reload.py") +#endif DEFUNSH_HIDDEN(VTYSH_BGPD, address_family_evpn2, address_family_evpn2_cmd, "address-family evpn", "Enter Address Family command mode\n" "EVPN Address family\n") { + vty_out(vty, + "This command is deprecated please convert to `address-family l2vpn evpn`\n"); vty->node = BGP_EVPN_NODE; return CMD_SUCCESS; } @@ -2447,28 +2452,64 @@ DEFUNSH(VTYSH_INTERFACE, vtysh_quit_interface, vtysh_quit_interface_cmd, "quit", return vtysh_exit_interface(self, vty, argc, argv); } -DEFUN (vtysh_show_poll, - vtysh_show_poll_cmd, - "show thread poll", - SHOW_STR - "Thread information\n" - "Thread Poll Information\n") +static char *do_prepend(struct vty *vty, struct cmd_token **argv, int argc) +{ + const char *argstr[argc + 1]; + int i, off = 0; + + if (vty->node != VIEW_NODE) { + off = 1; + argstr[0] = "do"; + } + + for (i = 0; i < argc; i++) + argstr[i + off] = argv[i]->arg; + + return frrstr_join(argstr, argc + off, " "); +} + +static int show_per_daemon(struct vty *vty, struct cmd_token **argv, int argc, + const char *headline) { unsigned int i; int ret = CMD_SUCCESS; - char line[100]; + char *line = do_prepend(vty, argv, argc); - snprintf(line, sizeof(line), "do show thread poll\n"); for (i = 0; i < array_size(vtysh_client); i++) if (vtysh_client[i].fd >= 0) { - vty_out(vty, "Thread statistics for %s:\n", - vtysh_client[i].name); + vty_out(vty, headline, vtysh_client[i].name); ret = vtysh_client_execute(&vtysh_client[i], line); vty_out(vty, "\n"); } + + XFREE(MTYPE_TMP, line); + return ret; } +static int show_one_daemon(struct vty *vty, struct cmd_token **argv, int argc, + const char *name) +{ + int ret; + char *line = do_prepend(vty, argv, argc); + + ret = vtysh_client_execute_name(name, line); + + XFREE(MTYPE_TMP, line); + + return ret; +} + +DEFUN (vtysh_show_poll, + vtysh_show_poll_cmd, + "show thread poll", + SHOW_STR + "Thread information\n" + "Thread Poll Information\n") +{ + return show_per_daemon(vty, argv, argc, "Thread statistics for %s:\n"); +} + #ifndef EXCLUDE_CPU_TIME DEFUN (vtysh_show_thread, vtysh_show_thread_cmd, @@ -2478,23 +2519,7 @@ DEFUN (vtysh_show_thread, "Thread CPU usage\n" "Display filter (rwtexb)\n") { - unsigned int i; - int idx = 0; - int ret = CMD_SUCCESS; - char line[100]; - - const char *filter = - argv_find(argv, argc, "FILTER", &idx) ? argv[idx]->arg : ""; - - snprintf(line, sizeof(line), "do show thread cpu %s\n", filter); - for (i = 0; i < array_size(vtysh_client); i++) - if (vtysh_client[i].fd >= 0) { - vty_out(vty, "Thread statistics for %s:\n", - vtysh_client[i].name); - ret = vtysh_client_execute(&vtysh_client[i], line); - vty_out(vty, "\n"); - } - return ret; + return show_per_daemon(vty, argv, argc, "Thread statistics for %s:\n"); } #endif @@ -2504,19 +2529,8 @@ DEFUN (vtysh_show_work_queues, SHOW_STR "Work Queue information\n") { - unsigned int i; - int ret = CMD_SUCCESS; - char line[] = "do show work-queues\n"; - - for (i = 0; i < array_size(vtysh_client); i++) - if (vtysh_client[i].fd >= 0) { - vty_out(vty, "Work queue statistics for %s:\n", - vtysh_client[i].name); - ret = vtysh_client_execute(&vtysh_client[i], line); - vty_out(vty, "\n"); - } - - return ret; + return show_per_daemon(vty, argv, argc, + "Work queue statistics for %s:\n"); } DEFUN (vtysh_show_work_queues_daemon, @@ -2526,10 +2540,7 @@ DEFUN (vtysh_show_work_queues_daemon, "Work Queue information\n" DAEMONS_STR) { - int idx_protocol = 2; - - return vtysh_client_execute_name(argv[idx_protocol]->text, - "show work-queues\n"); + return show_one_daemon(vty, argv, argc - 1, argv[argc - 1]->text); } DEFUNSH(VTYSH_ZEBRA, vtysh_link_params, vtysh_link_params_cmd, "link-params", @@ -2547,21 +2558,6 @@ DEFUNSH(VTYSH_ZEBRA, exit_link_params, exit_link_params_cmd, "exit-link-params", return CMD_SUCCESS; } -static int show_per_daemon(const char *line, const char *headline) -{ - unsigned int i; - int ret = CMD_SUCCESS; - - for (i = 0; i < array_size(vtysh_client); i++) - if (vtysh_client[i].fd >= 0) { - vty_out(vty, headline, vtysh_client[i].name); - ret = vtysh_client_execute(&vtysh_client[i], line); - vty_out(vty, "\n"); - } - - return ret; -} - DEFUNSH_HIDDEN (0x00, vtysh_debug_all, vtysh_debug_all_cmd, @@ -2579,7 +2575,7 @@ DEFUN (vtysh_show_debugging, SHOW_STR DEBUG_STR) { - return show_per_daemon("do show debugging\n", ""); + return show_per_daemon(vty, argv, argc, ""); } DEFUN (vtysh_show_debugging_hashtable, @@ -2590,6 +2586,8 @@ DEFUN (vtysh_show_debugging_hashtable, "Statistics about hash tables\n" "Statistics about hash tables\n") { + bool stats = strmatch(argv[argc - 1]->text, "statistics"); + vty_out(vty, "\n"); vty_out(vty, "Load factor (LF) - average number of elements across all buckets\n"); @@ -2601,7 +2599,7 @@ DEFUN (vtysh_show_debugging_hashtable, "and indicates the typical deviation of bucket chain length\n"); vty_out(vty, "from the value in the corresponding load factor.\n\n"); - return show_per_daemon("do show debugging hashtable\n", + return show_per_daemon(vty, argv, stats ? argc - 1 : argc, "Hashtable statistics for %s:\n"); } @@ -2621,12 +2619,7 @@ DEFUN (vtysh_show_error_code, /* If it's not a shared code, send it to all the daemons */ if (arg < LIB_FERR_START || arg > LIB_FERR_END) { - char *fcmd = argv_concat(argv, argc, 0); - char cmd[256]; - - snprintf(cmd, sizeof(cmd), "do %s", fcmd); - show_per_daemon(cmd, ""); - XFREE(MTYPE_TMP, fcmd); + show_per_daemon(vty, argv, argc, ""); /* Otherwise, print it ourselves to avoid duplication */ } else { bool json = strmatch(argv[argc - 1]->text, "json"); @@ -2659,11 +2652,7 @@ DEFUN (show_yang_operational_data, "YANG module translator\n" DAEMONS_STR) { - int idx_protocol = argc - 1; - char *fcmd = argv_concat(argv, argc - 1, 0); - int ret = vtysh_client_execute_name(argv[idx_protocol]->text, fcmd); - XFREE(MTYPE_TMP, fcmd); - return ret; + return show_one_daemon(vty, argv, argc - 1, argv[argc - 1]->text); } DEFUNSH(VTYSH_ALL, debug_nb, @@ -2696,7 +2685,7 @@ DEFUN (vtysh_show_memory, SHOW_STR "Memory statistics\n") { - return show_per_daemon("do show memory\n", "Memory statistics for %s:\n"); + return show_per_daemon(vty, argv, argc, "Memory statistics for %s:\n"); } DEFUN (vtysh_show_modules, @@ -2705,8 +2694,7 @@ DEFUN (vtysh_show_modules, SHOW_STR "Loaded modules\n") { - return show_per_daemon("do show modules\n", - "Module information for %s:\n"); + return show_per_daemon(vty, argv, argc, "Module information for %s:\n"); } /* Logging commands. */ @@ -2716,7 +2704,7 @@ DEFUN (vtysh_show_logging, SHOW_STR "Show current logging configuration\n") { - return show_per_daemon("do show logging\n", + return show_per_daemon(vty, argv, argc, "Logging configuration for %s:\n"); } @@ -4279,7 +4267,7 @@ void vtysh_init_vty(void) install_element(CONFIG_NODE, &vtysh_debug_memstats_cmd); /* northbound */ - install_element(VIEW_NODE, &show_yang_operational_data_cmd); + install_element(ENABLE_NODE, &show_yang_operational_data_cmd); install_element(ENABLE_NODE, &debug_nb_cmd); install_element(CONFIG_NODE, &debug_nb_cmd); diff --git a/yang/frr-filter.yang b/yang/frr-filter.yang index 400a093178..eb84dd7460 100644 --- a/yang/frr-filter.yang +++ b/yang/frr-filter.yang @@ -154,29 +154,33 @@ module frr-filter { } } case cisco { - leaf host { - description "Host to match"; - type inet:ipv4-address; - } - container network { - leaf address { - mandatory true; - description "Network address part."; + choice standard-value { + description "Source value to match"; + + leaf host { + description "Host to match"; type inet:ipv4-address; } - leaf mask { - mandatory true; - description "Network mask/wildcard part."; - type inet:ipv4-address; + container network { + leaf address { + mandatory true; + description "Network address part."; + type inet:ipv4-address; + } + leaf mask { + mandatory true; + description "Network mask/wildcard part."; + type inet:ipv4-address; + } + } + leaf source-any { + /* + * Was `any`, however it conflicts with `any` leaf + * outside this choice. + */ + description "Match any"; + type empty; } - } - leaf source-any { - /* - * Was `any`, however it conflicts with `any` leaf - * outside this choice. - */ - description "Match any"; - type empty; } choice extended-value { diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index 692dfca5d7..b08adc5541 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -1024,8 +1024,8 @@ static void zebra_evpn_nhg_update(struct zebra_evpn_es *es) nh_ids[i].id); strlcat(nh_str, nh_buf, sizeof(nh_str)); } - zlog_debug("es %s nhg 0x%x add %s", - es->esi_str, es->nhg_id, nh_str); + zlog_debug("es %s nhg %u add %s", es->esi_str, + es->nhg_id, nh_str); } es->flags |= ZEBRA_EVPNES_NHG_ACTIVE; @@ -1040,8 +1040,8 @@ static void zebra_evpn_nhg_update(struct zebra_evpn_es *es) } else { if (es->flags & ZEBRA_EVPNES_NHG_ACTIVE) { if (IS_ZEBRA_DEBUG_EVPN_MH_NH) - zlog_debug("es %s nhg 0x%x del", - es->esi_str, es->nhg_id); + zlog_debug("es %s nhg %u del", es->esi_str, + es->nhg_id); es->flags &= ~ZEBRA_EVPNES_NHG_ACTIVE; /* remove backup NHG from the br-port */ if ((es->flags & ZEBRA_EVPNES_LOCAL)) @@ -1065,9 +1065,8 @@ static void zebra_evpn_nh_add(struct zebra_evpn_es_vtep *es_vtep) return; if (IS_ZEBRA_DEBUG_EVPN_MH_NH) - zlog_debug("es %s vtep %pI4 nh 0x%x add", - es_vtep->es->esi_str, - &es_vtep->vtep_ip, es_vtep->nh_id); + zlog_debug("es %s vtep %pI4 nh %u add", es_vtep->es->esi_str, + &es_vtep->vtep_ip, es_vtep->nh_id); /* install the NH */ kernel_upd_mac_nh(es_vtep->nh_id, es_vtep->vtep_ip); /* add the NH to the parent NHG */ @@ -1082,9 +1081,8 @@ static void zebra_evpn_nh_del(struct zebra_evpn_es_vtep *es_vtep) return; if (IS_ZEBRA_DEBUG_EVPN_MH_NH) - zlog_debug("es %s vtep %pI4 nh 0x%x del", - es_vtep->es->esi_str, - &es_vtep->vtep_ip, es_vtep->nh_id); + zlog_debug("es %s vtep %pI4 nh %u del", es_vtep->es->esi_str, + &es_vtep->vtep_ip, es_vtep->nh_id); nh_id = es_vtep->nh_id; es_vtep->nh_id = 0; @@ -1427,7 +1425,7 @@ static struct zebra_evpn_es *zebra_evpn_es_new(esi_t *esi) es->nhg_id = zebra_evpn_nhid_alloc(true); if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("es %s nhg 0x%x new", es->esi_str, es->nhg_id); + zlog_debug("es %s nhg %u new", es->esi_str, es->nhg_id); return es; } @@ -1667,8 +1665,8 @@ static void zebra_evpn_es_local_info_set(struct zebra_evpn_es *es, return; if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("local es %s add; nhg 0x%x if %s", - es->esi_str, es->nhg_id, zif->ifp->name); + zlog_debug("local es %s add; nhg %u if %s", es->esi_str, + es->nhg_id, zif->ifp->name); es->flags |= ZEBRA_EVPNES_LOCAL; listnode_init(&es->local_es_listnode, es); @@ -1778,9 +1776,8 @@ static void zebra_evpn_local_es_del(struct zebra_evpn_es **esp) if (IS_ZEBRA_DEBUG_EVPN_MH_ES) { zif = es->zif; - zlog_debug("local es %s del; nhg 0x%x if %s", - es->esi_str, es->nhg_id, - zif ? zif->ifp->name : "-"); + zlog_debug("local es %s del; nhg %u if %s", es->esi_str, + es->nhg_id, zif ? zif->ifp->name : "-"); } /* remove all ES-EVIs associated with the ES */ @@ -1804,15 +1801,15 @@ static void zebra_evpn_es_remote_info_re_eval(struct zebra_evpn_es **esp) if (!(es->flags & ZEBRA_EVPNES_REMOTE)) { es->flags |= ZEBRA_EVPNES_REMOTE; if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("remote es %s add; nhg 0x%x", - es->esi_str, es->nhg_id); + zlog_debug("remote es %s add; nhg %u", + es->esi_str, es->nhg_id); } } else { if (es->flags & ZEBRA_EVPNES_REMOTE) { es->flags &= ~ZEBRA_EVPNES_REMOTE; if (IS_ZEBRA_DEBUG_EVPN_MH_ES) - zlog_debug("remote es %s del; nhg 0x%x", - es->esi_str, es->nhg_id); + zlog_debug("remote es %s del; nhg %u", + es->esi_str, es->nhg_id); zebra_evpn_es_free(esp); } } @@ -2398,7 +2395,7 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty, vty_out(vty, " DF: status: %s preference: %u\n", (es->flags & ZEBRA_EVPNES_NON_DF) ? "non-df" : "df", es->df_pref); - vty_out(vty, " Nexthop group: 0x%x\n", es->nhg_id); + vty_out(vty, " Nexthop group: %u\n", es->nhg_id); vty_out(vty, " VTEPs:\n"); for (ALL_LIST_ELEMENTS_RO(es->es_vtep_list, node, es_vtep)) { vty_out(vty, " %pI4", @@ -2409,7 +2406,7 @@ static void zebra_evpn_es_show_entry_detail(struct vty *vty, alg_buf, sizeof(alg_buf)), es_vtep->df_pref); - vty_out(vty, " nh: 0x%x\n", es_vtep->nh_id); + vty_out(vty, " nh: %u\n", es_vtep->nh_id); } vty_out(vty, "\n"); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 569b23573c..88f6ec2634 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3728,6 +3728,7 @@ static int handle_pw_result(struct zebra_dplane_ctx *ctx) } done: + dplane_ctx_fini(&ctx); return 0; } |
