diff --git a/doc/user/isisd.rst b/doc/user/isisd.rst index 8cbbe0809fa3..df7c72f8dcb6 100644 --- a/doc/user/isisd.rst +++ b/doc/user/isisd.rst @@ -355,6 +355,11 @@ ISIS interface Enable or disable :rfc:`5303` Three-Way Handshake for P2P adjacencies. Three-Way Handshake is enabled by default. +.. index:: [no] isis fast-reroute ti-lfa [level-1|level-2] [node-protection] +.. clicmd:: [no] isis fast-reroute ti-lfa [level-1|level-2] [node-protection] + + Enable per-prefix TI-LFA fast reroute link or node protection. + .. _showing-isis-information: Showing ISIS information @@ -418,8 +423,8 @@ Showing ISIS information Show topology IS-IS paths to Intermediate Systems, globally, in area (level-1) or domain (level-2). -.. index:: show isis route [level-1|level-2] -.. clicmd:: show isis route [level-1|level-2] +.. index:: show isis route [level-1|level-2] [backup] +.. clicmd:: show isis route [level-1|level-2] [backup] Show the ISIS routing table, as determined by the most recent SPF calculation. @@ -633,6 +638,14 @@ Debugging ISIS IS-IS Segment Routing events. +.. index:: debug isis ti-lfa +.. clicmd:: debug isis ti-lfa + +.. index:: no debug isis ti-lfa +.. clicmd:: no debug isis ti-lfa + + IS-IS TI-LFA events. + .. index:: show debugging isis .. clicmd:: show debugging isis diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h index 48afd24b6d82..b4b03bf6b902 100644 --- a/isisd/isis_circuit.h +++ b/isisd/isis_circuit.h @@ -141,6 +141,8 @@ struct isis_circuit { bool disable_threeway_adj; struct bfd_info *bfd_info; struct ldp_sync_info *ldp_sync_info; + bool tilfa_protection[ISIS_LEVELS]; + bool tilfa_node_protection[ISIS_LEVELS]; /* * Counters as in 10589--11.2.5.9 */ diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index d303cbe98d03..a270636dde05 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -2367,6 +2367,102 @@ void cli_show_ip_isis_priority(struct vty *vty, struct lyd_node *dnode, } } +/* + * XPath: /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/ti-lfa/enable + */ +DEFPY(isis_ti_lfa, isis_ti_lfa_cmd, + "[no] isis fast-reroute ti-lfa [level-1|level-2]$level [node-protection$node_protection]", + NO_STR + "IS-IS routing protocol\n" + "Interface IP Fast-reroute configuration\n" + "Enable TI-LFA computation\n" + "Enable TI-LFA computation for Level 1 only\n" + "Enable TI-LFA computation for Level 2 only\n" + "Protect against node failures\n") +{ + if (!level || strmatch(level, "level-1")) { + if (no) { + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable", + NB_OP_MODIFY, "false"); + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection", + NB_OP_MODIFY, "false"); + } else { + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable", + NB_OP_MODIFY, "true"); + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection", + NB_OP_MODIFY, + node_protection ? "true" : "false"); + } + } + if (!level || strmatch(level, "level-2")) { + if (no) { + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable", + NB_OP_MODIFY, "false"); + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection", + NB_OP_MODIFY, "false"); + } else { + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable", + NB_OP_MODIFY, "true"); + nb_cli_enqueue_change( + vty, + "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection", + NB_OP_MODIFY, + node_protection ? "true" : "false"); + } + } + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_ip_isis_ti_lfa(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + bool l1_enabled, l2_enabled; + bool l1_node_protection, l2_node_protection; + + l1_enabled = yang_dnode_get_bool(dnode, "./level-1/ti-lfa/enable"); + l2_enabled = yang_dnode_get_bool(dnode, "./level-2/ti-lfa/enable"); + l1_node_protection = + yang_dnode_get_bool(dnode, "./level-1/ti-lfa/node-protection"); + l2_node_protection = + yang_dnode_get_bool(dnode, "./level-2/ti-lfa/node-protection"); + + if (l1_enabled == l2_enabled + && l1_node_protection == l2_node_protection) { + vty_out(vty, " isis fast-reroute ti-lfa"); + if (l1_node_protection) + vty_out(vty, " node-protection"); + vty_out(vty, "\n"); + } else { + if (l1_enabled) { + vty_out(vty, " isis fast-reroute ti-lfa level-1"); + if (l1_node_protection) + vty_out(vty, " node-protection"); + vty_out(vty, "\n"); + } + if (l2_enabled) { + vty_out(vty, " isis fast-reroute ti-lfa level-2"); + if (l2_node_protection) + vty_out(vty, " node-protection"); + vty_out(vty, "\n"); + } + } +} + /* * XPath: /frr-isisd:isis/instance/log-adjacency-changes */ @@ -2661,6 +2757,8 @@ void isis_cli_init(void) install_element(INTERFACE_NODE, &isis_priority_cmd); install_element(INTERFACE_NODE, &no_isis_priority_cmd); + install_element(INTERFACE_NODE, &isis_ti_lfa_cmd); + install_element(ISIS_NODE, &log_adj_changes_cmd); install_element(ISIS_NODE, &isis_mpls_ldp_sync_cmd); diff --git a/isisd/isis_events.c b/isisd/isis_events.c index 717a5fd0468c..c4c95138c447 100644 --- a/isisd/isis_events.c +++ b/isisd/isis_events.c @@ -49,14 +49,6 @@ #include "isisd/isis_spf.h" #include "isisd/isis_errors.h" -/* debug isis-spf spf-events - 4w4d: ISIS-Spf (tlt): L2 SPF needed, new adjacency, from 0x609229F4 - 4w4d: ISIS-Spf (tlt): L2, 0000.0000.0042.01-00 TLV contents changed, code 0x2 - 4w4d: ISIS-Spf (tlt): L2, new LSP 0 DEAD.BEEF.0043.00-00 - 4w5d: ISIS-Spf (tlt): L1 SPF needed, periodic SPF, from 0x6091C844 - 4w5d: ISIS-Spf (tlt): L2 SPF needed, periodic SPF, from 0x6091C844 -*/ - void isis_event_circuit_state_change(struct isis_circuit *circuit, struct isis_area *area, int up) { diff --git a/isisd/isis_lfa.c b/isisd/isis_lfa.c new file mode 100644 index 000000000000..8ca432f895d3 --- /dev/null +++ b/isisd/isis_lfa.c @@ -0,0 +1,1103 @@ +/* + * Copyright (C) 2020 NetDEF, Inc. + * Renato Westphal + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "linklist.h" +#include "log.h" +#include "memory.h" +#include "vrf.h" +#include "table.h" +#include "srcdest_table.h" + +#include "isis_common.h" +#include "isisd.h" +#include "isis_misc.h" +#include "isis_adjacency.h" +#include "isis_circuit.h" +#include "isis_lsp.h" +#include "isis_spf.h" +#include "isis_route.h" +#include "isis_mt.h" +#include "isis_tlvs.h" +#include "isis_spf_private.h" +#include "isisd/isis_errors.h" + +DEFINE_MTYPE_STATIC(ISISD, ISIS_SPF_NODE, "ISIS SPF Node"); + +static inline int isis_spf_node_compare(const struct isis_spf_node *a, + const struct isis_spf_node *b) +{ + return memcmp(a->sysid, b->sysid, sizeof(a->sysid)); +} +RB_GENERATE(isis_spf_nodes, isis_spf_node, entry, isis_spf_node_compare) + +/** + * Initialize list of SPF nodes. + * + * @param nodes List of SPF nodes + */ +void isis_spf_node_list_init(struct isis_spf_nodes *nodes) +{ + RB_INIT(isis_spf_nodes, nodes); +} + +/** + * Clear list of SPF nodes, releasing all allocated memory. + * + * @param nodes List of SPF nodes + */ +void isis_spf_node_list_clear(struct isis_spf_nodes *nodes) +{ + while (!RB_EMPTY(isis_spf_nodes, nodes)) { + struct isis_spf_node *node = RB_ROOT(isis_spf_nodes, nodes); + + if (node->adjacencies) + list_delete(&node->adjacencies); + if (node->lfa.spftree) + isis_spftree_del(node->lfa.spftree); + if (node->lfa.spftree_reverse) + isis_spftree_del(node->lfa.spftree_reverse); + isis_spf_node_list_clear(&node->lfa.p_space); + RB_REMOVE(isis_spf_nodes, nodes, node); + XFREE(MTYPE_ISIS_SPF_NODE, node); + } +} + +/** + * Add new node to list of SPF nodes. + * + * @param nodes List of SPF nodes + * @param sysid Node System ID + * + * @return Pointer to new IS-IS SPF node structure. + */ +struct isis_spf_node *isis_spf_node_new(struct isis_spf_nodes *nodes, + const uint8_t *sysid) +{ + struct isis_spf_node *node; + + node = XCALLOC(MTYPE_ISIS_SPF_NODE, sizeof(*node)); + memcpy(node->sysid, sysid, sizeof(node->sysid)); + node->adjacencies = list_new(); + isis_spf_node_list_init(&node->lfa.p_space); + RB_INSERT(isis_spf_nodes, nodes, node); + + return node; +} + +/** + * Lookup SPF node by its System ID on the given list. + * + * @param nodes List of SPF nodes + * @param sysid Node System ID + * + * @return Pointer to SPF node if found, NULL otherwise + */ +struct isis_spf_node *isis_spf_node_find(const struct isis_spf_nodes *nodes, + const uint8_t *sysid) +{ + struct isis_spf_node node = {}; + + memcpy(node.sysid, sysid, sizeof(node.sysid)); + return RB_FIND(isis_spf_nodes, nodes, &node); +} + +/** + * Check if a given IS-IS adjacency needs to be excised when computing the SPF + * post-convergence tree. + * + * @param spftree IS-IS SPF tree + * @param id Adjacency System ID (or LAN ID of the designated router + * for broadcast interfaces) + * + * @return true if the adjacency needs to be excised, false + * otherwise + */ +bool isis_lfa_excise_adj_check(const struct isis_spftree *spftree, + const uint8_t *id) +{ + const struct lfa_protected_resource *resource; + + if (spftree->type != SPF_TYPE_TI_LFA) + return false; + + /* + * Adjacencies formed over the failed interface should be excised both + * when using link and node protection. + */ + resource = &spftree->lfa.protected_resource; + if (!memcmp(resource->adjacency, id, ISIS_SYS_ID_LEN + 1)) + return true; + + return false; +} + +/** + * Check if a given IS-IS node needs to be excised when computing the SPF + * post-convergence tree. + * + * @param spftree IS-IS SPF tree + * @param id Node System ID + * + * @return true if the node needs to be excised, false otherwise + */ +bool isis_lfa_excise_node_check(const struct isis_spftree *spftree, + const uint8_t *id) +{ + const struct lfa_protected_resource *resource; + + if (spftree->type != SPF_TYPE_TI_LFA) + return false; + + /* + * When using node protection, nodes reachable over the failed interface + * must be excised. + */ + resource = &spftree->lfa.protected_resource; + if (resource->type == LFA_LINK_PROTECTION) + return false; + + if (isis_spf_node_find(&resource->nodes, id)) + return true; + + return false; +} + +/* Find SRGB associated to a System ID. */ +static struct isis_sr_block *tilfa_find_srgb(struct lspdb_head *lspdb, + const uint8_t *sysid) +{ + struct isis_lsp *lsp; + + lsp = isis_root_system_lsp(lspdb, sysid); + if (!lsp) + return NULL; + + if (!lsp->tlvs->router_cap + || lsp->tlvs->router_cap->srgb.range_size == 0) + return NULL; + + return &lsp->tlvs->router_cap->srgb; +} + +struct tilfa_find_pnode_prefix_sid_args { + uint32_t sid_index; +}; + +static int tilfa_find_pnode_prefix_sid_cb(const struct prefix *prefix, + uint32_t metric, bool external, + struct isis_subtlvs *subtlvs, + void *arg) +{ + struct tilfa_find_pnode_prefix_sid_args *args = arg; + struct isis_prefix_sid *psid; + + if (!subtlvs || subtlvs->prefix_sids.count == 0) + return LSP_ITER_CONTINUE; + + psid = (struct isis_prefix_sid *)subtlvs->prefix_sids.head; + + /* Require the node flag to be set. */ + if (!CHECK_FLAG(psid->flags, ISIS_PREFIX_SID_NODE)) + return LSP_ITER_CONTINUE; + + args->sid_index = psid->value; + + return LSP_ITER_STOP; +} + +/* Find Prefix-SID associated to a System ID. */ +static uint32_t tilfa_find_pnode_prefix_sid(struct isis_spftree *spftree, + const uint8_t *sysid) +{ + struct isis_lsp *lsp; + struct tilfa_find_pnode_prefix_sid_args args; + + lsp = isis_root_system_lsp(spftree->lspdb, sysid); + if (!lsp) + return UINT32_MAX; + + args.sid_index = UINT32_MAX; + isis_lsp_iterate_ip_reach(lsp, spftree->family, spftree->mtid, + tilfa_find_pnode_prefix_sid_cb, &args); + + return args.sid_index; +} + +struct tilfa_find_qnode_adj_sid_args { + const uint8_t *qnode_sysid; + mpls_label_t label; +}; + +static int tilfa_find_qnode_adj_sid_cb(const uint8_t *id, uint32_t metric, + bool oldmetric, + struct isis_ext_subtlvs *subtlvs, + void *arg) +{ + struct tilfa_find_qnode_adj_sid_args *args = arg; + struct isis_adj_sid *adj_sid; + + if (memcmp(id, args->qnode_sysid, ISIS_SYS_ID_LEN)) + return LSP_ITER_CONTINUE; + if (!subtlvs || subtlvs->adj_sid.count == 0) + return LSP_ITER_CONTINUE; + + adj_sid = (struct isis_adj_sid *)subtlvs->adj_sid.head; + args->label = adj_sid->sid; + + return LSP_ITER_STOP; +} + +/* Find Adj-SID associated to a pair of System IDs. */ +static mpls_label_t tilfa_find_qnode_adj_sid(struct isis_spftree *spftree, + const uint8_t *source_sysid, + const uint8_t *qnode_sysid) +{ + struct isis_lsp *lsp; + struct tilfa_find_qnode_adj_sid_args args; + + lsp = isis_root_system_lsp(spftree->lspdb, source_sysid); + if (!lsp) + return MPLS_INVALID_LABEL; + + args.qnode_sysid = qnode_sysid; + args.label = MPLS_INVALID_LABEL; + isis_lsp_iterate_is_reach(lsp, spftree->mtid, + tilfa_find_qnode_adj_sid_cb, &args); + + return args.label; +} + +/* + * Compute the MPLS label stack associated to a TI-LFA repair list. This + * needs to be computed separately for each adjacency since different + * neighbors can have different SRGBs. + */ +static struct mpls_label_stack * +tilfa_compute_label_stack(struct lspdb_head *lspdb, + const struct isis_spf_adj *sadj, + const struct list *repair_list) +{ + struct mpls_label_stack *label_stack; + struct isis_tilfa_sid *sid; + struct listnode *node; + size_t i = 0; + + /* Allocate label stack. */ + label_stack = XCALLOC(MTYPE_ISIS_NEXTHOP_LABELS, + sizeof(struct mpls_label_stack) + + listcount(repair_list) + * sizeof(mpls_label_t)); + label_stack->num_labels = listcount(repair_list); + + for (ALL_LIST_ELEMENTS_RO(repair_list, node, sid)) { + struct isis_sr_block *srgb; + mpls_label_t label; + + switch (sid->type) { + case TILFA_SID_PREFIX: + srgb = tilfa_find_srgb(lspdb, sadj->id); + if (!srgb) { + zlog_warn("%s: SRGB not found for node %s", + __func__, + print_sys_hostname(sadj->id)); + goto error; + } + + /* Check if the SID index falls inside the SRGB. */ + if (sid->value.index >= srgb->range_size) { + flog_warn( + EC_ISIS_SID_OVERFLOW, + "%s: SID index %u falls outside remote SRGB range", + __func__, sid->value.index); + goto error; + } + + /* + * Prefix-SID: map SID index to label value within the + * SRGB. + */ + label = srgb->lower_bound + sid->value.index; + break; + case TILFA_SID_ADJ: + /* Adj-SID: absolute label value can be used directly */ + label = sid->value.label; + break; + default: + flog_err(EC_LIB_DEVELOPMENT, + "%s: unknown TI-LFA SID type [%u]", __func__, + sid->type); + exit(1); + } + label_stack->label[i++] = label; + } + + return label_stack; + +error: + XFREE(MTYPE_ISIS_NEXTHOP_LABELS, label_stack); + return NULL; +} + +static int tilfa_repair_list_apply(struct isis_spftree *spftree, + struct isis_vertex *vertex_dest, + const struct isis_vertex *vertex_pnode, + const struct list *repair_list) +{ + struct isis_vertex_adj *vadj; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO(vertex_dest->Adj_N, node, vadj)) { + struct isis_spf_adj *sadj = vadj->sadj; + struct mpls_label_stack *label_stack; + + if (!isis_vertex_adj_exists(spftree, vertex_pnode, sadj)) + continue; + + assert(!vadj->label_stack); + label_stack = tilfa_compute_label_stack(spftree->lspdb, sadj, + repair_list); + if (!label_stack) { + char buf[VID2STR_BUFFER]; + + vid2string(vertex_dest, buf, sizeof(buf)); + zlog_warn( + "%s: %s %s adjacency %s: failed to compute label stack", + __func__, vtype2string(vertex_dest->type), buf, + print_sys_hostname(sadj->id)); + return -1; + } + + vadj->label_stack = label_stack; + } + + return 0; +} + +/* + * Check if a node belongs to the extended P-space corresponding to a given + * destination. + */ +static bool lfa_ext_p_space_check(const struct isis_spftree *spftree_pc, + const struct isis_vertex *vertex_dest, + const struct isis_vertex *vertex) +{ + struct isis_spftree *spftree_old = spftree_pc->lfa.old.spftree; + struct isis_vertex_adj *vadj; + struct listnode *node; + + /* Check the local P-space first. */ + if (isis_spf_node_find(&spftree_pc->lfa.p_space, vertex->N.id)) + return true; + + /* + * Check the P-space of the adjacent routers used to reach the + * destination. + */ + for (ALL_LIST_ELEMENTS_RO(vertex_dest->Adj_N, node, vadj)) { + struct isis_spf_adj *sadj = vadj->sadj; + struct isis_spf_node *adj_node; + + adj_node = + isis_spf_node_find(&spftree_old->adj_nodes, sadj->id); + if (!adj_node) + continue; + + if (isis_spf_node_find(&adj_node->lfa.p_space, vertex->N.id)) + return true; + } + + return false; +} + +/* Check if a node belongs to the Q-space. */ +static bool lfa_q_space_check(const struct isis_spftree *spftree_pc, + const struct isis_vertex *vertex) +{ + return isis_spf_node_find(&spftree_pc->lfa.q_space, vertex->N.id); +} + +/* This is a recursive function. */ +static int tilfa_build_repair_list(struct isis_spftree *spftree_pc, + struct isis_vertex *vertex_dest, + const struct isis_vertex *vertex, + const struct isis_vertex *vertex_child, + struct isis_spf_nodes *used_pnodes, + struct list *repair_list) +{ + struct isis_vertex *pvertex; + struct listnode *node; + bool is_pnode, is_qnode; + char buf[VID2STR_BUFFER]; + struct isis_tilfa_sid sid_qnode, sid_pnode; + mpls_label_t label_qnode; + + if (IS_DEBUG_TILFA) { + vid2string(vertex, buf, sizeof(buf)); + zlog_debug("ISIS-TI-LFA: vertex %s %s", + vtype2string(vertex->type), buf); + } + + if (!vertex_child) + goto parents; + if (vertex->type != VTYPE_NONPSEUDO_IS + && vertex->type != VTYPE_NONPSEUDO_TE_IS) + goto parents; + if (!VTYPE_IS(vertex_child->type)) + vertex_child = NULL; + + /* Check if node is part of the extended P-space and/or Q-space. */ + is_pnode = lfa_ext_p_space_check(spftree_pc, vertex_dest, vertex); + is_qnode = lfa_q_space_check(spftree_pc, vertex); + + /* Push Adj-SID label when necessary. */ + if ((!is_qnode + || spftree_pc->lfa.protected_resource.type == LFA_NODE_PROTECTION) + && vertex_child) { + label_qnode = tilfa_find_qnode_adj_sid(spftree_pc, vertex->N.id, + vertex_child->N.id); + if (label_qnode == MPLS_INVALID_LABEL) { + zlog_warn("ISIS-TI-LFA: failed to find %s->%s Adj-SID", + print_sys_hostname(vertex->N.id), + print_sys_hostname(vertex_child->N.id)); + return -1; + } + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: pushing %s->%s Adj-SID (label %u)", + print_sys_hostname(vertex->N.id), + print_sys_hostname(vertex_child->N.id), + label_qnode); + sid_qnode.type = TILFA_SID_ADJ; + sid_qnode.value.label = label_qnode; + listnode_add_head(repair_list, &sid_qnode); + } + + /* Push Prefix-SID label when necessary. */ + if (is_pnode) { + uint32_t sid_index; + + /* The same P-node can't be used more than once. */ + if (isis_spf_node_find(used_pnodes, vertex->N.id)) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: skipping already used P-node"); + return 0; + } + isis_spf_node_new(used_pnodes, vertex->N.id); + + if (!vertex_child) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: destination is within Ext-P-Space"); + return 0; + } + + sid_index = + tilfa_find_pnode_prefix_sid(spftree_pc, vertex->N.id); + if (sid_index == UINT32_MAX) { + zlog_warn( + "ISIS-TI-LFA: failed to find Prefix-SID corresponding to PQ-node %s", + print_sys_hostname(vertex->N.id)); + return -1; + } + + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: pushing Prefix-SID to %s (index %u)", + print_sys_hostname(vertex->N.id), sid_index); + sid_pnode.type = TILFA_SID_PREFIX; + sid_pnode.value.index = sid_index; + listnode_add_head(repair_list, &sid_pnode); + + /* Apply repair list. */ + if (tilfa_repair_list_apply(spftree_pc, vertex_dest, vertex, + repair_list) + != 0) + return -1; + return 0; + } + +parents: + for (ALL_LIST_ELEMENTS_RO(vertex->parents, node, pvertex)) { + struct list *repair_list_parent; + bool ecmp; + int ret; + + ecmp = (listcount(vertex->parents) > 1) ? true : false; + repair_list_parent = ecmp ? list_dup(repair_list) : repair_list; + ret = tilfa_build_repair_list(spftree_pc, vertex_dest, pvertex, + vertex, used_pnodes, + repair_list_parent); + if (ecmp) + list_delete(&repair_list_parent); + if (ret != 0) + return ret; + } + + return 0; +} + +static const char *lfa_protection_type2str(enum lfa_protection_type type) +{ + switch (type) { + case LFA_LINK_PROTECTION: + return "link protection"; + case LFA_NODE_PROTECTION: + return "node protection"; + default: + return "unknown protection type"; + } +} + +static const char * +lfa_protected_resource2str(const struct lfa_protected_resource *resource) +{ + const uint8_t *fail_id; + static char buffer[128]; + + fail_id = resource->adjacency; + snprintf(buffer, sizeof(buffer), "%s.%u's failure (%s)", + print_sys_hostname(fail_id), LSP_PSEUDO_ID(fail_id), + lfa_protection_type2str(resource->type)); + + return buffer; +} + +static bool +spf_adj_check_is_affected(const struct isis_spf_adj *sadj, + const struct lfa_protected_resource *resource, + const uint8_t *root_sysid, bool reverse) +{ + if (!!CHECK_FLAG(sadj->flags, F_ISIS_SPF_ADJ_BROADCAST) + != !!LSP_PSEUDO_ID(resource->adjacency)) + return false; + + if (CHECK_FLAG(sadj->flags, F_ISIS_SPF_ADJ_BROADCAST)) { + if (!memcmp(sadj->lan.desig_is_id, resource->adjacency, + ISIS_SYS_ID_LEN + 1)) + return true; + } else { + if (!reverse + && !memcmp(sadj->id, resource->adjacency, ISIS_SYS_ID_LEN)) + return true; + if (reverse && !memcmp(sadj->id, root_sysid, ISIS_SYS_ID_LEN)) + return true; + } + + return false; +} + +/* Check if the given SPF vertex needs LFA protection. */ +static bool lfa_check_needs_protection(const struct isis_spftree *spftree_pc, + const struct isis_vertex *vertex) +{ + struct isis_vertex *vertex_old; + struct listnode *node; + size_t affected_nhs = 0; + struct isis_vertex_adj *vadj; + + /* Only local adjacencies need Adj-SID protection. */ + if (VTYPE_IS(vertex->type) + && !isis_adj_find(spftree_pc->area, spftree_pc->level, + vertex->N.id)) + return false; + + vertex_old = isis_find_vertex(&spftree_pc->lfa.old.spftree->paths, + &vertex->N, vertex->type); + if (!vertex_old) + return false; + + for (ALL_LIST_ELEMENTS_RO(vertex_old->Adj_N, node, vadj)) { + struct isis_spf_adj *sadj = vadj->sadj; + + if (spf_adj_check_is_affected( + sadj, &spftree_pc->lfa.protected_resource, + spftree_pc->sysid, false)) + affected_nhs++; + } + + /* + * No need to compute backup paths for ECMP routes, except if all + * primary nexthops share the same broadcast interface. + */ + if (listcount(vertex_old->Adj_N) == affected_nhs) + return true; + + return false; +} + +/** + * Check if the given SPF vertex needs protection and, if so, compute and + * install the corresponding repair paths. + * + * @param spftree_pc The post-convergence SPF tree + * @param vertex IS-IS SPF vertex to check + * + * @return 0 if the vertex needs to be protected, -1 otherwise + */ +int isis_lfa_check(struct isis_spftree *spftree_pc, struct isis_vertex *vertex) +{ + struct isis_spf_nodes used_pnodes; + char buf[VID2STR_BUFFER]; + struct list *repair_list; + int ret; + + if (!spftree_pc->area->srdb.enabled) + return -1; + + if (IS_DEBUG_TILFA) + vid2string(vertex, buf, sizeof(buf)); + + if (!lfa_check_needs_protection(spftree_pc, vertex)) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: %s %s unaffected by %s", + vtype2string(vertex->type), buf, + lfa_protected_resource2str( + &spftree_pc->lfa.protected_resource)); + + return -1; + } + + /* + * Check if the route/adjacency was already covered by node protection. + */ + if (VTYPE_IS(vertex->type)) { + struct isis_adjacency *adj; + + adj = isis_adj_find(spftree_pc->area, spftree_pc->level, + vertex->N.id); + if (adj + && isis_sr_adj_sid_find(adj, spftree_pc->family, + ISIS_SR_LAN_BACKUP)) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: %s %s already covered by node protection", + vtype2string(vertex->type), buf); + + return -1; + } + } + if (VTYPE_IP(vertex->type)) { + struct route_table *route_table; + + route_table = spftree_pc->lfa.old.spftree->route_table_backup; + if (route_node_lookup(route_table, &vertex->N.ip.dest)) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: %s %s already covered by node protection", + vtype2string(vertex->type), buf); + + return -1; + } + } + + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: computing repair path(s) of %s %s w.r.t %s", + vtype2string(vertex->type), buf, + lfa_protected_resource2str( + &spftree_pc->lfa.protected_resource)); + + /* Create base repair list. */ + repair_list = list_new(); + + isis_spf_node_list_init(&used_pnodes); + ret = tilfa_build_repair_list(spftree_pc, vertex, vertex, NULL, + &used_pnodes, repair_list); + isis_spf_node_list_clear(&used_pnodes); + list_delete(&repair_list); + if (ret != 0) + zlog_warn("ISIS-TI-LFA: failed to compute repair path(s)"); + + return ret; +} + +static bool +spf_adj_node_is_affected(struct isis_spf_node *adj_node, + const struct lfa_protected_resource *resource, + const uint8_t *root_sysid) +{ + struct isis_spf_adj *sadj; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO(adj_node->adjacencies, node, sadj)) { + if (sadj->metric != adj_node->best_metric) + continue; + if (spf_adj_check_is_affected(sadj, resource, root_sysid, + false)) + return true; + } + + return false; +} + +static bool vertex_is_affected(struct isis_spftree *spftree_root, + const struct isis_spf_nodes *adj_nodes, + bool p_space, const struct isis_vertex *vertex, + const struct lfa_protected_resource *resource) +{ + struct isis_vertex *pvertex; + struct listnode *node, *vnode; + + for (ALL_LIST_ELEMENTS_RO(vertex->parents, node, pvertex)) { + struct isis_spftree *spftree_parent; + struct isis_vertex *vertex_child; + struct isis_vertex_adj *vadj; + bool reverse = false; + char buf1[VID2STR_BUFFER]; + char buf2[VID2STR_BUFFER]; + + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-TI-LFA: vertex %s parent %s", + vid2string(vertex, buf1, sizeof(buf1)), + vid2string(pvertex, buf2, sizeof(buf2))); + + if (p_space && resource->type == LFA_NODE_PROTECTION) { + if (isis_spf_node_find(&resource->nodes, vertex->N.id)) + return true; + goto parents; + } + + /* Check if either the vertex or its parent is the root node. */ + if (memcmp(vertex->N.id, spftree_root->sysid, ISIS_SYS_ID_LEN) + && memcmp(pvertex->N.id, spftree_root->sysid, + ISIS_SYS_ID_LEN)) + goto parents; + + /* Get SPT of the parent vertex. */ + if (!memcmp(pvertex->N.id, spftree_root->sysid, + ISIS_SYS_ID_LEN)) + spftree_parent = spftree_root; + else { + struct isis_spf_node *adj_node; + + adj_node = isis_spf_node_find(adj_nodes, pvertex->N.id); + assert(adj_node); + spftree_parent = adj_node->lfa.spftree; + assert(spftree_parent); + reverse = true; + } + + /* Get paths pvertex uses to reach vertex. */ + vertex_child = isis_find_vertex(&spftree_parent->paths, + &vertex->N, vertex->type); + if (!vertex_child) + goto parents; + + /* Check if any of these paths use the protected resource. */ + for (ALL_LIST_ELEMENTS_RO(vertex_child->Adj_N, vnode, vadj)) + if (spf_adj_check_is_affected(vadj->sadj, resource, + spftree_root->sysid, + reverse)) + return true; + + parents: + if (vertex_is_affected(spftree_root, adj_nodes, p_space, + pvertex, resource)) + return true; + } + + return false; +} + +/* Calculate set of nodes reachable without using the protected interface. */ +static void lfa_calc_reach_nodes(struct isis_spftree *spftree, + struct isis_spftree *spftree_root, + const struct isis_spf_nodes *adj_nodes, + bool p_space, + const struct lfa_protected_resource *resource, + struct isis_spf_nodes *nodes) +{ + struct isis_vertex *vertex; + struct listnode *node; + + for (ALL_QUEUE_ELEMENTS_RO(&spftree->paths, node, vertex)) { + char buf[VID2STR_BUFFER]; + + if (!VTYPE_IS(vertex->type)) + continue; + + /* Skip root node. */ + if (!memcmp(vertex->N.id, spftree_root->sysid, ISIS_SYS_ID_LEN)) + continue; + + /* Don't add the same node twice. */ + if (isis_spf_node_find(nodes, vertex->N.id)) + continue; + + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-TI-LFA: checking %s", + vid2string(vertex, buf, sizeof(buf))); + + if (!vertex_is_affected(spftree_root, adj_nodes, p_space, + vertex, resource)) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: adding %s", + vid2string(vertex, buf, sizeof(buf))); + + isis_spf_node_new(nodes, vertex->N.id); + } + } +} + +/** + * Helper function used to create an SPF tree structure and run reverse SPF on + * it. + * + * @param spftree IS-IS SPF tree + * + * @return Pointer to new SPF tree structure. + */ +struct isis_spftree *isis_spf_reverse_run(const struct isis_spftree *spftree) +{ + struct isis_spftree *spftree_reverse; + + spftree_reverse = isis_spftree_new( + spftree->area, spftree->lspdb, spftree->sysid, spftree->level, + spftree->tree_id, SPF_TYPE_REVERSE, + F_SPFTREE_NO_ADJACENCIES | F_SPFTREE_NO_ROUTES); + isis_run_spf(spftree_reverse); + + return spftree_reverse; +} + +/* + * Calculate the Extended P-space and Q-space associated to a given link + * failure. + */ +static void lfa_calc_pq_spaces(struct isis_spftree *spftree_pc, + const struct lfa_protected_resource *resource) +{ + struct isis_spftree *spftree; + struct isis_spftree *spftree_reverse; + struct isis_spf_nodes *adj_nodes; + struct isis_spf_node *adj_node; + + /* Obtain pre-failure SPTs and list of adjacent nodes. */ + spftree = spftree_pc->lfa.old.spftree; + spftree_reverse = spftree_pc->lfa.old.spftree_reverse; + adj_nodes = &spftree->adj_nodes; + + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-TI-LFA: computing P-space (self)"); + lfa_calc_reach_nodes(spftree, spftree, adj_nodes, true, resource, + &spftree_pc->lfa.p_space); + + RB_FOREACH (adj_node, isis_spf_nodes, adj_nodes) { + if (spf_adj_node_is_affected(adj_node, resource, + spftree->sysid)) { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: computing Q-space (%s)", + print_sys_hostname(adj_node->sysid)); + + /* + * Compute the reverse SPF in the behalf of the node + * adjacent to the failure. + */ + adj_node->lfa.spftree_reverse = + isis_spf_reverse_run(adj_node->lfa.spftree); + + lfa_calc_reach_nodes(adj_node->lfa.spftree_reverse, + spftree_reverse, adj_nodes, false, + resource, + &spftree_pc->lfa.q_space); + } else { + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: computing P-space (%s)", + print_sys_hostname(adj_node->sysid)); + lfa_calc_reach_nodes(adj_node->lfa.spftree, spftree, + adj_nodes, true, resource, + &adj_node->lfa.p_space); + } + } +} + +/** + * Compute the TI-LFA backup paths for a given protected interface. + * + * @param area IS-IS area + * @param spftree IS-IS SPF tree + * @param spftree_reverse IS-IS Reverse SPF tree + * @param resource Protected resource + * + * @return Pointer to the post-convergence SPF tree + */ +struct isis_spftree *isis_tilfa_compute(struct isis_area *area, + struct isis_spftree *spftree, + struct isis_spftree *spftree_reverse, + struct lfa_protected_resource *resource) +{ + struct isis_spftree *spftree_pc; + struct isis_spf_node *adj_node; + + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-TI-LFA: computing the P/Q spaces w.r.t. %s", + lfa_protected_resource2str(resource)); + + /* Populate list of nodes affected by link failure. */ + if (resource->type == LFA_NODE_PROTECTION) { + isis_spf_node_list_init(&resource->nodes); + RB_FOREACH (adj_node, isis_spf_nodes, &spftree->adj_nodes) { + if (spf_adj_node_is_affected(adj_node, resource, + spftree->sysid)) + isis_spf_node_new(&resource->nodes, + adj_node->sysid); + } + } + + /* Create post-convergence SPF tree. */ + spftree_pc = isis_spftree_new(area, spftree->lspdb, spftree->sysid, + spftree->level, spftree->tree_id, + SPF_TYPE_TI_LFA, spftree->flags); + spftree_pc->lfa.old.spftree = spftree; + spftree_pc->lfa.old.spftree_reverse = spftree_reverse; + spftree_pc->lfa.protected_resource = *resource; + + /* Compute the extended P-space and Q-space. */ + lfa_calc_pq_spaces(spftree_pc, resource); + + if (IS_DEBUG_TILFA) + zlog_debug( + "ISIS-TI-LFA: computing the post convergence SPT w.r.t. %s", + lfa_protected_resource2str(resource)); + + /* Re-run SPF in the local node to find the post-convergence paths. */ + isis_run_spf(spftree_pc); + + /* Clear list of nodes affeted by link failure. */ + if (resource->type == LFA_NODE_PROTECTION) + isis_spf_node_list_clear(&resource->nodes); + + return spftree_pc; +} + +/** + * Run forward SPF on all adjacent routers. + * + * @param spftree IS-IS SPF tree + * + * @return 0 on success, -1 otherwise + */ +int isis_spf_run_neighbors(struct isis_spftree *spftree) +{ + struct isis_lsp *lsp; + struct isis_spf_node *adj_node; + + lsp = isis_root_system_lsp(spftree->lspdb, spftree->sysid); + if (!lsp) + return -1; + + RB_FOREACH (adj_node, isis_spf_nodes, &spftree->adj_nodes) { + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-TI-LFA: running SPF on neighbor %s", + print_sys_hostname(adj_node->sysid)); + + /* Compute the SPT on behalf of the neighbor. */ + adj_node->lfa.spftree = isis_spftree_new( + spftree->area, spftree->lspdb, adj_node->sysid, + spftree->level, spftree->tree_id, SPF_TYPE_FORWARD, + F_SPFTREE_NO_ADJACENCIES | F_SPFTREE_NO_ROUTES); + isis_run_spf(adj_node->lfa.spftree); + } + + return 0; +} + +/** + * Run the TI-LFA algorithm for all proctected interfaces. + * + * @param area IS-IS area + * @param spftree IS-IS SPF tree + */ +void isis_spf_run_lfa(struct isis_area *area, struct isis_spftree *spftree) +{ + struct isis_spftree *spftree_reverse; + struct isis_circuit *circuit; + struct listnode *node; + + /* Run reverse SPF locally. */ + spftree_reverse = isis_spf_reverse_run(spftree); + + /* Run forward SPF on all adjacent routers. */ + isis_spf_run_neighbors(spftree); + + /* Check which interfaces are protected. */ + for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { + struct lfa_protected_resource resource = {}; + struct isis_adjacency *adj; + struct isis_spftree *spftree_pc_link; + struct isis_spftree *spftree_pc_node; + static uint8_t null_sysid[ISIS_SYS_ID_LEN + 1]; + + if (!(circuit->is_type & spftree->level)) + continue; + + if (!circuit->tilfa_protection[spftree->level - 1]) + continue; + + /* Fill in the protected resource. */ + switch (circuit->circ_type) { + case CIRCUIT_T_BROADCAST: + if (spftree->level == 1) + memcpy(resource.adjacency, + circuit->u.bc.l1_desig_is, + ISIS_SYS_ID_LEN + 1); + else + memcpy(resource.adjacency, + circuit->u.bc.l2_desig_is, + ISIS_SYS_ID_LEN + 1); + /* Do nothing if no DR was elected yet. */ + if (!memcmp(resource.adjacency, null_sysid, + ISIS_SYS_ID_LEN + 1)) + continue; + break; + case CIRCUIT_T_P2P: + adj = circuit->u.p2p.neighbor; + if (!adj) + continue; + memcpy(resource.adjacency, adj->sysid, ISIS_SYS_ID_LEN); + LSP_PSEUDO_ID(resource.adjacency) = 0; + break; + default: + continue; + } + + /* Compute node protecting repair paths first (if necessary). */ + if (circuit->tilfa_node_protection[spftree->level - 1]) { + resource.type = LFA_NODE_PROTECTION; + spftree_pc_node = isis_tilfa_compute( + area, spftree, spftree_reverse, &resource); + isis_spftree_del(spftree_pc_node); + } + + /* Compute link protecting repair paths. */ + resource.type = LFA_LINK_PROTECTION; + spftree_pc_link = isis_tilfa_compute( + area, spftree, spftree_reverse, &resource); + isis_spftree_del(spftree_pc_link); + } + + isis_spftree_del(spftree_reverse); +} diff --git a/isisd/isis_lfa.h b/isisd/isis_lfa.h new file mode 100644 index 000000000000..62a7666f9c44 --- /dev/null +++ b/isisd/isis_lfa.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2020 NetDEF, Inc. + * Renato Westphal + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _FRR_ISIS_LFA_H +#define _FRR_ISIS_LFA_H + +enum isis_tilfa_sid_type { + TILFA_SID_PREFIX = 1, + TILFA_SID_ADJ, +}; + +struct isis_tilfa_sid { + enum isis_tilfa_sid_type type; + union { + uint32_t index; + mpls_label_t label; + } value; +}; + +RB_HEAD(isis_spf_nodes, isis_spf_node); +RB_PROTOTYPE(isis_spf_nodes, isis_spf_node, entry, isis_spf_node_compare) +struct isis_spf_node { + RB_ENTRY(isis_spf_node) entry; + + /* Node's System ID. */ + uint8_t sysid[ISIS_SYS_ID_LEN]; + + /* Local adjacencies over which this node is reachable. */ + struct list *adjacencies; + + /* Best metric of all adjacencies used to reach this node. */ + uint32_t best_metric; + + struct { + /* Node's forward SPT. */ + struct isis_spftree *spftree; + + /* Node's reverse SPT. */ + struct isis_spftree *spftree_reverse; + + /* Node's P-space. */ + struct isis_spf_nodes p_space; + } lfa; +}; + +enum lfa_protection_type { + LFA_LINK_PROTECTION = 1, + LFA_NODE_PROTECTION, +}; + +struct lfa_protected_resource { + /* The protection type. */ + enum lfa_protection_type type; + + /* The protected adjacency (might be a pseudonode). */ + uint8_t adjacency[ISIS_SYS_ID_LEN + 1]; + + /* List of nodes reachable over the protected interface. */ + struct isis_spf_nodes nodes; +}; + +/* Forward declaration(s). */ +struct isis_vertex; + +/* Prototypes. */ +void isis_spf_node_list_init(struct isis_spf_nodes *nodes); +void isis_spf_node_list_clear(struct isis_spf_nodes *nodes); +struct isis_spf_node *isis_spf_node_new(struct isis_spf_nodes *nodes, + const uint8_t *sysid); +struct isis_spf_node *isis_spf_node_find(const struct isis_spf_nodes *nodes, + const uint8_t *sysid); +bool isis_lfa_excise_adj_check(const struct isis_spftree *spftree, + const uint8_t *id); +bool isis_lfa_excise_node_check(const struct isis_spftree *spftree, + const uint8_t *id); +struct isis_spftree *isis_spf_reverse_run(const struct isis_spftree *spftree); +int isis_spf_run_neighbors(struct isis_spftree *spftree); +void isis_spf_run_lfa(struct isis_area *area, struct isis_spftree *spftree); +int isis_lfa_check(struct isis_spftree *spftree, struct isis_vertex *vertex); +struct isis_spftree * +isis_tilfa_compute(struct isis_area *area, struct isis_spftree *spftree, + struct isis_spftree *spftree_reverse, + struct lfa_protected_resource *protected_resource); + +#endif /* _FRR_ISIS_LFA_H */ diff --git a/isisd/isis_memory.c b/isisd/isis_memory.c index 27254597676b..a64decc14fbe 100644 --- a/isisd/isis_memory.c +++ b/isisd/isis_memory.c @@ -39,6 +39,7 @@ DEFINE_MTYPE(ISISD, ISIS_SPFTREE, "ISIS SPFtree") DEFINE_MTYPE(ISISD, ISIS_VERTEX, "ISIS vertex") DEFINE_MTYPE(ISISD, ISIS_ROUTE_INFO, "ISIS route info") DEFINE_MTYPE(ISISD, ISIS_NEXTHOP, "ISIS nexthop") +DEFINE_MTYPE(ISISD, ISIS_NEXTHOP_LABELS, "ISIS nexthop MPLS labels") DEFINE_MTYPE(ISISD, ISIS_DICT, "ISIS dictionary") DEFINE_MTYPE(ISISD, ISIS_DICT_NODE, "ISIS dictionary node") DEFINE_MTYPE(ISISD, ISIS_EXT_ROUTE, "ISIS redistributed route") diff --git a/isisd/isis_memory.h b/isisd/isis_memory.h index e672340e8457..6b63b3ccb8cb 100644 --- a/isisd/isis_memory.h +++ b/isisd/isis_memory.h @@ -38,6 +38,7 @@ DECLARE_MTYPE(ISIS_SPFTREE) DECLARE_MTYPE(ISIS_VERTEX) DECLARE_MTYPE(ISIS_ROUTE_INFO) DECLARE_MTYPE(ISIS_NEXTHOP) +DECLARE_MTYPE(ISIS_NEXTHOP_LABELS) DECLARE_MTYPE(ISIS_DICT) DECLARE_MTYPE(ISIS_DICT_NODE) DECLARE_MTYPE(ISIS_EXT_ROUTE) diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index 14ea1170c4ed..d04012c4dac6 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -818,6 +818,36 @@ const struct frr_yang_module_info frr_isisd_info = { .modify = lib_interface_isis_multi_topology_ipv6_dstsrc_modify, }, }, + { + .xpath = "/frr-interface:lib/interface/frr-isisd:isis/fast-reroute", + .cbs = { + .cli_show = cli_show_ip_isis_ti_lfa, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable", + .cbs = { + .modify = lib_interface_isis_fast_reroute_level_1_ti_lfa_enable_modify, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection", + .cbs = { + .modify = lib_interface_isis_fast_reroute_level_1_ti_lfa_node_protection_modify, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable", + .cbs = { + .modify = lib_interface_isis_fast_reroute_level_2_ti_lfa_enable_modify, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection", + .cbs = { + .modify = lib_interface_isis_fast_reroute_level_2_ti_lfa_node_protection_modify, + } + }, { .xpath = "/frr-interface:lib/interface/state/frr-isisd:isis", .cbs = { diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index 8a6d24b84585..303a7b46963a 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -256,6 +256,14 @@ int lib_interface_isis_multi_topology_ipv6_dstsrc_modify( int lib_interface_isis_mpls_ldp_sync_modify(struct nb_cb_modify_args *args); int lib_interface_isis_mpls_holddown_modify(struct nb_cb_modify_args *args); int lib_interface_isis_mpls_holddown_destroy(struct nb_cb_destroy_args *args); +int lib_interface_isis_fast_reroute_level_1_ti_lfa_enable_modify( + struct nb_cb_modify_args *args); +int lib_interface_isis_fast_reroute_level_1_ti_lfa_node_protection_modify( + struct nb_cb_modify_args *args); +int lib_interface_isis_fast_reroute_level_2_ti_lfa_enable_modify( + struct nb_cb_modify_args *args); +int lib_interface_isis_fast_reroute_level_2_ti_lfa_node_protection_modify( + struct nb_cb_modify_args *args); struct yang_data * lib_interface_state_isis_get_elem(struct nb_cb_get_elem_args *args); const void *lib_interface_state_isis_adjacencies_adjacency_get_next( @@ -432,6 +440,8 @@ void cli_show_ip_isis_mt_ipv6_mgmt(struct vty *vty, struct lyd_node *dnode, bool show_defaults); void cli_show_ip_isis_mt_ipv6_dstsrc(struct vty *vty, struct lyd_node *dnode, bool show_defaults); +void cli_show_ip_isis_ti_lfa(struct vty *vty, struct lyd_node *dnode, + bool show_defaults); void cli_show_ip_isis_circ_type(struct vty *vty, struct lyd_node *dnode, bool show_defaults); void cli_show_ip_isis_network_type(struct vty *vty, struct lyd_node *dnode, diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index 24228ed70143..2710c3c13fad 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -43,6 +43,7 @@ #include "isisd/isis_csm.h" #include "isisd/isis_adjacency.h" #include "isisd/isis_spf.h" +#include "isisd/isis_spf_private.h" #include "isisd/isis_te.h" #include "isisd/isis_memory.h" #include "isisd/isis_mt.h" @@ -2929,5 +2930,108 @@ int lib_interface_isis_mpls_holddown_destroy(struct nb_cb_destroy_args *args) ldp_sync_info->holddown = LDP_IGP_SYNC_HOLDDOWN_DEFAULT; break; } + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable + */ +int lib_interface_isis_fast_reroute_level_1_ti_lfa_enable_modify( + struct nb_cb_modify_args *args) +{ + struct isis_area *area; + struct isis_circuit *circuit; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + circuit = nb_running_get_entry(args->dnode, NULL, true); + circuit->tilfa_protection[0] = yang_dnode_get_bool(args->dnode, NULL); + if (circuit->tilfa_protection[0]) + circuit->area->lfa_protected_links[0]++; + else { + assert(circuit->area->lfa_protected_links[0] > 0); + circuit->area->lfa_protected_links[0]--; + } + + area = circuit->area; + lsp_regenerate_schedule(area, area->is_type, 0); + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection + */ +int lib_interface_isis_fast_reroute_level_1_ti_lfa_node_protection_modify( + struct nb_cb_modify_args *args) +{ + struct isis_area *area; + struct isis_circuit *circuit; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + circuit = nb_running_get_entry(args->dnode, NULL, true); + circuit->tilfa_node_protection[0] = + yang_dnode_get_bool(args->dnode, NULL); + + area = circuit->area; + lsp_regenerate_schedule(area, area->is_type, 0); + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable + */ +int lib_interface_isis_fast_reroute_level_2_ti_lfa_enable_modify( + struct nb_cb_modify_args *args) +{ + struct isis_area *area; + struct isis_circuit *circuit; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + circuit = nb_running_get_entry(args->dnode, NULL, true); + circuit->tilfa_protection[1] = yang_dnode_get_bool(args->dnode, NULL); + if (circuit->tilfa_protection[1]) + circuit->area->lfa_protected_links[1]++; + else { + assert(circuit->area->lfa_protected_links[1] > 0); + circuit->area->lfa_protected_links[1]--; + } + + area = circuit->area; + lsp_regenerate_schedule(area, area->is_type, 0); + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection + */ +int lib_interface_isis_fast_reroute_level_2_ti_lfa_node_protection_modify( + struct nb_cb_modify_args *args) +{ + struct isis_area *area; + struct isis_circuit *circuit; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + circuit = nb_running_get_entry(args->dnode, NULL, true); + circuit->tilfa_node_protection[1] = + yang_dnode_get_bool(args->dnode, NULL); + + area = circuit->area; + lsp_regenerate_schedule(area, area->is_type, 0); + return NB_OK; } diff --git a/isisd/isis_route.c b/isisd/isis_route.c index fa0657255529..0868ab487c2a 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -76,8 +76,9 @@ static struct isis_nexthop *isis_nexthop_create(int family, union g_addr *ip, return nexthop; } -static void isis_nexthop_delete(struct isis_nexthop *nexthop) +void isis_nexthop_delete(struct isis_nexthop *nexthop) { + XFREE(MTYPE_ISIS_NEXTHOP_LABELS, nexthop->label_stack); XFREE(MTYPE_ISIS_NEXTHOP, nexthop); } @@ -115,8 +116,9 @@ static struct isis_nexthop *nexthoplookup(struct list *nexthops, int family, return NULL; } -static void adjinfo2nexthop(int family, struct list *nexthops, - struct isis_adjacency *adj) +void adjinfo2nexthop(int family, struct list *nexthops, + struct isis_adjacency *adj, + struct mpls_label_stack *label_stack) { struct isis_nexthop *nh; union g_addr ip = {}; @@ -132,6 +134,7 @@ static void adjinfo2nexthop(int family, struct list *nexthops, AF_INET, &ip, adj->circuit->interface->ifindex); memcpy(nh->sysid, adj->sysid, sizeof(nh->sysid)); + nh->label_stack = label_stack; listnode_add(nexthops, nh); break; } @@ -147,6 +150,7 @@ static void adjinfo2nexthop(int family, struct list *nexthops, AF_INET6, &ip, adj->circuit->interface->ifindex); memcpy(nh->sysid, adj->sysid, sizeof(nh->sysid)); + nh->label_stack = label_stack; listnode_add(nexthops, nh); break; } @@ -160,13 +164,15 @@ static void adjinfo2nexthop(int family, struct list *nexthops, } static void isis_route_add_dummy_nexthops(struct isis_route_info *rinfo, - const uint8_t *sysid) + const uint8_t *sysid, + struct mpls_label_stack *label_stack) { struct isis_nexthop *nh; nh = XCALLOC(MTYPE_ISIS_NEXTHOP, sizeof(struct isis_nexthop)); memcpy(nh->sysid, sysid, sizeof(nh->sysid)); isis_sr_nexthop_reset(&nh->sr); + nh->label_stack = label_stack; listnode_add(rinfo->nexthops, nh); } @@ -186,13 +192,15 @@ static struct isis_route_info *isis_route_info_new(struct prefix *prefix, for (ALL_LIST_ELEMENTS_RO(adjacencies, node, vadj)) { struct isis_spf_adj *sadj = vadj->sadj; struct isis_adjacency *adj = sadj->adj; + struct mpls_label_stack *label_stack = vadj->label_stack; /* * Create dummy nexthops when running SPF on a testing * environment. */ if (CHECK_FLAG(im->options, F_ISIS_UNIT_TEST)) { - isis_route_add_dummy_nexthops(rinfo, sadj->id); + isis_route_add_dummy_nexthops(rinfo, sadj->id, + label_stack); continue; } @@ -219,7 +227,8 @@ static struct isis_route_info *isis_route_info_new(struct prefix *prefix, prefix->family); exit(1); } - adjinfo2nexthop(prefix->family, rinfo->nexthops, adj); + adjinfo2nexthop(prefix->family, rinfo->nexthops, adj, + label_stack); } rinfo->cost = cost; @@ -239,6 +248,12 @@ static void isis_route_info_delete(struct isis_route_info *route_info) XFREE(MTYPE_ISIS_ROUTE_INFO, route_info); } +void isis_route_node_cleanup(struct route_table *table, struct route_node *node) +{ + if (node->info) + isis_route_info_delete(node->info); +} + static int isis_route_info_same(struct isis_route_info *new, struct isis_route_info *old, char *buf, size_t buf_size) @@ -412,6 +427,7 @@ static void isis_route_update(struct isis_area *area, struct prefix *prefix, static void _isis_route_verify_table(struct isis_area *area, struct route_table *table, + struct route_table *table_backup, struct route_table **tables) { struct route_node *rnode, *drnode; @@ -433,6 +449,19 @@ static void _isis_route_verify_table(struct isis_area *area, (const struct prefix **)&dst_p, (const struct prefix **)&src_p); + /* Link primary route to backup route. */ + if (table_backup) { + struct route_node *rnode_bck; + + rnode_bck = srcdest_rnode_lookup(table_backup, dst_p, + src_p); + if (rnode_bck) { + rinfo->backup = rnode_bck->info; + UNSET_FLAG(rinfo->flag, + ISIS_ROUTE_FLAG_ZEBRA_SYNCED); + } + } + #ifdef EXTREME_DEBUG if (IS_DEBUG_RTE_EVENTS) { srcdest2str(dst_p, src_p, buff, sizeof(buff)); @@ -490,9 +519,10 @@ static void _isis_route_verify_table(struct isis_area *area, } } -void isis_route_verify_table(struct isis_area *area, struct route_table *table) +void isis_route_verify_table(struct isis_area *area, struct route_table *table, + struct route_table *table_backup) { - _isis_route_verify_table(area, table, NULL); + _isis_route_verify_table(area, table, table_backup, NULL); } /* Function to validate route tables for L1L2 areas. In this case we can't use @@ -507,9 +537,13 @@ void isis_route_verify_table(struct isis_area *area, struct route_table *table) * to the RIB with different zebra route types and let RIB handle this? */ void isis_route_verify_merge(struct isis_area *area, struct route_table *level1_table, - struct route_table *level2_table) + struct route_table *level1_table_backup, + struct route_table *level2_table, + struct route_table *level2_table_backup) { - struct route_table *tables[] = { level1_table, level2_table }; + struct route_table *tables[] = {level1_table, level2_table}; + struct route_table *tables_backup[] = {level1_table_backup, + level2_table_backup}; struct route_table *merge; struct route_node *rnode, *mrnode; @@ -519,6 +553,8 @@ void isis_route_verify_merge(struct isis_area *area, for (rnode = route_top(tables[level - 1]); rnode; rnode = srcdest_route_next(rnode)) { struct isis_route_info *rinfo = rnode->info; + struct route_node *rnode_bck; + if (!rinfo) continue; @@ -528,6 +564,16 @@ void isis_route_verify_merge(struct isis_area *area, srcdest_rnode_prefixes(rnode, (const struct prefix **)&prefix, (const struct prefix **)&src_p); + + /* Link primary route to backup route. */ + rnode_bck = srcdest_rnode_lookup( + tables_backup[level - 1], prefix, src_p); + if (rnode_bck) { + rinfo->backup = rnode_bck->info; + UNSET_FLAG(rinfo->flag, + ISIS_ROUTE_FLAG_ZEBRA_SYNCED); + } + mrnode = srcdest_rnode_get(merge, prefix, src_p); struct isis_route_info *mrinfo = mrnode->info; if (mrinfo) { @@ -566,7 +612,7 @@ void isis_route_verify_merge(struct isis_area *area, } } - _isis_route_verify_table(area, merge, tables); + _isis_route_verify_table(area, merge, NULL, tables); route_table_finish(merge); } @@ -580,6 +626,14 @@ void isis_route_invalidate_table(struct isis_area *area, continue; rinfo = rode->info; + if (rinfo->backup) { + rinfo->backup = NULL; + /* + * For now, always force routes that have backup + * nexthops to be reinstalled. + */ + UNSET_FLAG(rinfo->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED); + } UNSET_FLAG(rinfo->flag, ISIS_ROUTE_FLAG_ACTIVE); } } diff --git a/isisd/isis_route.h b/isisd/isis_route.h index 0356668d7e6c..fbb548a79e41 100644 --- a/isisd/isis_route.h +++ b/isisd/isis_route.h @@ -33,6 +33,7 @@ struct isis_nexthop { union g_addr ip; uint8_t sysid[ISIS_SYS_ID_LEN]; struct sr_nexthop_info sr; + struct mpls_label_stack *label_stack; }; struct isis_route_info { @@ -43,6 +44,7 @@ struct isis_route_info { uint32_t cost; uint32_t depth; struct list *nexthops; + struct isis_route_info *backup; }; DECLARE_HOOK(isis_route_update_hook, @@ -50,6 +52,10 @@ DECLARE_HOOK(isis_route_update_hook, struct isis_route_info *route_info), (area, prefix, route_info)) +void isis_nexthop_delete(struct isis_nexthop *nexthop); +void adjinfo2nexthop(int family, struct list *nexthops, + struct isis_adjacency *adj, + struct mpls_label_stack *label_stack); struct isis_route_info *isis_route_create(struct prefix *prefix, struct prefix_ipv6 *src_p, uint32_t cost, @@ -60,16 +66,22 @@ struct isis_route_info *isis_route_create(struct prefix *prefix, /* Walk the given table and install new routes to zebra and remove old ones. * route status is tracked using ISIS_ROUTE_FLAG_ACTIVE */ -void isis_route_verify_table(struct isis_area *area, - struct route_table *table); +void isis_route_verify_table(struct isis_area *area, struct route_table *table, + struct route_table *table_backup); /* Same as isis_route_verify_table, but merge L1 and L2 routes before */ void isis_route_verify_merge(struct isis_area *area, struct route_table *level1_table, - struct route_table *level2_table); + struct route_table *level1_table_backup, + struct route_table *level2_table, + struct route_table *level2_table_backup); /* Unset ISIS_ROUTE_FLAG_ACTIVE on all routes. Used before running spf. */ void isis_route_invalidate_table(struct isis_area *area, struct route_table *table); +/* Cleanup route node when freeing routing table. */ +void isis_route_node_cleanup(struct route_table *table, + struct route_node *node); + #endif /* _ZEBRA_ISIS_ROUTE_H */ diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index dd0a6ec824ff..39a1c9ebe97e 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -138,7 +138,7 @@ static void remove_excess_adjs(struct list *adjs) return; } -static const char *vtype2string(enum vertextype vtype) +const char *vtype2string(enum vertextype vtype) { switch (vtype) { case VTYPE_PSEUDO_IS: @@ -167,7 +167,7 @@ static const char *vtype2string(enum vertextype vtype) return NULL; /* Not reached */ } -const char *vid2string(struct isis_vertex *vertex, char *buff, int size) +const char *vid2string(const struct isis_vertex *vertex, char *buff, int size) { if (VTYPE_IS(vertex->type) || VTYPE_ES(vertex->type)) { const char *hostname = print_sys_hostname(vertex->N.id); @@ -286,6 +286,9 @@ struct isis_spftree *isis_spftree_new(struct isis_area *area, isis_vertex_queue_init(&tree->tents, "IS-IS SPF tents", true); isis_vertex_queue_init(&tree->paths, "IS-IS SPF paths", false); tree->route_table = srcdest_table_init(); + tree->route_table->cleanup = isis_route_node_cleanup; + tree->route_table_backup = srcdest_table_init(); + tree->route_table_backup->cleanup = isis_route_node_cleanup; tree->area = area; tree->lspdb = lspdb; tree->sadj_list = list_new(); @@ -300,16 +303,26 @@ struct isis_spftree *isis_spftree_new(struct isis_area *area, tree->tree_id = tree_id; tree->family = (tree->tree_id == SPFTREE_IPV4) ? AF_INET : AF_INET6; tree->flags = flags; + if (tree->type == SPF_TYPE_TI_LFA) { + isis_spf_node_list_init(&tree->lfa.p_space); + isis_spf_node_list_init(&tree->lfa.q_space); + } return tree; } void isis_spftree_del(struct isis_spftree *spftree) { + if (spftree->type == SPF_TYPE_TI_LFA) { + isis_spf_node_list_clear(&spftree->lfa.q_space); + isis_spf_node_list_clear(&spftree->lfa.p_space); + } + isis_spf_node_list_clear(&spftree->adj_nodes); list_delete(&spftree->sadj_list); isis_vertex_queue_free(&spftree->tents); isis_vertex_queue_free(&spftree->paths); route_table_finish(spftree->route_table); + route_table_finish(spftree->route_table_backup); spftree->route_table = NULL; XFREE(MTYPE_ISIS_SPFTREE, spftree); @@ -389,8 +402,8 @@ static int spf_adj_state_change(struct isis_adjacency *adj) * Find the system LSP: returns the LSP in our LSP database * associated with the given system ID. */ -static struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb, - uint8_t *sysid) +struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb, + const uint8_t *sysid) { struct isis_lsp *lsp; uint8_t lspid[ISIS_SYS_ID_LEN + 2]; @@ -421,7 +434,7 @@ static struct isis_vertex *isis_spf_add_root(struct isis_spftree *spftree) isis_vertex_queue_append(&spftree->paths, vertex); #ifdef EXTREME_DEBUG - zlog_debug("ISIS-Spf: added this IS %s %s depth %d dist %d to PATHS", + zlog_debug("ISIS-SPF: added this IS %s %s depth %d dist %d to PATHS", vtype2string(vertex->type), vid2string(vertex, buff, sizeof(buff)), vertex->depth, vertex->d_N); @@ -502,7 +515,7 @@ static struct isis_vertex *isis_spf_add2tent(struct isis_spftree *spftree, #ifdef EXTREME_DEBUG zlog_debug( - "ISIS-Spf: add to TENT %s %s %s depth %d dist %d adjcount %d", + "ISIS-SPF: add to TENT %s %s %s depth %d dist %d adjcount %d", print_sys_hostname(vertex->N.id), vtype2string(vertex->type), vid2string(vertex, buff, sizeof(buff)), vertex->depth, vertex->d_N, listcount(vertex->Adj_N)); @@ -588,7 +601,7 @@ static void process_N(struct isis_spftree *spftree, enum vertextype vtype, if (vertex) { #ifdef EXTREME_DEBUG zlog_debug( - "ISIS-Spf: process_N %s %s %s dist %d already found from PATH", + "ISIS-SPF: process_N %s %s %s dist %d already found from PATH", print_sys_hostname(vertex->N.id), vtype2string(vtype), vid2string(vertex, buff, sizeof(buff)), dist); #endif /* EXTREME_DEBUG */ @@ -602,7 +615,7 @@ static void process_N(struct isis_spftree *spftree, enum vertextype vtype, /* 1) */ #ifdef EXTREME_DEBUG zlog_debug( - "ISIS-Spf: process_N %s %s %s dist %d parent %s adjcount %d", + "ISIS-SPF: process_N %s %s %s dist %d parent %s adjcount %d", print_sys_hostname(vertex->N.id), vtype2string(vtype), vid2string(vertex, buff, sizeof(buff)), dist, (parent ? print_sys_hostname(parent->N.id) : "null"), @@ -638,7 +651,7 @@ static void process_N(struct isis_spftree *spftree, enum vertextype vtype, } #ifdef EXTREME_DEBUG - zlog_debug("ISIS-Spf: process_N add2tent %s %s dist %d parent %s", + zlog_debug("ISIS-SPF: process_N add2tent %s %s dist %d parent %s", print_sys_hostname(id), vtype2string(vtype), dist, (parent ? print_sys_hostname(parent->N.id) : "null")); #endif /* EXTREME_DEBUG */ @@ -663,6 +676,13 @@ static int isis_spf_process_lsp(struct isis_spftree *spftree, struct isis_mt_router_info *mt_router_info = NULL; struct prefix_pair ip_info; + if (isis_lfa_excise_node_check(spftree, lsp->hdr.lsp_id)) { + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-LFA: excising node %s", + print_sys_hostname(lsp->hdr.lsp_id)); + return ISIS_OK; + } + if (!lsp->tlvs) return ISIS_OK; @@ -691,7 +711,7 @@ static int isis_spf_process_lsp(struct isis_spftree *spftree, } #ifdef EXTREME_DEBUG - zlog_debug("ISIS-Spf: process_lsp %s", + zlog_debug("ISIS-SPF: process_lsp %s", print_sys_hostname(lsp->hdr.lsp_id)); #endif /* EXTREME_DEBUG */ @@ -940,8 +960,22 @@ static void isis_spf_preload_tent(struct isis_spftree *spftree, /* Iterate over adjacencies. */ for (ALL_LIST_ELEMENTS_RO(spftree->sadj_list, node, sadj)) { + const uint8_t *adj_id; uint32_t metric; + if (CHECK_FLAG(sadj->flags, F_ISIS_SPF_ADJ_BROADCAST)) + adj_id = sadj->lan.desig_is_id; + else + adj_id = sadj->id; + + if (isis_lfa_excise_adj_check(spftree, adj_id)) { + if (IS_DEBUG_TILFA) + zlog_debug("ISIS-SPF: excising adjacency %s", + isis_format_id(sadj->id, + ISIS_SYS_ID_LEN + 1)); + continue; + } + metric = CHECK_FLAG(spftree->flags, F_SPFTREE_HOPCOUNT_METRIC) ? 1 : sadj->metric; @@ -1076,6 +1110,17 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree, /* Add adjacency to the list. */ listnode_add(spftree->sadj_list, sadj); + if (!LSP_PSEUDO_ID(id)) { + struct isis_spf_node *node; + + node = isis_spf_node_find(&spftree->adj_nodes, id); + if (!node) + node = isis_spf_node_new(&spftree->adj_nodes, id); + if (node->best_metric == 0 || sadj->metric < node->best_metric) + node->best_metric = sadj->metric; + listnode_add(node->adjacencies, sadj); + } + /* Parse pseudonode LSP too. */ if (LSP_PSEUDO_ID(id)) { uint8_t lspid[ISIS_SYS_ID_LEN + 2]; @@ -1086,7 +1131,7 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree, lsp_pseudo = lsp_search(spftree->lspdb, lspid); if (lsp_pseudo == NULL || lsp_pseudo->hdr.rem_lifetime == 0) { zlog_warn( - "ISIS-Spf: No LSP found from root to L%d DR %s", + "ISIS-SPF: No LSP found from root to L%d DR %s", spftree->level, rawlspid_print(id)); return; } @@ -1177,6 +1222,7 @@ static void isis_spf_build_adj_list(struct isis_spftree *spftree, static void add_to_paths(struct isis_spftree *spftree, struct isis_vertex *vertex) { + struct isis_area *area = spftree->area; char buff[VID2STR_BUFFER]; if (isis_find_vertex(&spftree->paths, &vertex->N, vertex->type)) @@ -1184,22 +1230,54 @@ static void add_to_paths(struct isis_spftree *spftree, isis_vertex_queue_append(&spftree->paths, vertex); #ifdef EXTREME_DEBUG - zlog_debug("ISIS-Spf: added %s %s %s depth %d dist %d to PATHS", + zlog_debug("ISIS-SPF: added %s %s %s depth %d dist %d to PATHS", print_sys_hostname(vertex->N.id), vtype2string(vertex->type), vid2string(vertex, buff, sizeof(buff)), vertex->depth, vertex->d_N); #endif /* EXTREME_DEBUG */ + if (VTYPE_IS(vertex->type) + && !CHECK_FLAG(spftree->flags, F_SPFTREE_NO_ADJACENCIES)) { + if (listcount(vertex->Adj_N) > 0) { + if (spftree->type == SPF_TYPE_TI_LFA) { + struct isis_adjacency *adj; + + if (isis_lfa_check(spftree, vertex) != 0) + return; + + adj = isis_adj_find(area, spftree->level, + vertex->N.id); + if (adj) + sr_adj_sid_add_single( + adj, spftree->family, true, + vertex->Adj_N); + } + } else if (IS_DEBUG_SPF_EVENTS) + zlog_debug( + "ISIS-SPF: no adjacencies, do not install backup Adj-SID for %s depth %d dist %d", + vid2string(vertex, buff, sizeof(buff)), + vertex->depth, vertex->d_N); + } + if (VTYPE_IP(vertex->type) && !CHECK_FLAG(spftree->flags, F_SPFTREE_NO_ROUTES)) { - if (listcount(vertex->Adj_N) > 0) + if (listcount(vertex->Adj_N) > 0) { + struct route_table *route_table; + + if (spftree->type == SPF_TYPE_TI_LFA) { + if (isis_lfa_check(spftree, vertex) != 0) + return; + route_table = spftree->lfa.old.spftree + ->route_table_backup; + } else + route_table = spftree->route_table; + isis_route_create(&vertex->N.ip.dest, &vertex->N.ip.src, vertex->d_N, vertex->depth, - vertex->Adj_N, spftree->area, - spftree->route_table); - else if (IS_DEBUG_SPF_EVENTS) + vertex->Adj_N, area, route_table); + } else if (IS_DEBUG_SPF_EVENTS) zlog_debug( - "ISIS-Spf: no adjacencies do not install route for %s depth %d dist %d", + "ISIS-SPF: no adjacencies, do not install route for %s depth %d dist %d", vid2string(vertex, buff, sizeof(buff)), vertex->depth, vertex->d_N); } @@ -1210,6 +1288,7 @@ static void add_to_paths(struct isis_spftree *spftree, static void init_spt(struct isis_spftree *spftree, int mtid) { /* Clear data from previous run. */ + isis_spf_node_list_clear(&spftree->adj_nodes); list_delete_all_node(spftree->sadj_list); isis_vertex_queue_clear(&spftree->tents); isis_vertex_queue_clear(&spftree->paths); @@ -1228,7 +1307,7 @@ static void isis_spf_loop(struct isis_spftree *spftree, #ifdef EXTREME_DEBUG zlog_debug( - "ISIS-Spf: get TENT node %s %s depth %d dist %d to PATHS", + "ISIS-SPF: get TENT node %s %s depth %d dist %d to PATHS", print_sys_hostname(vertex->N.id), vtype2string(vertex->type), vertex->depth, vertex->d_N); #endif /* EXTREME_DEBUG */ @@ -1239,7 +1318,7 @@ static void isis_spf_loop(struct isis_spftree *spftree, lsp = lsp_for_vertex(spftree, vertex); if (!lsp) { - zlog_warn("ISIS-Spf: No LSP found for %s", + zlog_warn("ISIS-SPF: No LSP found for %s", isis_format_id(vertex->N.id, sizeof(vertex->N.id))); continue; @@ -1301,7 +1380,7 @@ void isis_run_spf(struct isis_spftree *spftree) root_lsp = isis_root_system_lsp(spftree->lspdb, spftree->sysid); if (root_lsp == NULL) { - zlog_err("ISIS-Spf: could not find own l%d LSP!", + zlog_err("ISIS-SPF: could not find own l%d LSP!", spftree->level); return; } @@ -1343,7 +1422,7 @@ void isis_run_spf(struct isis_spftree *spftree) */ if (!isis_vertex_queue_count(&spftree->tents) && (IS_DEBUG_SPF_EVENTS)) { - zlog_warn("ISIS-Spf: TENT is empty SPF-root:%s", + zlog_warn("ISIS-SPF: TENT is empty SPF-root:%s", print_sys_hostname(spftree->sysid)); } @@ -1356,28 +1435,48 @@ void isis_run_spf(struct isis_spftree *spftree) + (time_end.tv_usec - time_start.tv_usec); } +static void isis_run_spf_with_protection(struct isis_area *area, + struct isis_spftree *spftree) +{ + /* Run forward SPF locally. */ + memcpy(spftree->sysid, area->isis->sysid, ISIS_SYS_ID_LEN); + isis_run_spf(spftree); + + /* Run LFA protection if configured. */ + if (area->lfa_protected_links[spftree->level - 1] > 0) + isis_spf_run_lfa(area, spftree); +} + void isis_spf_verify_routes(struct isis_area *area, struct isis_spftree **trees) { if (area->is_type == IS_LEVEL_1) { - isis_route_verify_table(area, trees[0]->route_table); + isis_route_verify_table(area, trees[0]->route_table, + trees[0]->route_table_backup); } else if (area->is_type == IS_LEVEL_2) { - isis_route_verify_table(area, trees[1]->route_table); + isis_route_verify_table(area, trees[1]->route_table, + trees[1]->route_table_backup); } else { isis_route_verify_merge(area, trees[0]->route_table, - trees[1]->route_table); + trees[0]->route_table_backup, + trees[1]->route_table, + trees[1]->route_table_backup); } } void isis_spf_invalidate_routes(struct isis_spftree *tree) { isis_route_invalidate_table(tree->area, tree->route_table); + + /* Delete backup routes. */ + route_table_finish(tree->route_table_backup); + tree->route_table_backup = srcdest_table_init(); + tree->route_table_backup->cleanup = isis_route_node_cleanup; } static int isis_run_spf_cb(struct thread *thread) { struct isis_spf_run *run = THREAD_ARG(thread); struct isis_area *area = run->area; - struct isis_spftree *spftree; int level = run->level; XFREE(MTYPE_ISIS_SPF_RUN, run); @@ -1390,27 +1489,22 @@ static int isis_run_spf_cb(struct thread *thread) return ISIS_WARNING; } + isis_area_delete_backup_adj_sids(area, level); isis_area_invalidate_routes(area, level); if (IS_DEBUG_SPF_EVENTS) - zlog_debug("ISIS-Spf (%s) L%d SPF needed, periodic SPF", + zlog_debug("ISIS-SPF (%s) L%d SPF needed, periodic SPF", area->area_tag, level); - if (area->ip_circuits) { - spftree = area->spftree[SPFTREE_IPV4][level - 1]; - memcpy(spftree->sysid, area->isis->sysid, ISIS_SYS_ID_LEN); - isis_run_spf(spftree); - } - if (area->ipv6_circuits) { - spftree = area->spftree[SPFTREE_IPV6][level - 1]; - memcpy(spftree->sysid, area->isis->sysid, ISIS_SYS_ID_LEN); - isis_run_spf(spftree); - } - if (area->ipv6_circuits && isis_area_ipv6_dstsrc_enabled(area)) { - spftree = area->spftree[SPFTREE_DSTSRC][level - 1]; - memcpy(spftree->sysid, area->isis->sysid, ISIS_SYS_ID_LEN); - isis_run_spf(spftree); - } + if (area->ip_circuits) + isis_run_spf_with_protection( + area, area->spftree[SPFTREE_IPV4][level - 1]); + if (area->ipv6_circuits) + isis_run_spf_with_protection( + area, area->spftree[SPFTREE_IPV6][level - 1]); + if (area->ipv6_circuits && isis_area_ipv6_dstsrc_enabled(area)) + isis_run_spf_with_protection( + area, area->spftree[SPFTREE_DSTSRC][level - 1]); isis_area_verify_routes(area); @@ -1452,7 +1546,7 @@ int _isis_spf_schedule(struct isis_area *area, int level, if (IS_DEBUG_SPF_EVENTS) { zlog_debug( - "ISIS-Spf (%s) L%d SPF schedule called, lastrun %d sec ago Caller: %s %s:%d", + "ISIS-SPF (%s) L%d SPF schedule called, lastrun %d sec ago Caller: %s %s:%d", area->area_tag, level, diff, func, file, line); } @@ -1487,7 +1581,7 @@ int _isis_spf_schedule(struct isis_area *area, int level, if (area->bfd_force_spf_refresh) { zlog_debug( - "ISIS-Spf (%s) L%d SPF scheduled immediately due to BFD 'down' message", + "ISIS-SPF (%s) L%d SPF scheduled immediately due to BFD 'down' message", area->area_tag, level); area->bfd_force_spf_refresh = false; } @@ -1499,7 +1593,7 @@ int _isis_spf_schedule(struct isis_area *area, int level, timer, &area->spf_timer[level - 1]); if (IS_DEBUG_SPF_EVENTS) - zlog_debug("ISIS-Spf (%s) L%d SPF scheduled %ld sec from now", + zlog_debug("ISIS-SPF (%s) L%d SPF scheduled %ld sec from now", area->area_tag, level, timer); return ISIS_OK; @@ -1706,8 +1800,10 @@ DEFUN(show_isis_topology, show_isis_topology_cmd, return CMD_SUCCESS; } -void isis_print_routes(struct vty *vty, struct isis_spftree *spftree) +void isis_print_routes(struct vty *vty, struct isis_spftree *spftree, + bool backup) { + struct route_table *route_table; struct ttable *tt; struct route_node *rn; const char *tree_id_text = NULL; @@ -1741,7 +1837,9 @@ void isis_print_routes(struct vty *vty, struct isis_spftree *spftree) ttable_restyle(tt); ttable_rowseps(tt, 0, BOTTOM, true, '-'); - for (rn = route_top(spftree->route_table); rn; rn = route_next(rn)) { + route_table = + (backup) ? spftree->route_table_backup : spftree->route_table; + for (rn = route_top(route_table); rn; rn = route_next(rn)) { struct isis_route_info *rinfo; struct isis_nexthop *nexthop; struct listnode *node; @@ -1779,7 +1877,22 @@ void isis_print_routes(struct vty *vty, struct isis_spftree *spftree) strlcpy(buf_iface, "-", sizeof(buf_iface)); } - if (nexthop->sr.label != MPLS_INVALID_LABEL) + if (nexthop->label_stack) { + for (int i = 0; + i < nexthop->label_stack->num_labels; + i++) { + char buf_label[BUFSIZ]; + + label2str( + nexthop->label_stack->label[i], + buf_label, sizeof(buf_label)); + if (i != 0) + strlcat(buf_labels, "/", + sizeof(buf_labels)); + strlcat(buf_labels, buf_label, + sizeof(buf_labels)); + } + } else if (nexthop->sr.label != MPLS_INVALID_LABEL) label2str(nexthop->sr.label, buf_labels, sizeof(buf_labels)); else @@ -1808,7 +1921,7 @@ void isis_print_routes(struct vty *vty, struct isis_spftree *spftree) } static void show_isis_route_common(struct vty *vty, int levels, - struct isis *isis) + struct isis *isis, bool backup) { struct listnode *node; struct isis_area *area; @@ -1827,17 +1940,20 @@ static void show_isis_route_common(struct vty *vty, int levels, if (area->ip_circuits > 0) { isis_print_routes( vty, - area->spftree[SPFTREE_IPV4][level - 1]); + area->spftree[SPFTREE_IPV4][level - 1], + backup); } if (area->ipv6_circuits > 0) { isis_print_routes( vty, - area->spftree[SPFTREE_IPV6][level - 1]); + area->spftree[SPFTREE_IPV6][level - 1], + backup); } if (isis_area_ipv6_dstsrc_enabled(area)) { isis_print_routes(vty, area->spftree[SPFTREE_DSTSRC] - [level - 1]); + [level - 1], + backup); } } } @@ -1849,20 +1965,21 @@ DEFUN(show_isis_route, show_isis_route_cmd, #ifndef FABRICD " []" #endif - , + " [backup]", SHOW_STR PROTO_HELP VRF_FULL_CMD_HELP_STR "IS-IS routing table\n" #ifndef FABRICD "level-1 routes\n" "level-2 routes\n" #endif -) + "Show backup routes\n") { int levels; struct isis *isis; struct listnode *node; const char *vrf_name = VRF_DEFAULT_NAME; bool all_vrf = false; + bool backup = false; int idx = 0; if (argv_find(argv, argc, "level-1", &idx)) @@ -1878,15 +1995,19 @@ DEFUN(show_isis_route, show_isis_route_cmd, } ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf); + if (argv_find(argv, argc, "backup", &idx)) + backup = true; + if (vrf_name) { if (all_vrf) { for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) - show_isis_route_common(vty, levels, isis); + show_isis_route_common(vty, levels, isis, + backup); return CMD_SUCCESS; } isis = isis_lookup_by_vrfname(vrf_name); if (isis != NULL) - show_isis_route_common(vty, levels, isis); + show_isis_route_common(vty, levels, isis, backup); } return CMD_SUCCESS; diff --git a/isisd/isis_spf.h b/isisd/isis_spf.h index b2dc23496f3e..5d07c80d20a9 100644 --- a/isisd/isis_spf.h +++ b/isisd/isis_spf.h @@ -24,11 +24,14 @@ #ifndef _ZEBRA_ISIS_SPF_H #define _ZEBRA_ISIS_SPF_H +#include "isisd/isis_lfa.h" + struct isis_spftree; enum spf_type { SPF_TYPE_FORWARD = 1, SPF_TYPE_REVERSE, + SPF_TYPE_TI_LFA, }; struct isis_spf_adj { @@ -56,17 +59,21 @@ void isis_spf_verify_routes(struct isis_area *area, void isis_spftree_del(struct isis_spftree *spftree); void spftree_area_init(struct isis_area *area); void spftree_area_del(struct isis_area *area); +struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb, + const uint8_t *sysid); #define isis_spf_schedule(area, level) \ _isis_spf_schedule((area), (level), __func__, \ __FILE__, __LINE__) int _isis_spf_schedule(struct isis_area *area, int level, const char *func, const char *file, int line); void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree); -void isis_print_routes(struct vty *vty, struct isis_spftree *spftree); +void isis_print_routes(struct vty *vty, struct isis_spftree *spftree, + bool backup); void isis_spf_init(void); void isis_spf_print(struct isis_spftree *spftree, struct vty *vty); void isis_run_spf(struct isis_spftree *spftree); struct isis_spftree *isis_run_hopcount_spf(struct isis_area *area, uint8_t *sysid, struct isis_spftree *spftree); + #endif /* _ZEBRA_ISIS_SPF_H */ diff --git a/isisd/isis_spf_private.h b/isisd/isis_spf_private.h index 1e61bf0f4855..1a2e969bd9f1 100644 --- a/isisd/isis_spf_private.h +++ b/isisd/isis_spf_private.h @@ -306,8 +306,10 @@ struct isis_spftree { struct isis_vertex_queue paths; /* the SPT */ struct isis_vertex_queue tents; /* TENT */ struct route_table *route_table; + struct route_table *route_table_backup; struct lspdb_head *lspdb; /* link-state db */ struct list *sadj_list; + struct isis_spf_nodes adj_nodes; struct isis_area *area; /* back pointer to area */ unsigned int runcount; /* number of runs since uptime */ time_t last_run_timestamp; /* last run timestamp as wall time for display */ @@ -320,7 +322,20 @@ struct isis_spftree { int family; int level; enum spf_tree_id tree_id; - bool hopcount_metric; + struct { + /* Original pre-failure local SPTs. */ + struct { + struct isis_spftree *spftree; + struct isis_spftree *spftree_reverse; + } old; + + /* Protected resource. */ + struct lfa_protected_resource protected_resource; + + /* P-space and Q-space. */ + struct isis_spf_nodes p_space; + struct isis_spf_nodes q_space; + } lfa; uint8_t flags; }; #define F_SPFTREE_HOPCOUNT_METRIC 0x01 @@ -373,6 +388,7 @@ static struct isis_lsp *lsp_for_vertex(struct isis_spftree *spftree, } #define VID2STR_BUFFER SRCDEST2STR_BUFFER -const char *vid2string(struct isis_vertex *vertex, char *buff, int size); +const char *vtype2string(enum vertextype vtype); +const char *vid2string(const struct isis_vertex *vertex, char *buff, int size); #endif diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index d05afaa63081..842103de1e17 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -56,6 +56,7 @@ static void sr_local_block_delete(struct isis_area *area); static int sr_local_block_init(struct isis_area *area); static void sr_adj_sid_update(struct sr_adjacency *sra, struct sr_local_block *srlb); +static void sr_adj_sid_del(struct sr_adjacency *sra); /* --- RB-Tree Management functions ----------------------------------------- */ @@ -1254,6 +1255,23 @@ static void process_node_changes(struct isis_area *area, int level, process_prefix_changes(srn, srp); } +/** + * Delete all backup Adj-SIDs. + * + * @param area IS-IS area + * @param level IS-IS level + */ +void isis_area_delete_backup_adj_sids(struct isis_area *area, int level) +{ + struct sr_adjacency *sra; + struct listnode *node, *nnode; + + for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra)) + if (sra->type == ISIS_SR_LAN_BACKUP + && (sra->adj->level & level)) + sr_adj_sid_del(sra); +} + /** * Parse and process all SR-related Sub-TLVs after running the SPF algorithm. * @@ -1499,12 +1517,13 @@ static int sr_local_block_release_label(struct sr_local_block *srlb, /** * Add new local Adjacency-SID. * - * @param adj IS-IS Adjacency - * @param family Inet Family (IPv4 or IPv6) - * @param backup True to initialize backup Adjacency SID + * @param adj IS-IS Adjacency + * @param family Inet Family (IPv4 or IPv6) + * @param backup True to initialize backup Adjacency SID + * @param nexthops List of backup nexthops (for backup Adj-SIDs only) */ -static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, - bool backup) +void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, bool backup, + struct list *nexthops) { struct isis_circuit *circuit = adj->circuit; struct isis_area *area = circuit->area; @@ -1555,9 +1574,25 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, sra = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*sra)); sra->type = backup ? ISIS_SR_LAN_BACKUP : ISIS_SR_ADJ_NORMAL; + sra->input_label = input_label; sra->nexthop.family = family; sra->nexthop.address = nexthop; - sra->nexthop.label = input_label; + + if (backup && nexthops) { + struct isis_vertex_adj *vadj; + struct listnode *node; + + sra->backup_nexthops = list_new(); + for (ALL_LIST_ELEMENTS_RO(nexthops, node, vadj)) { + struct isis_adjacency *adj = vadj->sadj->adj; + struct mpls_label_stack *label_stack; + + label_stack = vadj->label_stack; + adjinfo2nexthop(family, sra->backup_nexthops, adj, + label_stack); + } + } + switch (circuit->circ_type) { /* LAN Adjacency-SID for Broadcast interface section #2.2.2 */ case CIRCUIT_T_BROADCAST: @@ -1603,8 +1638,7 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, */ static void sr_adj_sid_add(struct isis_adjacency *adj, int family) { - sr_adj_sid_add_single(adj, family, false); - sr_adj_sid_add_single(adj, family, true); + sr_adj_sid_add_single(adj, family, false, NULL); } static void sr_adj_sid_update(struct sr_adjacency *sra, @@ -1616,16 +1650,16 @@ static void sr_adj_sid_update(struct sr_adjacency *sra, isis_zebra_send_adjacency_sid(ZEBRA_MPLS_LABELS_DELETE, sra); /* Got new label in the new SRLB */ - sra->nexthop.label = sr_local_block_request_label(srlb); - if (sra->nexthop.label == MPLS_INVALID_LABEL) + sra->input_label = sr_local_block_request_label(srlb); + if (sra->input_label == MPLS_INVALID_LABEL) return; switch (circuit->circ_type) { case CIRCUIT_T_BROADCAST: - sra->u.ladj_sid->sid = sra->nexthop.label; + sra->u.ladj_sid->sid = sra->input_label; break; case CIRCUIT_T_P2P: - sra->u.adj_sid->sid = sra->nexthop.label; + sra->u.adj_sid->sid = sra->input_label; break; default: flog_warn(EC_LIB_DEVELOPMENT, "%s: unexpected circuit type: %u", @@ -1669,12 +1703,38 @@ static void sr_adj_sid_del(struct sr_adjacency *sra) exit(1); } + if (sra->type == ISIS_SR_LAN_BACKUP && sra->backup_nexthops) { + sra->backup_nexthops->del = + (void (*)(void *))isis_nexthop_delete; + list_delete(&sra->backup_nexthops); + } + /* Remove Adjacency-SID from the SRDB */ listnode_delete(area->srdb.adj_sids, sra); listnode_delete(sra->adj->adj_sids, sra); XFREE(MTYPE_ISIS_SR_INFO, sra); } +/** + * Lookup Segment Routing Adj-SID by family and type. + * + * @param adj IS-IS Adjacency + * @param family Inet Family (IPv4 or IPv6) + * @param type Adjacency SID type + */ +struct sr_adjacency *isis_sr_adj_sid_find(struct isis_adjacency *adj, + int family, enum sr_adj_type type) +{ + struct sr_adjacency *sra; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO(adj->adj_sids, node, sra)) + if (sra->nexthop.family == family && sra->type == type) + return sra; + + return NULL; +} + /** * Remove all Adjacency-SIDs associated to an adjacency that is going down. * @@ -1792,15 +1852,17 @@ static int sr_if_new_hook(struct interface *ifp) /** * Show LFIB operation in human readable format. * - * @param buf Buffer to store string output. Must be pre-allocate - * @param size Size of the buffer - * @param label_in Input Label - * @param label_out Output Label + * @param buf Buffer to store string output. Must be pre-allocate + * @param size Size of the buffer + * @param label_in Input Label + * @param label_out Output Label + * @param label_stack Output Label Stack (TI-LFA) * * @return String containing LFIB operation in human readable format */ static char *sr_op2str(char *buf, size_t size, mpls_label_t label_in, - mpls_label_t label_out) + mpls_label_t label_out, + const struct mpls_label_stack *label_stack) { if (size < 24) return NULL; @@ -1810,6 +1872,16 @@ static char *sr_op2str(char *buf, size_t size, mpls_label_t label_in, return buf; } + if (label_stack) { + char buf_labels[256]; + + mpls_label2str(label_stack->num_labels, &label_stack->label[0], + buf_labels, sizeof(buf_labels), 1); + + snprintf(buf, size, "Swap(%u, %s)", label_in, buf_labels); + return buf; + } + switch (label_out) { case MPLS_LABEL_IMPLICIT_NULL: snprintf(buf, size, "Pop(%u)", label_in); @@ -1859,7 +1931,7 @@ static void show_prefix_sid_local(struct vty *vty, struct ttable *tt, snprintf(buf_uptime, sizeof(buf_uptime), "-"); } sr_op2str(buf_oper, sizeof(buf_oper), srp->input_label, - MPLS_LABEL_IMPLICIT_NULL); + MPLS_LABEL_IMPLICIT_NULL, NULL); ttable_add_row(tt, "%s|%u|%s|-|%s|%s", prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)), @@ -1876,7 +1948,7 @@ static void show_prefix_sid_local(struct vty *vty, struct ttable *tt, */ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, const struct isis_area *area, - const struct sr_prefix *srp) + const struct sr_prefix *srp, bool backup) { struct isis_nexthop *nexthop; struct listnode *node; @@ -1886,19 +1958,22 @@ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, char buf_iface[BUFSIZ]; char buf_uptime[BUFSIZ]; bool first = true; + struct isis_route_info *rinfo; (void)prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)); - if (!srp->u.remote.rinfo) { + rinfo = srp->u.remote.rinfo; + if (rinfo && backup) + rinfo = rinfo->backup; + if (!rinfo) { ttable_add_row(tt, "%s|%u|%s|-|-|-", buf_prefix, srp->sid.value, sr_op2str(buf_oper, sizeof(buf_oper), srp->input_label, - MPLS_LABEL_IMPLICIT_NULL)); + MPLS_LABEL_IMPLICIT_NULL, NULL)); return; } - for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, - nexthop)) { + for (ALL_LIST_ELEMENTS_RO(rinfo->nexthops, node, nexthop)) { struct interface *ifp; inet_ntop(nexthop->family, &nexthop->ip, buf_nhop, @@ -1915,7 +1990,7 @@ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, log_uptime(nexthop->sr.uptime, buf_uptime, sizeof(buf_uptime)); sr_op2str(buf_oper, sizeof(buf_oper), srp->input_label, - nexthop->sr.label); + nexthop->sr.label, nexthop->label_stack); if (first) ttable_add_row(tt, "%s|%u|%s|%s|%s|%s", buf_prefix, @@ -1935,7 +2010,8 @@ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, * @param area IS-IS area * @param level IS-IS level */ -static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) +static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level, + bool backup) { struct sr_prefix *srp; struct ttable *tt; @@ -1960,7 +2036,7 @@ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) show_prefix_sid_local(vty, tt, area, srp); break; case ISIS_SR_PREFIX_REMOTE: - show_prefix_sid_remote(vty, tt, area, srp); + show_prefix_sid_remote(vty, tt, area, srp, backup); break; } } @@ -1980,20 +2056,25 @@ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) * Declaration of new show commands. */ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, - "show isis [vrf ] segment-routing prefix-sids", + "show isis [vrf ] segment-routing prefix-sids [backup]", SHOW_STR PROTO_HELP VRF_CMD_HELP_STR "All VRFs\n" "Segment-Routing\n" - "Segment-Routing Prefix-SIDs\n") + "Segment-Routing Prefix-SIDs\n" + "Show backup Prefix-SIDs\n") { struct listnode *node, *inode; struct isis_area *area; struct isis *isis = NULL; const char *vrf_name = VRF_DEFAULT_NAME; bool all_vrf = false; - int idx_vrf = 0; + bool backup = false; + int idx = 0; + + ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf); + if (argv_find(argv, argc, "backup", &idx)) + backup = true; - ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf); if (vrf_name) { if (all_vrf) { for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) { @@ -2005,7 +2086,7 @@ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) show_prefix_sids(vty, area, - level); + level, backup); } } return 0; @@ -2019,7 +2100,8 @@ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, : "null"); for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) - show_prefix_sids(vty, area, level); + show_prefix_sids(vty, area, level, + backup); } } } diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index 4379a1dcba61..2e4f3a69f794 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -84,13 +84,18 @@ struct sr_adjacency { /* Adjacency type. */ enum sr_adj_type type; + /* Adjacency-SID input label. */ + mpls_label_t input_label; + /* Adjacency-SID nexthop information. */ struct { int family; union g_addr address; - mpls_label_t label; } nexthop; + /* Adjacency-SID TI-LFA backup nexthops. */ + struct list *backup_nexthops; + /* (LAN-)Adjacency-SID Sub-TLV. */ union { struct isis_adj_sid *adj_sid; @@ -277,6 +282,12 @@ extern void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, extern void isis_sr_nexthop_update(struct sr_nexthop_info *srnh, mpls_label_t label); extern void isis_sr_nexthop_reset(struct sr_nexthop_info *srnh); +extern void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, + bool backup, struct list *nexthops); +extern struct sr_adjacency *isis_sr_adj_sid_find(struct isis_adjacency *adj, + int family, + enum sr_adj_type type); +extern void isis_area_delete_backup_adj_sids(struct isis_area *area, int level); extern void isis_area_verify_sr(struct isis_area *area); extern int isis_sr_start(struct isis_area *area); extern void isis_sr_stop(struct isis_area *area); diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 9ed868e7959e..0e92dc2a8942 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -168,42 +168,29 @@ static int isis_zebra_link_params(ZAPI_CALLBACK_ARGS) return 0; } -void isis_zebra_route_add_route(struct isis *isis, - struct prefix *prefix, - struct prefix_ipv6 *src_p, - struct isis_route_info *route_info) +enum isis_zebra_nexthop_type { + ISIS_ROUTE_NEXTHOP_MAIN = 0, + ISIS_ROUTE_NEXTHOP_BACKUP, + ISIS_MPLS_NEXTHOP_MAIN, + ISIS_MPLS_NEXTHOP_BACKUP, +}; + +static int isis_zebra_add_nexthops(struct isis *isis, struct list *nexthops, + struct zapi_nexthop zapi_nexthops[], + enum isis_zebra_nexthop_type type, + uint8_t backup_nhs) { - struct zapi_route api; - struct zapi_nexthop *api_nh; struct isis_nexthop *nexthop; struct listnode *node; int count = 0; - if (zclient->sock < 0) - return; - - memset(&api, 0, sizeof(api)); - api.vrf_id = isis->vrf_id; - api.type = PROTO_TYPE; - api.safi = SAFI_UNICAST; - api.prefix = *prefix; - if (src_p && src_p->prefixlen) { - api.src_prefix = *src_p; - SET_FLAG(api.message, ZAPI_MESSAGE_SRCPFX); - } - SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP); - SET_FLAG(api.message, ZAPI_MESSAGE_METRIC); - api.metric = route_info->cost; -#if 0 - SET_FLAG(api.message, ZAPI_MESSAGE_DISTANCE); - api.distance = route_info->depth; -#endif - /* Nexthops */ - for (ALL_LIST_ELEMENTS_RO(route_info->nexthops, node, nexthop)) { + for (ALL_LIST_ELEMENTS_RO(nexthops, node, nexthop)) { + struct zapi_nexthop *api_nh; + if (count >= MULTIPATH_NUM) break; - api_nh = &api.nexthops[count]; + api_nh = &zapi_nexthops[count]; if (fabricd) SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_ONLINK); api_nh->vrf_id = isis->vrf_id; @@ -234,11 +221,98 @@ void isis_zebra_route_add_route(struct isis *isis, } api_nh->ifindex = nexthop->ifindex; + + /* Add MPLS label(s). */ + switch (type) { + case ISIS_ROUTE_NEXTHOP_MAIN: + case ISIS_ROUTE_NEXTHOP_BACKUP: + /* + * SR/TI-LFA labels are installed using separate + * messages. + */ + break; + case ISIS_MPLS_NEXTHOP_MAIN: + if (nexthop->sr.label != MPLS_INVALID_LABEL) { + api_nh->label_num = 1; + api_nh->labels[0] = nexthop->sr.label; + } else { + api_nh->label_num = 1; + api_nh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; + } + break; + case ISIS_MPLS_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 { + api_nh->label_num = 1; + api_nh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; + } + break; + } + + /* Backup nexthop handling. */ + if (backup_nhs) { + SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_HAS_BACKUP); + /* + * If the backup has multiple nexthops, all of them + * protect the same primary nexthop since ECMP routes + * have no backups. + */ + api_nh->backup_num = backup_nhs; + for (int i = 0; i < backup_nhs; i++) + api_nh->backup_idx[i] = i; + } count++; } - if (!count) + + return count; +} + +void isis_zebra_route_add_route(struct isis *isis, struct prefix *prefix, + struct prefix_ipv6 *src_p, + struct isis_route_info *route_info) +{ + struct zapi_route api; + int count = 0; + + if (zclient->sock < 0) return; + memset(&api, 0, sizeof(api)); + api.vrf_id = isis->vrf_id; + api.type = PROTO_TYPE; + api.safi = SAFI_UNICAST; + api.prefix = *prefix; + if (src_p && src_p->prefixlen) { + api.src_prefix = *src_p; + SET_FLAG(api.message, ZAPI_MESSAGE_SRCPFX); + } + SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP); + SET_FLAG(api.message, ZAPI_MESSAGE_METRIC); + api.metric = route_info->cost; + + /* Add backup nexthops first. */ + if (route_info->backup) { + count = isis_zebra_add_nexthops( + isis, route_info->backup->nexthops, api.backup_nexthops, + ISIS_ROUTE_NEXTHOP_BACKUP, 0); + if (count > 0) { + SET_FLAG(api.message, ZAPI_MESSAGE_BACKUP_NEXTHOPS); + api.backup_nexthop_num = count; + } + } + + /* Add primary nexthops. */ + count = isis_zebra_add_nexthops(isis, route_info->nexthops, + api.nexthops, ISIS_ROUTE_NEXTHOP_MAIN, + count); + if (!count) + return; api.nexthop_num = count; zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api); @@ -274,11 +348,12 @@ void isis_zebra_route_del_route(struct isis *isis, */ static void isis_zebra_prefix_install_prefix_sid(const struct sr_prefix *srp) { + struct isis *isis = srp->srn->area->isis; struct zapi_labels zl; struct zapi_nexthop *znh; - struct listnode *node; - struct isis_nexthop *nexthop; struct interface *ifp; + struct isis_route_info *rinfo; + int count = 0; /* Prepare message. */ memset(&zl, 0, sizeof(zl)); @@ -308,23 +383,27 @@ static void isis_zebra_prefix_install_prefix_sid(const struct sr_prefix *srp) zl.route.type = ZEBRA_ROUTE_ISIS; zl.route.instance = 0; - for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, - nexthop)) { - if (nexthop->sr.label == MPLS_INVALID_LABEL) - continue; - - if (zl.nexthop_num >= MULTIPATH_NUM) - break; - - znh = &zl.nexthops[zl.nexthop_num++]; - znh->type = (srp->prefix.family == AF_INET) - ? NEXTHOP_TYPE_IPV4_IFINDEX - : NEXTHOP_TYPE_IPV6_IFINDEX; - znh->gate = nexthop->ip; - znh->ifindex = nexthop->ifindex; - znh->label_num = 1; - znh->labels[0] = nexthop->sr.label; + rinfo = srp->u.remote.rinfo; + + /* Add backup nexthops first. */ + if (rinfo->backup) { + count = isis_zebra_add_nexthops( + isis, rinfo->backup->nexthops, + zl.backup_nexthops, ISIS_MPLS_NEXTHOP_BACKUP, + 0); + if (count > 0) { + SET_FLAG(zl.message, ZAPI_LABELS_HAS_BACKUPS); + zl.backup_nexthop_num = count; + } } + + /* Add primary nexthops. */ + count = isis_zebra_add_nexthops(isis, rinfo->nexthops, + zl.nexthops, + ISIS_MPLS_NEXTHOP_MAIN, count); + if (!count) + return; + zl.nexthop_num = count; break; } @@ -392,6 +471,7 @@ void isis_zebra_send_prefix_sid(int cmd, const struct sr_prefix *srp) */ void isis_zebra_send_adjacency_sid(int cmd, const struct sr_adjacency *sra) { + struct isis *isis = sra->adj->circuit->area->isis; struct zapi_labels zl; struct zapi_nexthop *znh; @@ -403,11 +483,11 @@ void isis_zebra_send_adjacency_sid(int cmd, const struct sr_adjacency *sra) sr_debug(" |- %s label %u for interface %s", cmd == ZEBRA_MPLS_LABELS_ADD ? "Add" : "Delete", - sra->nexthop.label, sra->adj->circuit->interface->name); + sra->input_label, sra->adj->circuit->interface->name); memset(&zl, 0, sizeof(zl)); zl.type = ZEBRA_LSP_ISIS_SR; - zl.local_label = sra->nexthop.label; + zl.local_label = sra->input_label; zl.nexthop_num = 1; znh = &zl.nexthops[0]; znh->gate = sra->nexthop.address; @@ -418,6 +498,24 @@ void isis_zebra_send_adjacency_sid(int cmd, const struct sr_adjacency *sra) znh->label_num = 1; znh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; + /* Set backup nexthops. */ + if (sra->type == ISIS_SR_LAN_BACKUP) { + int count; + + count = isis_zebra_add_nexthops(isis, sra->backup_nexthops, + zl.backup_nexthops, + ISIS_MPLS_NEXTHOP_BACKUP, 0); + if (count > 0) { + SET_FLAG(zl.message, ZAPI_LABELS_HAS_BACKUPS); + zl.backup_nexthop_num = count; + + SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_HAS_BACKUP); + znh->backup_num = count; + for (int i = 0; i < count; i++) + znh->backup_idx[i] = i; + } + } + (void)zebra_send_mpls_labels(zclient, cmd, &zl); } diff --git a/isisd/isisd.c b/isisd/isisd.c index 8d73c0571dc3..57d3e9c7c0ea 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -77,6 +77,7 @@ unsigned long debug_bfd; unsigned long debug_tx_queue; unsigned long debug_sr; unsigned long debug_ldp_sync; +unsigned long debug_tilfa; DEFINE_QOBJ_TYPE(isis_area) @@ -1191,6 +1192,8 @@ void print_debug(struct vty *vty, int flags, int onoff) if (flags & DEBUG_SR) vty_out(vty, "IS-IS Segment Routing events debugging is %s\n", onoffs); + if (flags & DEBUG_TILFA) + vty_out(vty, "IS-IS TI-LFA events debugging is %s\n", onoffs); if (flags & DEBUG_UPDATE_PACKETS) vty_out(vty, "IS-IS Update related packet debugging is %s\n", onoffs); @@ -1285,6 +1288,10 @@ static int config_write_debug(struct vty *vty) vty_out(vty, "debug " PROTO_NAME " sr-events\n"); write++; } + if (IS_DEBUG_TILFA) { + vty_out(vty, "debug " PROTO_NAME " ti-lfa\n"); + write++; + } if (IS_DEBUG_UPDATE_PACKETS) { vty_out(vty, "debug " PROTO_NAME " update-packets\n"); write++; @@ -1515,6 +1522,33 @@ DEFUN (no_debug_isis_srevents, return CMD_SUCCESS; } +DEFUN (debug_isis_tilfa, + debug_isis_tilfa_cmd, + "debug " PROTO_NAME " ti-lfa", + DEBUG_STR + PROTO_HELP + "IS-IS TI-LFA Events\n") +{ + debug_tilfa |= DEBUG_TILFA; + print_debug(vty, DEBUG_TILFA, 1); + + return CMD_SUCCESS; +} + +DEFUN (no_debug_isis_tilfa, + no_debug_isis_tilfa_cmd, + "no debug " PROTO_NAME " ti-lfa", + NO_STR + UNDEBUG_STR + PROTO_HELP + "IS-IS TI-LFA Events\n") +{ + debug_tilfa &= ~DEBUG_TILFA; + print_debug(vty, DEBUG_TILFA, 0); + + return CMD_SUCCESS; +} + DEFUN (debug_isis_rtevents, debug_isis_rtevents_cmd, "debug " PROTO_NAME " route-events", @@ -2848,6 +2882,8 @@ void isis_init(void) install_element(ENABLE_NODE, &no_debug_isis_spfevents_cmd); install_element(ENABLE_NODE, &debug_isis_srevents_cmd); install_element(ENABLE_NODE, &no_debug_isis_srevents_cmd); + install_element(ENABLE_NODE, &debug_isis_tilfa_cmd); + install_element(ENABLE_NODE, &no_debug_isis_tilfa_cmd); install_element(ENABLE_NODE, &debug_isis_rtevents_cmd); install_element(ENABLE_NODE, &no_debug_isis_rtevents_cmd); install_element(ENABLE_NODE, &debug_isis_events_cmd); @@ -2877,6 +2913,8 @@ void isis_init(void) install_element(CONFIG_NODE, &no_debug_isis_spfevents_cmd); install_element(CONFIG_NODE, &debug_isis_srevents_cmd); install_element(CONFIG_NODE, &no_debug_isis_srevents_cmd); + install_element(CONFIG_NODE, &debug_isis_tilfa_cmd); + install_element(CONFIG_NODE, &no_debug_isis_tilfa_cmd); install_element(CONFIG_NODE, &debug_isis_rtevents_cmd); install_element(CONFIG_NODE, &no_debug_isis_rtevents_cmd); install_element(CONFIG_NODE, &debug_isis_events_cmd); diff --git a/isisd/isisd.h b/isisd/isisd.h index d8df6eead90e..921df4d7ef14 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -188,6 +188,8 @@ struct isis_area { struct isis_sr_db srdb; int ipv6_circuits; bool purge_originator; + /* Fast Re-Route information. */ + size_t lfa_protected_links[ISIS_LEVELS]; /* Counters */ uint32_t circuit_state_changes; struct isis_redist redist_settings[REDIST_PROTOCOL_COUNT] @@ -278,6 +280,7 @@ extern unsigned long debug_bfd; extern unsigned long debug_tx_queue; extern unsigned long debug_sr; extern unsigned long debug_ldp_sync; +extern unsigned long debug_tilfa; #define DEBUG_ADJ_PACKETS (1<<0) #define DEBUG_SNP_PACKETS (1<<1) @@ -292,7 +295,8 @@ extern unsigned long debug_ldp_sync; #define DEBUG_BFD (1<<10) #define DEBUG_TX_QUEUE (1<<11) #define DEBUG_SR (1<<12) -#define DEBUG_LDP_SYNC (1 << 13) +#define DEBUG_LDP_SYNC (1<<13) +#define DEBUG_TILFA (1<<14) /* Debug related macro. */ #define IS_DEBUG_ADJ_PACKETS (debug_adj_pkt & DEBUG_ADJ_PACKETS) @@ -309,6 +313,7 @@ extern unsigned long debug_ldp_sync; #define IS_DEBUG_TX_QUEUE (debug_tx_queue & DEBUG_TX_QUEUE) #define IS_DEBUG_SR (debug_sr & DEBUG_SR) #define IS_DEBUG_LDP_SYNC (debug_ldp_sync & DEBUG_LDP_SYNC) +#define IS_DEBUG_TILFA (debug_tilfa & DEBUG_TILFA) #define lsp_debug(...) \ do { \ diff --git a/isisd/subdir.am b/isisd/subdir.am index 1d5959262672..4be4efc118a3 100644 --- a/isisd/subdir.am +++ b/isisd/subdir.am @@ -52,6 +52,7 @@ noinst_HEADERS += \ isisd/isis_events.h \ isisd/isis_flags.h \ isisd/isis_ldp_sync.h \ + isisd/isis_lfa.h \ isisd/isis_lsp.h \ isisd/isis_memory.h \ isisd/isis_misc.h \ @@ -86,6 +87,7 @@ LIBISIS_SOURCES = \ isisd/isis_events.c \ isisd/isis_flags.c \ isisd/isis_ldp_sync.c \ + isisd/isis_lfa.c \ isisd/isis_lsp.c \ isisd/isis_memory.c \ isisd/isis_misc.c \ diff --git a/tests/isisd/test_common.c b/tests/isisd/test_common.c index 536847a1da97..5fa604c7499c 100644 --- a/tests/isisd/test_common.c +++ b/tests/isisd/test_common.c @@ -106,6 +106,7 @@ static void lsp_add_ip_reach(struct isis_lsp *lsp, pcfg.sid = *next_sid_index; *next_sid_index = *next_sid_index + 1; pcfg.sid_type = SR_SID_VALUE_TYPE_INDEX; + pcfg.node_sid = true; pcfg.last_hop_behavior = SR_LAST_HOP_BEHAVIOR_PHP; } diff --git a/tests/isisd/test_isis_spf.c b/tests/isisd/test_isis_spf.c index 73bb531dc082..7ac8611bd95b 100644 --- a/tests/isisd/test_isis_spf.c +++ b/tests/isisd/test_isis_spf.c @@ -39,6 +39,7 @@ enum test_type { TEST_SPF = 1, TEST_REVERSE_SPF, + TEST_TI_LFA, }; #define F_DISPLAY_LSPDB 0x01 @@ -65,17 +66,78 @@ static void test_run_spf(struct vty *vty, const struct isis_topology *topology, /* Print the SPT and the corresponding routing table. */ isis_print_spftree(vty, spftree); - isis_print_routes(vty, spftree); + isis_print_routes(vty, spftree, false); /* Cleanup SPF tree. */ isis_spftree_del(spftree); } +static void test_run_ti_lfa(struct vty *vty, + const struct isis_topology *topology, + const struct isis_test_node *root, + struct isis_area *area, struct lspdb_head *lspdb, + int level, int tree, + struct lfa_protected_resource *protected_resource) +{ + struct isis_spftree *spftree_self; + struct isis_spftree *spftree_reverse; + struct isis_spftree *spftree_pc; + struct isis_spf_node *spf_node, *node; + uint8_t flags; + + /* Run forward SPF in the root node. */ + flags = F_SPFTREE_NO_ADJACENCIES; + spftree_self = isis_spftree_new(area, lspdb, root->sysid, level, tree, + SPF_TYPE_FORWARD, flags); + isis_run_spf(spftree_self); + + /* Run reverse SPF in the root node. */ + spftree_reverse = isis_spf_reverse_run(spftree_self); + + /* Run forward SPF on all adjacent routers. */ + isis_spf_run_neighbors(spftree_self); + + /* Compute the TI-LFA repair paths. */ + spftree_pc = isis_tilfa_compute(area, spftree_self, spftree_reverse, + protected_resource); + + /* Print the extended P-space and Q-space. */ + vty_out(vty, "P-space (self):\n"); + RB_FOREACH (node, isis_spf_nodes, &spftree_pc->lfa.p_space) + vty_out(vty, " %s\n", print_sys_hostname(node->sysid)); + vty_out(vty, "\n"); + RB_FOREACH (spf_node, isis_spf_nodes, &spftree_self->adj_nodes) { + if (RB_EMPTY(isis_spf_nodes, &spf_node->lfa.p_space)) + continue; + vty_out(vty, "P-space (%s):\n", + print_sys_hostname(spf_node->sysid)); + RB_FOREACH (node, isis_spf_nodes, &spf_node->lfa.p_space) + vty_out(vty, " %s\n", print_sys_hostname(node->sysid)); + vty_out(vty, "\n"); + } + vty_out(vty, "Q-space:\n"); + RB_FOREACH (node, isis_spf_nodes, &spftree_pc->lfa.q_space) + vty_out(vty, " %s\n", print_sys_hostname(node->sysid)); + vty_out(vty, "\n"); + + /* Print the post-convergence SPT and the correspoding routing table. */ + isis_print_spftree(vty, spftree_pc); + isis_print_routes(vty, spftree_self, true); + + /* Cleanup everything. */ + isis_spftree_del(spftree_self); + isis_spftree_del(spftree_reverse); + isis_spftree_del(spftree_pc); +} + static int test_run(struct vty *vty, const struct isis_topology *topology, const struct isis_test_node *root, enum test_type test_type, - uint8_t flags) + uint8_t flags, enum lfa_protection_type protection_type, + const char *fail_sysid_str, uint8_t fail_pseudonode_id) { struct isis_area *area; + struct lfa_protected_resource protected_resource = {}; + uint8_t fail_id[ISIS_SYS_ID_LEN] = {}; /* Init topology. */ memcpy(isis->sysid, root->sysid, sizeof(isis->sysid)); @@ -87,6 +149,26 @@ static int test_run(struct vty *vty, const struct isis_topology *topology, return CMD_WARNING; } + /* Parse failed link/node. */ + if (fail_sysid_str) { + if (sysid2buff(fail_id, fail_sysid_str) == 0) { + struct isis_dynhn *dynhn; + + dynhn = dynhn_find_by_name(fail_sysid_str); + if (dynhn == NULL) { + vty_out(vty, "Invalid system id %s\n", + fail_sysid_str); + return CMD_WARNING; + } + memcpy(fail_id, dynhn->id, ISIS_SYS_ID_LEN); + } + + protected_resource.type = protection_type; + memcpy(protected_resource.adjacency, fail_id, ISIS_SYS_ID_LEN); + LSP_PSEUDO_ID(protected_resource.adjacency) = + fail_pseudonode_id; + } + for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) { if (level == IS_LEVEL_1 && CHECK_FLAG(flags, F_LEVEL2_ONLY)) continue; @@ -120,6 +202,11 @@ static int test_run(struct vty *vty, const struct isis_topology *topology, &area->lspdb[level - 1], level, tree, true); break; + case TEST_TI_LFA: + test_run_ti_lfa(vty, topology, root, area, + &area->lspdb[level - 1], level, + tree, &protected_resource); + break; } } } @@ -138,6 +225,7 @@ DEFUN(test_isis, test_isis_cmd, <\ spf\ |reverse-spf\ + |ti-lfa system-id WORD [pseudonode-id <1-255>] [node-protection]\ >\ [display-lspdb] [] []", "Test command\n" @@ -148,6 +236,12 @@ DEFUN(test_isis, test_isis_cmd, "SPF root hostname\n" "Normal Shortest Path First\n" "Reverse Shortest Path First\n" + "Topology Independent LFA\n" + "System ID\n" + "System ID\n" + "Pseudonode-ID\n" + "Pseudonode-ID\n" + "Node protection\n" "Display the LSPDB\n" "Do IPv4 processing only\n" "Do IPv6 processing only\n" @@ -158,6 +252,9 @@ DEFUN(test_isis, test_isis_cmd, const struct isis_topology *topology; const struct isis_test_node *root; enum test_type test_type; + enum lfa_protection_type protection_type = 0; + const char *fail_sysid_str = NULL; + uint8_t fail_pseudonode_id = 0; uint8_t flags = 0; int idx = 0; @@ -184,7 +281,18 @@ DEFUN(test_isis, test_isis_cmd, test_type = TEST_SPF; else if (argv_find(argv, argc, "reverse-spf", &idx)) test_type = TEST_REVERSE_SPF; - else + else if (argv_find(argv, argc, "ti-lfa", &idx)) { + test_type = TEST_TI_LFA; + + fail_sysid_str = argv[idx + 2]->arg; + if (argv_find(argv, argc, "pseudonode-id", &idx)) + fail_pseudonode_id = + strtoul(argv[idx + 1]->arg, NULL, 10); + if (argv_find(argv, argc, "node-protection", &idx)) + protection_type = LFA_NODE_PROTECTION; + else + protection_type = LFA_LINK_PROTECTION; + } else return CMD_WARNING; /* Parse control flags. */ @@ -199,7 +307,8 @@ DEFUN(test_isis, test_isis_cmd, else if (argv_find(argv, argc, "level-2-only", &idx)) SET_FLAG(flags, F_LEVEL2_ONLY); - return test_run(vty, topology, root, test_type, flags); + return test_run(vty, topology, root, test_type, flags, protection_type, + fail_sysid_str, fail_pseudonode_id); } static void vty_do_exit(int isexit) @@ -295,6 +404,7 @@ int main(int argc, char **argv) listnode_add(im->isis, isis); SET_FLAG(im->options, F_ISIS_UNIT_TEST); debug_spf_events |= DEBUG_SPF_EVENTS; + debug_tilfa |= DEBUG_TILFA; debug_events |= DEBUG_EVENTS; debug_rte_events |= DEBUG_RTE_EVENTS; diff --git a/tests/isisd/test_isis_spf.in b/tests/isisd/test_isis_spf.in index d9a61782e995..6bc5442f1e92 100644 --- a/tests/isisd/test_isis_spf.in +++ b/tests/isisd/test_isis_spf.in @@ -14,3 +14,27 @@ test isis topology 13 root rt1 spf ipv4-only test isis topology 4 root rt1 reverse-spf ipv4-only test isis topology 11 root rt1 reverse-spf + +test isis topology 1 root rt1 ti-lfa system-id rt2 +test isis topology 2 root rt1 ti-lfa system-id rt3 +test isis topology 2 root rt1 ti-lfa system-id rt1 pseudonode-id 1 +test isis topology 2 root rt5 ti-lfa system-id rt1 pseudonode-id 1 +test isis topology 3 root rt5 ti-lfa system-id rt4 ipv4-only +test isis topology 3 root rt5 ti-lfa system-id rt3 ipv4-only +test isis topology 4 root rt1 ti-lfa system-id rt2 ipv4-only +test isis topology 4 root rt4 ti-lfa system-id rt6 ipv4-only +test isis topology 5 root rt1 ti-lfa system-id rt2 ipv4-only +test isis topology 6 root rt4 ti-lfa system-id rt3 ipv4-only +test isis topology 7 root rt11 ti-lfa system-id rt8 ipv4-only +test isis topology 7 root rt6 ti-lfa system-id rt5 ipv4-only +test isis topology 8 root rt2 ti-lfa system-id rt1 ipv4-only +test isis topology 8 root rt2 ti-lfa system-id rt5 ipv4-only +test isis topology 9 root rt1 ti-lfa system-id rt3 +test isis topology 9 root rt1 ti-lfa system-id rt2 +test isis topology 9 root rt9 ti-lfa system-id rt5 +test isis topology 9 root rt9 ti-lfa system-id rt8 +test isis topology 10 root rt1 ti-lfa system-id rt2 +test isis topology 10 root rt1 ti-lfa system-id rt4 +test isis topology 11 root rt2 ti-lfa system-id rt4 +test isis topology 12 root rt1 ti-lfa system-id rt3 ipv4-only +test isis topology 13 root rt1 ti-lfa system-id rt3 ipv4-only diff --git a/tests/isisd/test_isis_spf.refout b/tests/isisd/test_isis_spf.refout index ed0569947cc0..ea7cc14d7aec 100644 --- a/tests/isisd/test_isis_spf.refout +++ b/tests/isisd/test_isis_spf.refout @@ -699,5 +699,1774 @@ IS-IS L1 IPv6 routing table: 2001:db8::5/128 30 - rt3 - 2001:db8::6/128 40 - rt3 - +test# +test# test isis topology 1 root rt1 ti-lfa system-id rt2 +P-space (self): + rt3 + rt5 + +P-space (rt3): + rt3 + rt5 + rt6 + +Q-space: + rt2 + rt4 + rt6 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt3 TE-IS 10 rt3 - rt1(4) +rt5 TE-IS 20 rt3 - rt3(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +rt6 TE-IS 30 rt3 - rt5(4) +10.0.255.5/32 IP TE 30 rt3 - rt5(4) +rt4 TE-IS 40 rt3 - rt6(4) +10.0.255.6/32 IP TE 40 rt3 - rt6(4) +rt2 TE-IS 50 rt3 - rt4(4) +10.0.255.4/32 IP TE 50 rt3 - rt4(4) +10.0.255.2/32 IP TE 60 rt3 - rt2(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.2/32 60 - rt3 16060 + 10.0.255.4/32 50 - rt3 16060 + +P-space (self): + rt3 + rt5 + +P-space (rt3): + rt3 + rt5 + rt6 + +Q-space: + rt2 + rt4 + rt6 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt3 TE-IS 10 rt3 - rt1(4) +rt5 TE-IS 20 rt3 - rt3(4) +2001:db8::3/128 IP6 internal 20 rt3 - rt3(4) +rt6 TE-IS 30 rt3 - rt5(4) +2001:db8::5/128 IP6 internal 30 rt3 - rt5(4) +rt4 TE-IS 40 rt3 - rt6(4) +2001:db8::6/128 IP6 internal 40 rt3 - rt6(4) +rt2 TE-IS 50 rt3 - rt4(4) +2001:db8::4/128 IP6 internal 50 rt3 - rt4(4) +2001:db8::2/128 IP6 internal 60 rt3 - rt2(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::2/128 60 - rt3 16061 + 2001:db8::4/128 50 - rt3 16061 + +test# test isis topology 2 root rt1 ti-lfa system-id rt3 +P-space (self): + rt2 + rt4 + rt5 + rt6 + +P-space (rt2): + rt2 + +P-space (rt4): + rt2 + rt4 + rt5 + rt6 + +P-space (rt5): + rt2 + rt4 + rt5 + rt6 + +Q-space: + rt3 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt4 TE-IS 10 rt4 - rt1(4) +rt5 TE-IS 10 rt5 - rt1(4) +rt2 TE-IS 15 rt2 - rt1(4) +rt1 +rt6 TE-IS 20 rt4 - rt4(4) + rt5 - rt5(4) +10.0.255.4/32 IP TE 20 rt4 - rt4(4) +10.0.255.5/32 IP TE 20 rt5 - rt5(4) +10.0.255.2/32 IP TE 25 rt2 - rt2(4) +10.0.255.6/32 IP TE 30 rt4 - rt6(4) + rt5 - +rt3 TE-IS 50 rt5 - rt5(4) +10.0.255.3/32 IP TE 60 rt5 - rt3(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.3/32 60 - rt5 16050/18 + +P-space (self): + rt2 + rt4 + rt5 + rt6 + +P-space (rt2): + rt2 + +P-space (rt4): + rt2 + rt4 + rt5 + rt6 + +P-space (rt5): + rt2 + rt4 + rt5 + rt6 + +Q-space: + rt3 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt4 TE-IS 10 rt4 - rt1(4) +rt5 TE-IS 10 rt5 - rt1(4) +rt2 TE-IS 15 rt2 - rt1(4) +rt1 +rt6 TE-IS 20 rt4 - rt4(4) + rt5 - rt5(4) +2001:db8::4/128 IP6 internal 20 rt4 - rt4(4) +2001:db8::5/128 IP6 internal 20 rt5 - rt5(4) +2001:db8::2/128 IP6 internal 25 rt2 - rt2(4) +2001:db8::6/128 IP6 internal 30 rt4 - rt6(4) + rt5 - +rt3 TE-IS 50 rt5 - rt5(4) +2001:db8::3/128 IP6 internal 60 rt5 - rt3(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::3/128 60 - rt5 16051/19 + +test# test isis topology 2 root rt1 ti-lfa system-id rt1 pseudonode-id 1 +P-space (self): + rt2 + rt3 + +P-space (rt2): + rt2 + rt3 + +P-space (rt3): + rt2 + rt3 + +Q-space: + rt4 + rt5 + rt6 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt2 TE-IS 15 rt2 - rt1(4) +10.0.255.2/32 IP TE 25 rt2 - rt2(4) +rt3 TE-IS 30 rt3 - rt1(4) +10.0.255.3/32 IP TE 40 rt3 - rt3(4) +rt4 TE-IS 55 rt2 - rt2(4) +rt1 +rt6 TE-IS 65 rt2 - rt4(4) +rt5 TE-IS 65 rt2 - rt1(2) +10.0.255.4/32 IP TE 65 rt2 - rt4(4) +10.0.255.6/32 IP TE 75 rt2 - rt6(4) +10.0.255.5/32 IP TE 75 rt2 - rt5(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.4/32 65 - rt2 16020/18 + 10.0.255.5/32 75 - rt2 16020/18 + 10.0.255.6/32 75 - rt2 16020/18 + +P-space (self): + rt2 + rt3 + +P-space (rt2): + rt2 + rt3 + +P-space (rt3): + rt2 + rt3 + +Q-space: + rt4 + rt5 + rt6 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt2 TE-IS 15 rt2 - rt1(4) +2001:db8::2/128 IP6 internal 25 rt2 - rt2(4) +rt3 TE-IS 30 rt3 - rt1(4) +2001:db8::3/128 IP6 internal 40 rt3 - rt3(4) +rt4 TE-IS 55 rt2 - rt2(4) +rt1 +rt6 TE-IS 65 rt2 - rt4(4) +rt5 TE-IS 65 rt2 - rt1(2) +2001:db8::4/128 IP6 internal 65 rt2 - rt4(4) +2001:db8::6/128 IP6 internal 75 rt2 - rt6(4) +2001:db8::5/128 IP6 internal 75 rt2 - rt5(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::4/128 65 - rt2 16021/19 + 2001:db8::5/128 75 - rt2 16021/19 + 2001:db8::6/128 75 - rt2 16021/19 + +test# test isis topology 2 root rt5 ti-lfa system-id rt1 pseudonode-id 1 +P-space (self): + rt6 + +P-space (rt3): + rt1 + rt2 + rt3 + rt4 + +P-space (rt6): + rt4 + rt6 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt6 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt5 +10.0.255.5/32 IP internal 0 rt5(4) +rt6 TE-IS 10 rt6 - rt5(4) +rt4 TE-IS 20 rt6 - rt6(4) +10.0.255.6/32 IP TE 20 rt6 - rt6(4) +rt1 pseudo_TE-IS 30 rt6 - rt4(4) +rt1 TE-IS 30 rt6 - rt1(2) +10.0.255.4/32 IP TE 30 rt6 - rt4(4) +rt3 TE-IS 40 rt3 - rt5(4) +10.0.255.1/32 IP TE 40 rt6 - rt1(4) +rt2 TE-IS 45 rt6 - rt1(4) +10.0.255.3/32 IP TE 50 rt3 - rt3(4) +10.0.255.2/32 IP TE 55 rt6 - rt2(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.1/32 40 - rt6 16040 + 10.0.255.2/32 55 - rt6 16040 + 10.0.255.4/32 30 - rt6 - + +P-space (self): + rt6 + +P-space (rt3): + rt1 + rt2 + rt3 + rt4 + +P-space (rt6): + rt4 + rt6 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt6 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt5 +2001:db8::5/128 IP6 internal 0 rt5(4) +rt6 TE-IS 10 rt6 - rt5(4) +rt4 TE-IS 20 rt6 - rt6(4) +2001:db8::6/128 IP6 internal 20 rt6 - rt6(4) +rt1 pseudo_TE-IS 30 rt6 - rt4(4) +rt1 TE-IS 30 rt6 - rt1(2) +2001:db8::4/128 IP6 internal 30 rt6 - rt4(4) +rt3 TE-IS 40 rt3 - rt5(4) +2001:db8::1/128 IP6 internal 40 rt6 - rt1(4) +rt2 TE-IS 45 rt6 - rt1(4) +2001:db8::3/128 IP6 internal 50 rt3 - rt3(4) +2001:db8::2/128 IP6 internal 55 rt6 - rt2(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::1/128 40 - rt6 16041 + 2001:db8::2/128 55 - rt6 16041 + 2001:db8::4/128 30 - rt6 - + +test# test isis topology 3 root rt5 ti-lfa system-id rt4 ipv4-only +P-space (self): + rt6 + +P-space (rt3): + rt1 + rt2 + rt3 + rt4 + rt6 + +P-space (rt6): + rt1 + rt2 + rt3 + rt4 + rt6 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt6 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt5 +10.0.255.5/32 IP internal 0 rt5(4) +rt6 TE-IS 10 rt6 - rt5(4) +rt4 TE-IS 20 rt6 - rt6(4) +10.0.255.6/32 IP TE 20 rt6 - rt6(4) +rt3 TE-IS 30 rt3 - rt5(4) +rt2 TE-IS 30 rt6 - rt4(4) +10.0.255.4/32 IP TE 30 rt6 - rt4(4) +rt1 TE-IS 40 rt3 - rt3(4) + rt6 - rt2(4) +10.0.255.3/32 IP TE 40 rt3 - rt3(4) +10.0.255.2/32 IP TE 40 rt6 - rt2(4) +10.0.255.1/32 IP TE 50 rt3 - rt1(4) + rt6 - + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.1/32 50 - rt3 - + - rt6 - + 10.0.255.2/32 40 - rt6 - + 10.0.255.4/32 30 - rt6 - + +test# test isis topology 3 root rt5 ti-lfa system-id rt3 ipv4-only +P-space (self): + rt1 + rt2 + rt4 + rt6 + +P-space (rt4): + rt1 + rt2 + rt3 + rt4 + rt6 + +P-space (rt6): + rt1 + rt2 + rt3 + rt4 + rt6 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt6 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt5 +10.0.255.5/32 IP internal 0 rt5(4) +rt4 TE-IS 10 rt4 - rt5(4) +rt6 TE-IS 10 rt6 - rt5(4) +rt2 TE-IS 20 rt4 - rt4(4) +10.0.255.4/32 IP TE 20 rt4 - rt4(4) +10.0.255.6/32 IP TE 20 rt6 - rt6(4) +rt1 TE-IS 30 rt4 - rt2(4) +rt3 TE-IS 30 rt4 - rt2(4) +10.0.255.2/32 IP TE 30 rt4 - rt2(4) +10.0.255.1/32 IP TE 40 rt4 - rt1(4) +10.0.255.3/32 IP TE 40 rt4 - rt3(4) + +IS-IS L1 IPv4 routing table: + +test# test isis topology 4 root rt1 ti-lfa system-id rt2 ipv4-only +P-space (self): + rt3 + rt5 + rt7 + +P-space (rt3): + rt3 + rt5 + rt7 + +Q-space: + rt2 + rt4 + rt6 + rt8 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt3 TE-IS 10 rt3 - rt1(4) +rt5 TE-IS 20 rt3 - rt3(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +rt7 TE-IS 30 rt3 - rt5(4) +10.0.255.5/32 IP TE 30 rt3 - rt5(4) +10.0.255.7/32 IP TE 40 rt3 - rt7(4) +rt6 TE-IS 70 rt3 - rt5(4) +rt4 TE-IS 80 rt3 - rt6(4) +rt8 TE-IS 80 rt3 - rt6(4) +10.0.255.6/32 IP TE 80 rt3 - rt6(4) +rt2 TE-IS 90 rt3 - rt4(4) +10.0.255.4/32 IP TE 90 rt3 - rt4(4) +10.0.255.8/32 IP TE 90 rt3 - rt8(4) +10.0.255.2/32 IP TE 100 rt3 - rt2(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.2/32 100 - rt3 16050/17 + 10.0.255.4/32 90 - rt3 16050/17 + 10.0.255.6/32 80 - rt3 16050/17 + 10.0.255.8/32 90 - rt3 16050/17 + +test# test isis topology 4 root rt4 ti-lfa system-id rt6 ipv4-only +P-space (self): + rt1 + rt2 + rt3 + rt5 + rt7 + +P-space (rt2): + rt1 + rt2 + rt3 + rt5 + rt7 + +Q-space: + rt6 + rt8 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt4 +10.0.255.4/32 IP internal 0 rt4(4) +rt2 TE-IS 10 rt2 - rt4(4) +rt1 TE-IS 20 rt2 - rt2(4) +10.0.255.2/32 IP TE 20 rt2 - rt2(4) +rt3 TE-IS 30 rt2 - rt1(4) +10.0.255.1/32 IP TE 30 rt2 - rt1(4) +rt5 TE-IS 40 rt2 - rt3(4) +10.0.255.3/32 IP TE 40 rt2 - rt3(4) +rt7 TE-IS 50 rt2 - rt5(4) +10.0.255.5/32 IP TE 50 rt2 - rt5(4) +10.0.255.7/32 IP TE 60 rt2 - rt7(4) +rt6 TE-IS 90 rt2 - rt5(4) +rt8 TE-IS 100 rt2 - rt6(4) +10.0.255.6/32 IP TE 100 rt2 - rt6(4) +10.0.255.8/32 IP TE 110 rt2 - rt8(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.6/32 100 - rt2 16050/17 + 10.0.255.8/32 110 - rt2 16050/17 + +test# test isis topology 5 root rt1 ti-lfa system-id rt2 ipv4-only +P-space (self): + rt3 + rt5 + rt7 + +P-space (rt3): + rt3 + rt5 + rt7 + rt8 + +Q-space: + rt2 + rt4 + rt6 + rt8 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt3 TE-IS 10 rt3 - rt1(4) +rt5 TE-IS 20 rt3 - rt3(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +rt7 TE-IS 30 rt3 - rt5(4) +10.0.255.5/32 IP TE 30 rt3 - rt5(4) +rt8 TE-IS 40 rt3 - rt7(4) +10.0.255.7/32 IP TE 40 rt3 - rt7(4) +rt6 TE-IS 50 rt3 - rt8(4) +10.0.255.8/32 IP TE 50 rt3 - rt8(4) +rt4 TE-IS 60 rt3 - rt6(4) +10.0.255.6/32 IP TE 60 rt3 - rt6(4) +rt2 TE-IS 70 rt3 - rt4(4) +10.0.255.4/32 IP TE 70 rt3 - rt4(4) +10.0.255.2/32 IP TE 80 rt3 - rt2(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.2/32 80 - rt3 16080 + 10.0.255.4/32 70 - rt3 16080 + 10.0.255.6/32 60 - rt3 16080 + +test# test isis topology 6 root rt4 ti-lfa system-id rt3 ipv4-only +P-space (self): + rt2 + rt5 + rt6 + rt7 + rt8 + +P-space (rt2): + rt1 + rt2 + +P-space (rt6): + rt5 + rt6 + rt7 + rt8 + +Q-space: + rt1 + rt3 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt4 +10.0.255.4/32 IP internal 0 rt4(4) +rt2 TE-IS 10 rt2 - rt4(4) +rt6 TE-IS 10 rt6 - rt4(4) +rt1 TE-IS 20 rt2 - rt2(4) +rt5 TE-IS 20 rt6 - rt6(4) +rt8 TE-IS 20 rt6 - rt6(4) +10.0.255.2/32 IP TE 20 rt2 - rt2(4) +10.0.255.6/32 IP TE 20 rt6 - rt6(4) +rt3 TE-IS 30 rt2 - rt1(4) +rt7 TE-IS 30 rt6 - rt5(4) + rt8(4) +10.0.255.1/32 IP TE 30 rt2 - rt1(4) +10.0.255.5/32 IP TE 30 rt6 - rt5(4) +10.0.255.8/32 IP TE 30 rt6 - rt8(4) +10.0.255.3/32 IP TE 40 rt2 - rt3(4) +10.0.255.7/32 IP TE 40 rt6 - rt7(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.3/32 40 - rt2 16010 + +test# test isis topology 7 root rt11 ti-lfa system-id rt8 ipv4-only +P-space (self): + rt10 + rt12 + +P-space (rt10): + rt1 + rt4 + rt7 + rt10 + +P-space (rt12): + rt9 + rt12 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt11 +10.0.255.11/32 IP internal 0 rt11(4) +rt10 TE-IS 10 rt10 - rt11(4) +rt12 TE-IS 10 rt12 - rt11(4) +rt9 TE-IS 20 rt12 - rt12(4) +10.0.255.10/32 IP TE 20 rt10 - rt10(4) +10.0.255.12/32 IP TE 20 rt12 - rt12(4) +rt7 TE-IS 30 rt10 - rt10(4) +rt8 TE-IS 30 rt12 - rt9(4) +10.0.255.9/32 IP TE 30 rt12 - rt9(4) +rt4 TE-IS 40 rt10 - rt7(4) +rt5 TE-IS 40 rt12 - rt8(4) +10.0.255.7/32 IP TE 40 rt10 - rt7(4) +10.0.255.8/32 IP TE 40 rt12 - rt8(4) +rt6 TE-IS 50 rt12 - rt9(4) + rt5(4) +rt1 TE-IS 50 rt10 - rt4(4) +rt2 TE-IS 50 rt12 - rt5(4) +10.0.255.4/32 IP TE 50 rt10 - rt4(4) +10.0.255.5/32 IP TE 50 rt12 - rt5(4) +rt3 TE-IS 60 rt12 - rt6(4) + rt2(4) +10.0.255.6/32 IP TE 60 rt12 - rt6(4) +10.0.255.1/32 IP TE 60 rt10 - rt1(4) +10.0.255.2/32 IP TE 60 rt12 - rt2(4) +10.0.255.3/32 IP TE 70 rt12 - rt3(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.1/32 60 - rt10 - + 10.0.255.2/32 60 - rt12 16090 + 10.0.255.3/32 70 - rt12 16090 + 10.0.255.4/32 50 - rt10 - + 10.0.255.5/32 50 - rt12 16090 + 10.0.255.6/32 60 - rt12 16090 + 10.0.255.7/32 40 - rt10 - + 10.0.255.8/32 40 - rt12 16090 + +test# test isis topology 7 root rt6 ti-lfa system-id rt5 ipv4-only +P-space (self): + rt3 + +P-space (rt3): + rt2 + rt3 + +P-space (rt9): + rt1 + rt2 + rt4 + rt5 + rt7 + rt8 + rt9 + rt10 + rt11 + rt12 + +Q-space: + rt1 + rt2 + rt4 + rt5 + rt7 + rt8 + rt9 + rt10 + rt11 + rt12 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt6 +10.0.255.6/32 IP internal 0 rt6(4) +rt3 TE-IS 10 rt3 - rt6(4) +rt2 TE-IS 20 rt3 - rt3(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +rt9 TE-IS 30 rt9 - rt6(4) +rt5 TE-IS 30 rt3 - rt2(4) +10.0.255.2/32 IP TE 30 rt3 - rt2(4) +rt8 TE-IS 40 rt9 - rt9(4) + rt3 - rt5(4) +rt12 TE-IS 40 rt9 - rt9(4) +rt4 TE-IS 40 rt3 - rt5(4) +10.0.255.9/32 IP TE 40 rt9 - rt9(4) +10.0.255.5/32 IP TE 40 rt3 - rt5(4) +rt7 TE-IS 50 rt9 - rt8(4) + rt3 - rt4(4) +rt11 TE-IS 50 rt9 - rt8(4) + rt3 - rt12(4) +rt1 TE-IS 50 rt3 - rt4(4) +10.0.255.8/32 IP TE 50 rt9 - rt8(4) + rt3 - +10.0.255.12/32 IP TE 50 rt9 - rt12(4) +10.0.255.4/32 IP TE 50 rt3 - rt4(4) +rt10 TE-IS 60 rt9 - rt11(4) + rt3 - +10.0.255.7/32 IP TE 60 rt9 - rt7(4) + rt3 - +10.0.255.11/32 IP TE 60 rt9 - rt11(4) + rt3 - +10.0.255.1/32 IP TE 60 rt3 - rt1(4) +10.0.255.10/32 IP TE 70 rt9 - rt10(4) + rt3 - + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------ + 10.0.255.1/32 60 - rt3 16020 + 10.0.255.4/32 50 - rt3 16020 + 10.0.255.5/32 40 - rt3 16020 + 10.0.255.7/32 60 - rt9 - + - rt3 - + 10.0.255.8/32 50 - rt9 - + - rt3 - + 10.0.255.10/32 70 - rt9 - + - rt3 - + 10.0.255.11/32 60 - rt9 - + - rt3 - + +test# test isis topology 8 root rt2 ti-lfa system-id rt1 ipv4-only +P-space (self): + rt3 + rt5 + rt6 + rt8 + rt9 + rt11 + rt12 + +P-space (rt3): + rt3 + rt6 + +P-space (rt5): + rt5 + rt6 + rt8 + rt9 + rt11 + rt12 + +Q-space: + rt1 + rt4 + rt7 + rt10 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt2 +10.0.255.2/32 IP internal 0 rt2(4) +rt3 TE-IS 10 rt3 - rt2(4) +rt5 TE-IS 10 rt5 - rt2(4) +rt6 TE-IS 20 rt3 - rt3(4) + rt5 - rt5(4) +rt8 TE-IS 20 rt5 - rt5(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +10.0.255.5/32 IP TE 20 rt5 - rt5(4) +rt9 TE-IS 30 rt5 - rt8(4) +rt11 TE-IS 30 rt5 - rt8(4) +10.0.255.6/32 IP TE 30 rt3 - rt6(4) + rt5 - +10.0.255.8/32 IP TE 30 rt5 - rt8(4) +rt12 TE-IS 40 rt5 - rt9(4) + rt11(4) +10.0.255.9/32 IP TE 40 rt5 - rt9(4) +10.0.255.11/32 IP TE 40 rt5 - rt11(4) +10.0.255.12/32 IP TE 50 rt5 - rt12(4) +rt10 TE-IS 60 rt5 - rt11(4) +rt7 TE-IS 70 rt5 - rt10(4) +10.0.255.10/32 IP TE 70 rt5 - rt10(4) +rt4 TE-IS 80 rt5 - rt7(4) +10.0.255.7/32 IP TE 80 rt5 - rt7(4) +rt1 TE-IS 90 rt5 - rt4(4) +10.0.255.4/32 IP TE 90 rt5 - rt4(4) +10.0.255.1/32 IP TE 100 rt5 - rt1(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------ + 10.0.255.1/32 100 - rt5 16110/17 + 10.0.255.4/32 90 - rt5 16110/17 + 10.0.255.7/32 80 - rt5 16110/17 + 10.0.255.10/32 70 - rt5 16110/17 + +test# test isis topology 8 root rt2 ti-lfa system-id rt5 ipv4-only +P-space (self): + rt1 + rt3 + rt4 + rt7 + rt10 + +P-space (rt1): + rt1 + rt4 + rt7 + rt10 + +P-space (rt3): + rt3 + rt6 + +Q-space: + rt5 + rt6 + rt8 + rt9 + rt11 + rt12 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt2 +10.0.255.2/32 IP internal 0 rt2(4) +rt1 TE-IS 10 rt1 - rt2(4) +rt3 TE-IS 10 rt3 - rt2(4) +rt4 TE-IS 20 rt1 - rt1(4) +rt6 TE-IS 20 rt3 - rt3(4) +10.0.255.1/32 IP TE 20 rt1 - rt1(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +rt7 TE-IS 30 rt1 - rt4(4) +rt5 TE-IS 30 rt3 - rt6(4) +10.0.255.4/32 IP TE 30 rt1 - rt4(4) +10.0.255.6/32 IP TE 30 rt3 - rt6(4) +rt10 TE-IS 40 rt1 - rt7(4) +rt8 TE-IS 40 rt3 - rt5(4) +10.0.255.7/32 IP TE 40 rt1 - rt7(4) +10.0.255.5/32 IP TE 40 rt3 - rt5(4) +rt9 TE-IS 50 rt3 - rt8(4) +rt11 TE-IS 50 rt3 - rt8(4) +10.0.255.10/32 IP TE 50 rt1 - rt10(4) +10.0.255.8/32 IP TE 50 rt3 - rt8(4) +rt12 TE-IS 60 rt3 - rt9(4) + rt11(4) +10.0.255.9/32 IP TE 60 rt3 - rt9(4) +10.0.255.11/32 IP TE 60 rt3 - rt11(4) +10.0.255.12/32 IP TE 70 rt3 - rt12(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------ + 10.0.255.5/32 40 - rt3 16060 + 10.0.255.8/32 50 - rt3 16060 + 10.0.255.9/32 60 - rt3 16060 + 10.0.255.11/32 60 - rt3 16060 + 10.0.255.12/32 70 - rt3 16060 + +test# test isis topology 9 root rt1 ti-lfa system-id rt3 +P-space (self): + rt2 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +P-space (rt2): + rt2 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +Q-space: + rt3 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt2 TE-IS 10 rt2 - rt1(4) +rt4 TE-IS 20 rt2 - rt2(4) +10.0.255.2/32 IP TE 20 rt2 - rt2(4) +rt5 TE-IS 30 rt2 - rt4(4) +10.0.255.4/32 IP TE 30 rt2 - rt4(4) +rt9 TE-IS 40 rt2 - rt5(4) +10.0.255.5/32 IP TE 40 rt2 - rt5(4) +rt6 TE-IS 50 rt2 - rt4(4) + rt9(4) +rt7 TE-IS 50 rt2 - rt4(4) + rt9(4) +rt8 TE-IS 50 rt2 - rt4(4) + rt9(4) +10.0.255.9/32 IP TE 50 rt2 - rt9(4) +10.0.255.6/32 IP TE 60 rt2 - rt6(4) +10.0.255.7/32 IP TE 60 rt2 - rt7(4) +10.0.255.8/32 IP TE 60 rt2 - rt8(4) +rt3 TE-IS 120 rt2 - rt4(4) +10.0.255.3/32 IP TE 130 rt2 - rt3(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.3/32 130 - rt2 16040/18 + +P-space (self): + rt2 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +P-space (rt2): + rt2 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +Q-space: + rt3 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt2 TE-IS 10 rt2 - rt1(4) +rt4 TE-IS 20 rt2 - rt2(4) +2001:db8::2/128 IP6 internal 20 rt2 - rt2(4) +rt5 TE-IS 30 rt2 - rt4(4) +2001:db8::4/128 IP6 internal 30 rt2 - rt4(4) +rt9 TE-IS 40 rt2 - rt5(4) +2001:db8::5/128 IP6 internal 40 rt2 - rt5(4) +rt6 TE-IS 50 rt2 - rt4(4) + rt9(4) +rt7 TE-IS 50 rt2 - rt4(4) + rt9(4) +rt8 TE-IS 50 rt2 - rt4(4) + rt9(4) +2001:db8::9/128 IP6 internal 50 rt2 - rt9(4) +2001:db8::6/128 IP6 internal 60 rt2 - rt6(4) +2001:db8::7/128 IP6 internal 60 rt2 - rt7(4) +2001:db8::8/128 IP6 internal 60 rt2 - rt8(4) +rt3 TE-IS 120 rt2 - rt4(4) +2001:db8::3/128 IP6 internal 130 rt2 - rt3(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::3/128 130 - rt2 16041/19 + +test# test isis topology 9 root rt1 ti-lfa system-id rt2 +P-space (self): + rt3 + +P-space (rt3): + rt3 + +Q-space: + rt2 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt3 TE-IS 10 rt3 - rt1(4) +10.0.255.3/32 IP TE 20 rt3 - rt3(4) +rt4 TE-IS 110 rt3 - rt3(4) +rt2 TE-IS 120 rt3 - rt4(4) +rt5 TE-IS 120 rt3 - rt4(4) +10.0.255.4/32 IP TE 120 rt3 - rt4(4) +rt9 TE-IS 130 rt3 - rt5(4) +10.0.255.2/32 IP TE 130 rt3 - rt2(4) +10.0.255.5/32 IP TE 130 rt3 - rt5(4) +rt6 TE-IS 140 rt3 - rt4(4) + rt9(4) +rt7 TE-IS 140 rt3 - rt4(4) + rt9(4) +rt8 TE-IS 140 rt3 - rt4(4) + rt9(4) +10.0.255.9/32 IP TE 140 rt3 - rt9(4) +10.0.255.6/32 IP TE 150 rt3 - rt6(4) +10.0.255.7/32 IP TE 150 rt3 - rt7(4) +10.0.255.8/32 IP TE 150 rt3 - rt8(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.2/32 130 - rt3 16030/18 + 10.0.255.4/32 120 - rt3 16030/18 + 10.0.255.5/32 130 - rt3 16030/18 + 10.0.255.6/32 150 - rt3 16030/18 + 10.0.255.7/32 150 - rt3 16030/18 + 10.0.255.8/32 150 - rt3 16030/18 + 10.0.255.9/32 140 - rt3 16030/18 + +P-space (self): + rt3 + +P-space (rt3): + rt3 + +Q-space: + rt2 + rt4 + rt5 + rt6 + rt7 + rt8 + rt9 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt3 TE-IS 10 rt3 - rt1(4) +2001:db8::3/128 IP6 internal 20 rt3 - rt3(4) +rt4 TE-IS 110 rt3 - rt3(4) +rt2 TE-IS 120 rt3 - rt4(4) +rt5 TE-IS 120 rt3 - rt4(4) +2001:db8::4/128 IP6 internal 120 rt3 - rt4(4) +rt9 TE-IS 130 rt3 - rt5(4) +2001:db8::2/128 IP6 internal 130 rt3 - rt2(4) +2001:db8::5/128 IP6 internal 130 rt3 - rt5(4) +rt6 TE-IS 140 rt3 - rt4(4) + rt9(4) +rt7 TE-IS 140 rt3 - rt4(4) + rt9(4) +rt8 TE-IS 140 rt3 - rt4(4) + rt9(4) +2001:db8::9/128 IP6 internal 140 rt3 - rt9(4) +2001:db8::6/128 IP6 internal 150 rt3 - rt6(4) +2001:db8::7/128 IP6 internal 150 rt3 - rt7(4) +2001:db8::8/128 IP6 internal 150 rt3 - rt8(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::2/128 130 - rt3 16031/19 + 2001:db8::4/128 120 - rt3 16031/19 + 2001:db8::5/128 130 - rt3 16031/19 + 2001:db8::6/128 150 - rt3 16031/19 + 2001:db8::7/128 150 - rt3 16031/19 + 2001:db8::8/128 150 - rt3 16031/19 + 2001:db8::9/128 140 - rt3 16031/19 + +test# test isis topology 9 root rt9 ti-lfa system-id rt5 +P-space (self): + rt6 + rt7 + rt8 + +P-space (rt6): + rt6 + +P-space (rt7): + rt7 + +P-space (rt8): + rt8 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt5 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt9 +10.0.255.9/32 IP internal 0 rt9(4) +rt6 TE-IS 10 rt6 - rt9(4) +rt7 TE-IS 10 rt7 - rt9(4) +rt8 TE-IS 10 rt8 - rt9(4) +10.0.255.6/32 IP TE 20 rt6 - rt6(4) +10.0.255.7/32 IP TE 20 rt7 - rt7(4) +10.0.255.8/32 IP TE 20 rt8 - rt8(4) +rt4 TE-IS 40 rt6 - rt6(4) + rt7 - rt7(4) + rt8 - rt8(4) +rt2 TE-IS 50 rt6 - rt4(4) + rt7 - + rt8 - +rt5 TE-IS 50 rt6 - rt4(4) + rt7 - + rt8 - +10.0.255.4/32 IP TE 50 rt6 - rt4(4) + rt7 - + rt8 - +rt1 TE-IS 60 rt6 - rt2(4) + rt7 - + rt8 - +10.0.255.2/32 IP TE 60 rt6 - rt2(4) + rt7 - + rt8 - +10.0.255.5/32 IP TE 60 rt6 - rt5(4) + rt7 - + rt8 - +rt3 TE-IS 70 rt6 - rt1(4) + rt7 - + rt8 - +10.0.255.1/32 IP TE 70 rt6 - rt1(4) + rt7 - + rt8 - +10.0.255.3/32 IP TE 80 rt6 - rt3(4) + rt7 - + rt8 - + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.1/32 70 - rt6 16060/16 + - rt7 16070/16 + - rt8 16080/16 + 10.0.255.2/32 60 - rt6 16060/16 + - rt7 16070/16 + - rt8 16080/16 + 10.0.255.3/32 80 - rt6 16060/16 + - rt7 16070/16 + - rt8 16080/16 + 10.0.255.4/32 50 - rt6 16060/16 + - rt7 16070/16 + - rt8 16080/16 + 10.0.255.5/32 60 - rt6 16060/16 + - rt7 16070/16 + - rt8 16080/16 + +P-space (self): + rt6 + rt7 + rt8 + +P-space (rt6): + rt6 + +P-space (rt7): + rt7 + +P-space (rt8): + rt8 + +Q-space: + rt1 + rt2 + rt3 + rt4 + rt5 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt9 +2001:db8::9/128 IP6 internal 0 rt9(4) +rt6 TE-IS 10 rt6 - rt9(4) +rt7 TE-IS 10 rt7 - rt9(4) +rt8 TE-IS 10 rt8 - rt9(4) +2001:db8::6/128 IP6 internal 20 rt6 - rt6(4) +2001:db8::7/128 IP6 internal 20 rt7 - rt7(4) +2001:db8::8/128 IP6 internal 20 rt8 - rt8(4) +rt4 TE-IS 40 rt6 - rt6(4) + rt7 - rt7(4) + rt8 - rt8(4) +rt2 TE-IS 50 rt6 - rt4(4) + rt7 - + rt8 - +rt5 TE-IS 50 rt6 - rt4(4) + rt7 - + rt8 - +2001:db8::4/128 IP6 internal 50 rt6 - rt4(4) + rt7 - + rt8 - +rt1 TE-IS 60 rt6 - rt2(4) + rt7 - + rt8 - +2001:db8::2/128 IP6 internal 60 rt6 - rt2(4) + rt7 - + rt8 - +2001:db8::5/128 IP6 internal 60 rt6 - rt5(4) + rt7 - + rt8 - +rt3 TE-IS 70 rt6 - rt1(4) + rt7 - + rt8 - +2001:db8::1/128 IP6 internal 70 rt6 - rt1(4) + rt7 - + rt8 - +2001:db8::3/128 IP6 internal 80 rt6 - rt3(4) + rt7 - + rt8 - + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::1/128 70 - rt6 16061/17 + - rt7 16071/17 + - rt8 16081/17 + 2001:db8::2/128 60 - rt6 16061/17 + - rt7 16071/17 + - rt8 16081/17 + 2001:db8::3/128 80 - rt6 16061/17 + - rt7 16071/17 + - rt8 16081/17 + 2001:db8::4/128 50 - rt6 16061/17 + - rt7 16071/17 + - rt8 16081/17 + 2001:db8::5/128 60 - rt6 16061/17 + - rt7 16071/17 + - rt8 16081/17 + +test# test isis topology 9 root rt9 ti-lfa system-id rt8 +P-space (self): + rt1 + rt2 + rt3 + rt4 + rt5 + rt6 + rt7 + +P-space (rt5): + rt1 + rt2 + rt3 + rt4 + rt5 + +P-space (rt6): + rt6 + +P-space (rt7): + rt7 + +Q-space: + rt8 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt9 +10.0.255.9/32 IP internal 0 rt9(4) +rt5 TE-IS 10 rt5 - rt9(4) +rt6 TE-IS 10 rt6 - rt9(4) +rt7 TE-IS 10 rt7 - rt9(4) +rt4 TE-IS 20 rt5 - rt5(4) +10.0.255.5/32 IP TE 20 rt5 - rt5(4) +10.0.255.6/32 IP TE 20 rt6 - rt6(4) +10.0.255.7/32 IP TE 20 rt7 - rt7(4) +rt2 TE-IS 30 rt5 - rt4(4) +10.0.255.4/32 IP TE 30 rt5 - rt4(4) +rt1 TE-IS 40 rt5 - rt2(4) +10.0.255.2/32 IP TE 40 rt5 - rt2(4) +rt8 TE-IS 50 rt5 - rt4(4) +rt3 TE-IS 50 rt5 - rt1(4) +10.0.255.1/32 IP TE 50 rt5 - rt1(4) +10.0.255.8/32 IP TE 60 rt5 - rt8(4) +10.0.255.3/32 IP TE 60 rt5 - rt3(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.8/32 60 - rt5 16040/26 + +P-space (self): + rt1 + rt2 + rt3 + rt4 + rt5 + rt6 + rt7 + +P-space (rt5): + rt1 + rt2 + rt3 + rt4 + rt5 + +P-space (rt6): + rt6 + +P-space (rt7): + rt7 + +Q-space: + rt8 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt9 +2001:db8::9/128 IP6 internal 0 rt9(4) +rt5 TE-IS 10 rt5 - rt9(4) +rt6 TE-IS 10 rt6 - rt9(4) +rt7 TE-IS 10 rt7 - rt9(4) +rt4 TE-IS 20 rt5 - rt5(4) +2001:db8::5/128 IP6 internal 20 rt5 - rt5(4) +2001:db8::6/128 IP6 internal 20 rt6 - rt6(4) +2001:db8::7/128 IP6 internal 20 rt7 - rt7(4) +rt2 TE-IS 30 rt5 - rt4(4) +2001:db8::4/128 IP6 internal 30 rt5 - rt4(4) +rt1 TE-IS 40 rt5 - rt2(4) +2001:db8::2/128 IP6 internal 40 rt5 - rt2(4) +rt8 TE-IS 50 rt5 - rt4(4) +rt3 TE-IS 50 rt5 - rt1(4) +2001:db8::1/128 IP6 internal 50 rt5 - rt1(4) +2001:db8::8/128 IP6 internal 60 rt5 - rt8(4) +2001:db8::3/128 IP6 internal 60 rt5 - rt3(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::8/128 60 - rt5 16041/27 + +test# test isis topology 10 root rt1 ti-lfa system-id rt2 +P-space (self): + rt3 + rt4 + rt6 + rt7 + +P-space (rt3): + rt3 + rt6 + +P-space (rt4): + rt4 + rt7 + +Q-space: + rt2 + rt5 + rt8 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt3 TE-IS 20 rt3 - rt1(4) +rt4 TE-IS 20 rt4 - rt1(4) +rt6 TE-IS 30 rt3 - rt3(4) +rt7 TE-IS 30 rt4 - rt4(4) +10.0.255.3/32 IP TE 30 rt3 - rt3(4) +10.0.255.4/32 IP TE 30 rt4 - rt4(4) +10.0.255.6/32 IP TE 40 rt3 - rt6(4) +10.0.255.7/32 IP TE 40 rt4 - rt7(4) +rt8 TE-IS 80 rt3 - rt6(4) + rt4 - rt7(4) +rt5 TE-IS 90 rt3 - rt8(4) + rt4 - +10.0.255.8/32 IP TE 90 rt3 - rt8(4) + rt4 - +rt2 TE-IS 100 rt3 - rt5(4) + rt4 - +10.0.255.5/32 IP TE 100 rt3 - rt5(4) + rt4 - +10.0.255.2/32 IP TE 110 rt3 - rt2(4) + rt4 - + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.2/32 110 - rt3 20060/18 + - rt4 16070/18 + 10.0.255.5/32 100 - rt3 20060/18 + - rt4 16070/18 + 10.0.255.8/32 90 - rt3 20060/18 + - rt4 16070/18 + +P-space (self): + rt3 + rt4 + rt6 + rt7 + +P-space (rt3): + rt3 + rt6 + +P-space (rt4): + rt4 + rt7 + +Q-space: + rt2 + rt5 + rt8 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt3 TE-IS 20 rt3 - rt1(4) +rt4 TE-IS 20 rt4 - rt1(4) +rt6 TE-IS 30 rt3 - rt3(4) +rt7 TE-IS 30 rt4 - rt4(4) +2001:db8::3/128 IP6 internal 30 rt3 - rt3(4) +2001:db8::4/128 IP6 internal 30 rt4 - rt4(4) +2001:db8::6/128 IP6 internal 40 rt3 - rt6(4) +2001:db8::7/128 IP6 internal 40 rt4 - rt7(4) +rt8 TE-IS 80 rt3 - rt6(4) + rt4 - rt7(4) +rt5 TE-IS 90 rt3 - rt8(4) + rt4 - +2001:db8::8/128 IP6 internal 90 rt3 - rt8(4) + rt4 - +rt2 TE-IS 100 rt3 - rt5(4) + rt4 - +2001:db8::5/128 IP6 internal 100 rt3 - rt5(4) + rt4 - +2001:db8::2/128 IP6 internal 110 rt3 - rt2(4) + rt4 - + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::2/128 110 - rt3 20061/19 + - rt4 16071/19 + 2001:db8::5/128 100 - rt3 20061/19 + - rt4 16071/19 + 2001:db8::8/128 90 - rt3 20061/19 + - rt4 16071/19 + +test# test isis topology 10 root rt1 ti-lfa system-id rt4 +P-space (self): + rt2 + rt3 + rt5 + rt6 + rt8 + +P-space (rt2): + rt2 + rt5 + rt8 + +P-space (rt3): + rt3 + rt6 + +Q-space: + rt4 + rt7 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt2 TE-IS 10 rt2 - rt1(4) +rt3 TE-IS 20 rt3 - rt1(4) +rt5 TE-IS 20 rt2 - rt2(4) +10.0.255.2/32 IP TE 20 rt2 - rt2(4) +rt6 TE-IS 30 rt3 - rt3(4) +rt8 TE-IS 30 rt2 - rt5(4) +10.0.255.3/32 IP TE 30 rt3 - rt3(4) +10.0.255.5/32 IP TE 30 rt2 - rt5(4) +10.0.255.6/32 IP TE 40 rt3 - rt6(4) +10.0.255.8/32 IP TE 40 rt2 - rt8(4) +rt7 TE-IS 80 rt2 - rt8(4) +rt4 TE-IS 90 rt2 - rt7(4) +10.0.255.7/32 IP TE 90 rt2 - rt7(4) +10.0.255.4/32 IP TE 100 rt2 - rt4(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.4/32 100 - rt2 16080/20 + 10.0.255.7/32 90 - rt2 16080/20 + +P-space (self): + rt2 + rt3 + rt5 + rt6 + rt8 + +P-space (rt2): + rt2 + rt5 + rt8 + +P-space (rt3): + rt3 + rt6 + +Q-space: + rt4 + rt7 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt1 +2001:db8::1/128 IP6 internal 0 rt1(4) +rt2 TE-IS 10 rt2 - rt1(4) +rt3 TE-IS 20 rt3 - rt1(4) +rt5 TE-IS 20 rt2 - rt2(4) +2001:db8::2/128 IP6 internal 20 rt2 - rt2(4) +rt6 TE-IS 30 rt3 - rt3(4) +rt8 TE-IS 30 rt2 - rt5(4) +2001:db8::3/128 IP6 internal 30 rt3 - rt3(4) +2001:db8::5/128 IP6 internal 30 rt2 - rt5(4) +2001:db8::6/128 IP6 internal 40 rt3 - rt6(4) +2001:db8::8/128 IP6 internal 40 rt2 - rt8(4) +rt7 TE-IS 80 rt2 - rt8(4) +rt4 TE-IS 90 rt2 - rt7(4) +2001:db8::7/128 IP6 internal 90 rt2 - rt7(4) +2001:db8::4/128 IP6 internal 100 rt2 - rt4(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::4/128 100 - rt2 16081/21 + 2001:db8::7/128 90 - rt2 16081/21 + +test# test isis topology 11 root rt2 ti-lfa system-id rt4 +P-space (self): + +P-space (rt1): + rt1 + rt3 + rt5 + +P-space (rt3): + rt1 + rt3 + rt5 + rt6 + +Q-space: + rt1 + rt3 + rt4 + rt5 + rt6 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt2 +10.0.255.2/32 IP internal 0 rt2(4) +rt1 TE-IS 50 rt1 - rt2(4) +rt3 TE-IS 50 rt3 - rt2(4) +rt2 +rt5 TE-IS 60 rt3 - rt3(4) +10.0.255.1/32 IP TE 60 rt1 - rt1(4) +10.0.255.3/32 IP TE 60 rt3 - rt3(4) +rt4 TE-IS 70 rt3 - rt5(4) +rt6 TE-IS 70 rt3 - rt5(4) +10.0.255.5/32 IP TE 70 rt3 - rt5(4) +10.0.255.4/32 IP TE 80 rt3 - rt4(4) +10.0.255.6/32 IP TE 80 rt3 - rt6(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.1/32 60 - rt1 - + 10.0.255.3/32 60 - rt3 - + 10.0.255.4/32 80 - rt3 16050 + 10.0.255.5/32 70 - rt3 - + 10.0.255.6/32 80 - rt3 - + +P-space (self): + +P-space (rt1): + rt1 + rt3 + rt5 + +P-space (rt3): + rt1 + rt3 + rt5 + rt6 + +Q-space: + rt1 + rt3 + rt4 + rt5 + rt6 + +IS-IS paths to level-1 routers that speak IPv6 +Vertex Type Metric Next-Hop Interface Parent +rt2 +2001:db8::2/128 IP6 internal 0 rt2(4) +rt1 TE-IS 50 rt1 - rt2(4) +rt3 TE-IS 50 rt3 - rt2(4) +rt2 +rt5 TE-IS 60 rt3 - rt3(4) +2001:db8::1/128 IP6 internal 60 rt1 - rt1(4) +2001:db8::3/128 IP6 internal 60 rt3 - rt3(4) +rt4 TE-IS 70 rt3 - rt5(4) +rt6 TE-IS 70 rt3 - rt5(4) +2001:db8::5/128 IP6 internal 70 rt3 - rt5(4) +2001:db8::4/128 IP6 internal 80 rt3 - rt4(4) +2001:db8::6/128 IP6 internal 80 rt3 - rt6(4) + +IS-IS L1 IPv6 routing table: + + Prefix Metric Interface Nexthop Label(s) + ------------------------------------------------------- + 2001:db8::1/128 60 - rt1 - + 2001:db8::3/128 60 - rt3 - + 2001:db8::4/128 80 - rt3 16051 + 2001:db8::5/128 70 - rt3 - + 2001:db8::6/128 80 - rt3 - + +test# test isis topology 12 root rt1 ti-lfa system-id rt3 ipv4-only +P-space (self): + rt2 + rt4 + rt6 + rt8 + rt10 + +P-space (rt2): + rt2 + rt4 + rt6 + rt8 + rt10 + +Q-space: + rt3 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt2 TE-IS 10 rt2 - rt1(4) +rt4 TE-IS 20 rt2 - rt2(4) +10.0.255.2/32 IP TE 20 rt2 - rt2(4) +rt6 TE-IS 30 rt2 - rt4(4) +10.0.255.4/32 IP TE 30 rt2 - rt4(4) +rt8 TE-IS 40 rt2 - rt6(4) +10.0.255.6/32 IP TE 40 rt2 - rt6(4) +rt10 TE-IS 50 rt2 - rt8(4) +10.0.255.8/32 IP TE 50 rt2 - rt8(4) +10.0.255.10/32 IP TE 60 rt2 - rt10(4) +rt7 TE-IS 140 rt2 - rt8(4) +rt9 TE-IS 150 rt2 - rt7(4) +10.0.255.7/32 IP TE 150 rt2 - rt7(4) +10.0.255.9/32 IP TE 160 rt2 - rt9(4) +rt5 TE-IS 340 rt2 - rt7(4) +10.0.255.5/32 IP TE 350 rt2 - rt5(4) +rt3 TE-IS 740 rt2 - rt5(4) +10.0.255.3/32 IP TE 750 rt2 - rt3(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------------- + 10.0.255.3/32 750 - rt2 16080/17/16/16 + 10.0.255.5/32 350 - rt2 16080/17/16 + 10.0.255.7/32 150 - rt2 16080/17 + 10.0.255.9/32 160 - rt2 16080/17/18 + +test# test isis topology 13 root rt1 ti-lfa system-id rt3 ipv4-only +P-space (self): + rt2 + +P-space (rt2): + rt2 + rt4 + +Q-space: + rt3 + rt4 + rt5 + rt6 + rt7 + +IS-IS paths to level-1 routers that speak IP +Vertex Type Metric Next-Hop Interface Parent +rt1 +10.0.255.1/32 IP internal 0 rt1(4) +rt2 TE-IS 10 rt2 - rt1(4) +rt4 TE-IS 20 rt2 - rt2(4) +10.0.255.2/32 IP TE 20 rt2 - rt2(4) +rt3 TE-IS 30 rt2 - rt4(4) +10.0.255.4/32 IP TE 30 rt2 - rt4(4) +rt5 TE-IS 40 rt2 - rt3(4) +rt6 TE-IS 40 rt2 - rt3(4) +10.0.255.3/32 IP TE 40 rt2 - rt3(4) +rt7 TE-IS 50 rt2 - rt5(4) + rt6(4) +10.0.255.5/32 IP TE 50 rt2 - rt5(4) +10.0.255.6/32 IP TE 50 rt2 - rt6(4) +10.0.255.7/32 IP TE 60 rt2 - rt7(4) + +IS-IS L1 IPv4 routing table: + + Prefix Metric Interface Nexthop Label(s) + ----------------------------------------------------- + 10.0.255.3/32 40 - rt2 16040 + 10.0.255.5/32 50 - rt2 16040 + 10.0.255.6/32 50 - rt2 16040 + 10.0.255.7/32 60 - rt2 16040 + test# end. diff --git a/tests/topotests/isis-tilfa-topo1/__init__.py b/tests/topotests/isis-tilfa-topo1/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/isisd.conf b/tests/topotests/isis-tilfa-topo1/rt1/isisd.conf new file mode 100644 index 000000000000..a447a2aa5aa9 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/isisd.conf @@ -0,0 +1,33 @@ +password 1 +hostname rt1 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis sr-events +debug isis lsp-gen +! +interface lo + ip router isis 1 + ipv6 router isis 1 + isis passive +! +interface eth-sw1 + ip router isis 1 + ipv6 router isis 1 + isis hello-multiplier 3 + isis priority 100 + isis fast-reroute ti-lfa +! +router isis 1 + net 49.0000.0000.0000.0001.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + segment-routing on + segment-routing global-block 16000 23999 + segment-routing node-msd 8 + segment-routing prefix 1.1.1.1/32 index 10 + segment-routing prefix 2001:db8:1000::1/128 index 11 +! diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step1/show_ip_route.ref b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_ip_route.ref new file mode 100644 index 000000000000..92b7437324a6 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_ip_route.ref @@ -0,0 +1,294 @@ +{ + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16040 + ] + } + ] + } + ], + "5.5.5.5\/32":[ + { + "prefix":"5.5.5.5\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "6.6.6.6\/32":[ + { + "prefix":"6.6.6.6\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16060 + ] + }, + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16060 + ] + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + }, + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "10.0.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step1/show_ipv6_route.ref b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_ipv6_route.ref new file mode 100644 index 000000000000..3232121a0fce --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16041 + ] + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..e3ed7c20b2ff --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.1.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-sw1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 000000000000..69dcc91b1d62 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,34 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + }, + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step2/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step2/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step2/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step2/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step2/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step3/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step3/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step3/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step3/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step3/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..ccea94c42c3b --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ip_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step3/show_ip_route.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step4/show_ip_route.ref 2020-08-31 22:42:48.831561460 -0300 +@@ -60,10 +60,7 @@ + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16040 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..13e098858a24 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_ipv6_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step3/show_ipv6_route.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step4/show_ipv6_route.ref 2020-08-31 22:42:48.831561460 -0300 +@@ -57,10 +57,7 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16041 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..9531fbc2f065 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step4/show_mpls_table.ref.diff @@ -0,0 +1,33 @@ +--- rt1/step3/show_mpls_table.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step4/show_mpls_table.ref 2020-08-31 22:42:48.831561460 -0300 +@@ -47,30 +47,6 @@ + } + ] + }, +- "16040":{ +- "inLabel":16040, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "installed":true, +- "nexthop":"10.0.1.2" +- } +- ] +- }, +- "16041":{ +- "inLabel":16041, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "installed":true, +- "interface":"eth-sw1" +- } +- ] +- }, + "16050":{ + "inLabel":16050, + "installed":true, 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 new file mode 100644 index 000000000000..2a2cb762a766 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ip_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step4/show_ip_route.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step5/show_ip_route.ref 2020-08-31 22:42:48.831561460 -0300 +@@ -60,7 +60,10 @@ + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16040 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..94bf3c1db31d --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_ipv6_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step4/show_ipv6_route.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step5/show_ipv6_route.ref 2020-08-31 22:42:48.831561460 -0300 +@@ -57,7 +57,10 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16041 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..0fd252e45574 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step5/show_mpls_table.ref.diff @@ -0,0 +1,33 @@ +--- rt1/step4/show_mpls_table.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step5/show_mpls_table.ref 2020-08-31 22:42:48.831561460 -0300 +@@ -47,6 +47,30 @@ + } + ] + }, ++ "16040":{ ++ "inLabel":16040, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "installed":true, ++ "nexthop":"10.0.1.2" ++ } ++ ] ++ }, ++ "16041":{ ++ "inLabel":16041, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "installed":true, ++ "interface":"eth-sw1" ++ } ++ ] ++ }, + "16050":{ + "inLabel":16050, + "installed":true, diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step6/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step6/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step6/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt1/step6/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt1/step6/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..22f7ce9a2e60 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ip_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step6/show_ip_route.ref 2020-08-31 22:42:48.831561460 -0300 ++++ rt1/step7/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -83,10 +83,7 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..4b07bd77626d --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_ipv6_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step6/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step7/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -79,10 +79,7 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..b62ca10fa354 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step7/show_mpls_table.ref.diff @@ -0,0 +1,33 @@ +--- rt1/step6/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step7/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -71,30 +71,6 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "installed":true, +- "nexthop":"10.0.1.3" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "installed":true, +- "interface":"eth-sw1" +- } +- ] +- }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..2bf88c8346a2 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ip_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step7/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step8/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -83,7 +83,10 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..a01038a7a800 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_ipv6_route.ref.diff @@ -0,0 +1,14 @@ +--- rt1/step7/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step8/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -79,7 +79,10 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..e3f83613158f --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step8/show_mpls_table.ref.diff @@ -0,0 +1,33 @@ +--- rt1/step7/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step8/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -71,6 +71,30 @@ + } + ] + }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "installed":true, ++ "nexthop":"10.0.1.3" ++ } ++ ] ++ }, ++ "16051":{ ++ "inLabel":16051, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "installed":true, ++ "interface":"eth-sw1" ++ } ++ ] ++ }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..c10f97b86af1 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ip_route.ref.diff @@ -0,0 +1,11 @@ +--- rt1/step8/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step9/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -85,7 +85,7 @@ + "interfaceName":"eth-sw1", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + } + ] 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 new file mode 100644 index 000000000000..7a909f64101c --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_ipv6_route.ref.diff @@ -0,0 +1,11 @@ +--- rt1/step8/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step9/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -81,7 +81,7 @@ + "interfaceName":"eth-sw1", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + } + ] 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 new file mode 100644 index 000000000000..b794a674f8d2 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/step9/show_mpls_table.ref.diff @@ -0,0 +1,64 @@ +--- rt1/step8/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt1/step9/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -71,30 +71,6 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "installed":true, +- "nexthop":"10.0.1.3" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "installed":true, +- "interface":"eth-sw1" +- } +- ] +- }, + "16060":{ + "inLabel":16060, + "installed":true, +@@ -129,6 +105,30 @@ + "installed":true, + "interface":"eth-sw1" + } ++ ] ++ }, ++ "16500":{ ++ "inLabel":16500, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16500, ++ "installed":true, ++ "nexthop":"10.0.1.3" ++ } ++ ] ++ }, ++ "16501":{ ++ "inLabel":16501, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16501, ++ "installed":true, ++ "interface":"eth-sw1" ++ } + ] + } + } diff --git a/tests/topotests/isis-tilfa-topo1/rt1/zebra.conf b/tests/topotests/isis-tilfa-topo1/rt1/zebra.conf new file mode 100644 index 000000000000..9d71d3005f77 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt1/zebra.conf @@ -0,0 +1,19 @@ +log file zebra.log +! +hostname rt1 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 1.1.1.1/32 + ipv6 address 2001:db8:1000::1/128 +! +interface eth-sw1 + ip address 10.0.1.1/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-tilfa-topo1/rt2/isisd.conf b/tests/topotests/isis-tilfa-topo1/rt2/isisd.conf new file mode 100644 index 000000000000..1a756e2c7295 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/isisd.conf @@ -0,0 +1,45 @@ +hostname rt2 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis sr-events +debug isis lsp-gen +! +interface lo + ip router isis 1 + ipv6 router isis 1 + isis passive +! +interface eth-sw1 + ip router isis 1 + ipv6 router isis 1 + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt4-1 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt4-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +router isis 1 + net 49.0000.0000.0000.0002.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + segment-routing on + segment-routing global-block 16000 23999 + segment-routing node-msd 8 + segment-routing prefix 2.2.2.2/32 index 20 + segment-routing prefix 2001:db8:1000::2/128 index 21 +! 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 new file mode 100644 index 000000000000..7c6f6f8b65e5 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ip_route.ref @@ -0,0 +1,453 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.1", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "5.5.5.5\/32":[ + { + "prefix":"5.5.5.5\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "6.6.6.6\/32":[ + { + "prefix":"6.6.6.6\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16060 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16060 + ] + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.1.1", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "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", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2" + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + }, + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..68569b7265b8 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_ipv6_route.ref @@ -0,0 +1,192 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16051 + ] + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16051 + ] + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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 new file mode 100644 index 000000000000..4c18e2047247 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_mpls_table.ref @@ -0,0 +1,234 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "nexthop":"10.0.2.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "nexthop":"10.0.3.4" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "interface":"eth-rt4-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "interface":"eth-rt4-2" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.3", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "nexthop":"10.0.2.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "nexthop":"10.0.3.4" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "interface":"eth-rt4-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "interface":"eth-rt4-2" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.2.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt4-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt4-1" + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 000000000000..280c761b9e6e --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,74 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0004", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt4-2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0004", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-sw1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 100, + "state": "up" + }, + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + } + ] + } +} 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 new file mode 100644 index 000000000000..24237769e996 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ip_route.ref.diff @@ -0,0 +1,159 @@ +--- rt2/step1/show_ip_route.ref 2020-08-31 15:36:25.999825589 -0300 ++++ rt2/step2/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -15,34 +15,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] +- } + ] + } + ], +@@ -62,34 +38,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] +- } + ] + } + ], +@@ -212,34 +164,12 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] ++ "interfaceName":"eth-sw1" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true ++ "interfaceName":"eth-sw1" + } + ] + } +@@ -301,24 +231,6 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true, +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", + "active":true + } + ] +@@ -339,24 +251,6 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true, +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", + "active":true + } + ] 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 new file mode 100644 index 000000000000..7c9f1e965a9f --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_ipv6_route.ref.diff @@ -0,0 +1,68 @@ +--- rt2/step1/show_ipv6_route.ref 2020-08-31 15:36:25.999825589 -0300 ++++ rt2/step2/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -14,32 +14,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] +- } + ] + } + ], +@@ -58,32 +36,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] +- } + ] + } + ], 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 new file mode 100644 index 000000000000..1c3e037b96bf --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step2/show_mpls_table.ref.diff @@ -0,0 +1,102 @@ +--- rt2/step1/show_mpls_table.ref 2020-08-31 15:36:25.999825589 -0300 ++++ rt2/step2/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -7,23 +7,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.3.4" ++ "nexthop":"10.0.1.1" + } + ] + }, +@@ -35,23 +19,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-2" ++ "interface":"eth-sw1" + } + ] + }, +@@ -63,23 +31,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.3", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.3.4" ++ "nexthop":"10.0.1.3" + } + ] + }, +@@ -91,23 +43,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-2" ++ "interface":"eth-sw1" + } + ] + }, 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 new file mode 100644 index 000000000000..4613c2c63da9 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ip_route.ref.diff @@ -0,0 +1,159 @@ +--- rt2/step2/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step3/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -15,10 +15,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ } + ] + } + ], +@@ -38,10 +62,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ } + ] + } + ], +@@ -164,12 +212,34 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true + } + ] + } +@@ -231,6 +301,24 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", + "active":true + } + ] +@@ -251,6 +339,24 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", + "active":true + } + ] 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 new file mode 100644 index 000000000000..84b528336078 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_ipv6_route.ref.diff @@ -0,0 +1,68 @@ +--- rt2/step2/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step3/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -14,10 +14,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ } + ] + } + ], +@@ -36,10 +58,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ } + ] + } + ], 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 new file mode 100644 index 000000000000..5dc90e442c09 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step3/show_mpls_table.ref.diff @@ -0,0 +1,102 @@ +--- rt2/step2/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step3/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -7,7 +7,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1" ++ "nexthop":"10.0.1.1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.3.4" + } + ] + }, +@@ -19,7 +35,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-2" + } + ] + }, +@@ -31,7 +63,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.3" ++ "nexthop":"10.0.1.3", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.3.4" + } + ] + }, +@@ -43,7 +91,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-2" + } + ] + }, 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 new file mode 100644 index 000000000000..f703db555ff7 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ip_route.ref.diff @@ -0,0 +1,173 @@ +--- rt2/step3/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step4/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -15,34 +15,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] +- } + ] + } + ], +@@ -62,34 +38,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] +- } + ] + } + ], +@@ -108,20 +60,14 @@ + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -153,7 +99,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16050 ++ 3 + ] + }, + { +@@ -163,7 +109,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16050 ++ 3 + ] + } + ] +@@ -184,20 +130,14 @@ + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16060 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16060 +- ] ++ "active":true + } + ] + } +@@ -212,34 +152,12 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] ++ "interfaceName":"eth-sw1" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true ++ "interfaceName":"eth-sw1" + } + ] + } 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 new file mode 100644 index 000000000000..fdd4a5166e80 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_ipv6_route.ref.diff @@ -0,0 +1,130 @@ +--- rt2/step3/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step4/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -14,32 +14,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] +- } + ] + } + ], +@@ -58,32 +36,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] +- } + ] + } + ], +@@ -101,19 +57,13 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -134,7 +84,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16051 ++ 3 + ] + }, + { +@@ -152,7 +102,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16051 ++ 3 + ] + } + ] +@@ -172,19 +122,13 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16061 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16061 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..dcc4532e5418 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step4/show_mpls_table.ref.diff @@ -0,0 +1,212 @@ +--- rt2/step3/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step4/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -7,23 +7,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.3.4" ++ "nexthop":"10.0.1.1" + } + ] + }, +@@ -35,23 +19,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-2" ++ "interface":"eth-sw1" + } + ] + }, +@@ -63,23 +31,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.3", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.3.4" ++ "nexthop":"10.0.1.3" + } + ] + }, +@@ -91,59 +43,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-2" +- } +- ] +- }, +- "16040":{ +- "inLabel":16040, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.3.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.2.4" +- } +- ] +- }, +- "16041":{ +- "inLabel":16041, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt4-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt4-1" ++ "interface":"eth-sw1" + } + ] + }, +@@ -153,13 +53,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":3, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":3, + "installed":true, + "nexthop":"10.0.2.4" + }, +@@ -177,13 +77,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":3, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":3, + "installed":true, + "interface":"eth-rt4-1" + }, +@@ -194,41 +94,5 @@ + "interface":"eth-sw1" + } + ] +- }, +- "16060":{ +- "inLabel":16060, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16060, +- "installed":true, +- "nexthop":"10.0.3.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16060, +- "installed":true, +- "nexthop":"10.0.2.4" +- } +- ] +- }, +- "16061":{ +- "inLabel":16061, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16061, +- "installed":true, +- "interface":"eth-rt4-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16061, +- "installed":true, +- "interface":"eth-rt4-1" +- } +- ] + } + } 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 new file mode 100644 index 000000000000..22a5cb6579e0 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ip_route.ref.diff @@ -0,0 +1,173 @@ +--- rt2/step4/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step5/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -15,10 +15,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ } + ] + } + ], +@@ -38,10 +62,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ } + ] + } + ], +@@ -60,14 +108,20 @@ + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -99,7 +153,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 3 ++ 16050 + ] + }, + { +@@ -109,7 +163,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 3 ++ 16050 + ] + } + ] +@@ -130,14 +184,20 @@ + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16060 ++ ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16060 ++ ] + } + ] + } +@@ -152,12 +212,34 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..819a153f7a43 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_ipv6_route.ref.diff @@ -0,0 +1,130 @@ +--- rt2/step4/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step5/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -14,10 +14,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ } + ] + } + ], +@@ -36,10 +58,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ } + ] + } + ], +@@ -57,13 +101,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -84,7 +134,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 3 ++ 16051 + ] + }, + { +@@ -102,7 +152,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 3 ++ 16051 + ] + } + ] +@@ -122,13 +172,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16061 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16061 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..7f851effadd9 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step5/show_mpls_table.ref.diff @@ -0,0 +1,210 @@ +--- rt2/step4/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step5/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -7,7 +7,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1" ++ "nexthop":"10.0.1.1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.3.4" + } + ] + }, +@@ -19,7 +35,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-2" + } + ] + }, +@@ -31,7 +63,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.3" ++ "nexthop":"10.0.1.3", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.3.4" + } + ] + }, +@@ -43,12 +91,28 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-2" + } + ] + }, +- "16050":{ +- "inLabel":16050, ++ "16040":{ ++ "inLabel":16040, + "installed":true, + "nexthops":[ + { +@@ -62,6 +126,42 @@ + "outLabel":3, + "installed":true, + "nexthop":"10.0.2.4" ++ } ++ ] ++ }, ++ "16041":{ ++ "inLabel":16041, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt4-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt4-1" ++ } ++ ] ++ }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "installed":true, ++ "nexthop":"10.0.3.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "installed":true, ++ "nexthop":"10.0.2.4" + }, + { + "type":"SR (IS-IS)", +@@ -77,13 +177,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16051, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16051, + "installed":true, + "interface":"eth-rt4-1" + }, +@@ -94,5 +194,41 @@ + "interface":"eth-sw1" + } + ] ++ }, ++ "16060":{ ++ "inLabel":16060, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16060, ++ "installed":true, ++ "nexthop":"10.0.3.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16060, ++ "installed":true, ++ "nexthop":"10.0.2.4" ++ } ++ ] ++ }, ++ "16061":{ ++ "inLabel":16061, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16061, ++ "installed":true, ++ "interface":"eth-rt4-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16061, ++ "installed":true, ++ "interface":"eth-rt4-1" ++ } ++ ] + } + } diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step6/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step6/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step6/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt2/step6/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt2/step6/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..109ab8ea6aaf --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ip_route.ref.diff @@ -0,0 +1,143 @@ +--- rt2/step6/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step7/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -15,34 +15,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] +- } + ] + } + ], +@@ -62,34 +38,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] +- } + ] + } + ], +@@ -141,30 +93,21 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16050 +- ] ++ "active":true + } + ] + } +@@ -212,34 +155,12 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] ++ "interfaceName":"eth-sw1" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.2.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-1", +- "active":true +- }, +- { +- "ip":"10.0.3.4", +- "afi":"ipv4", +- "interfaceName":"eth-rt4-2", +- "active":true ++ "interfaceName":"eth-sw1" + } + ] + } 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 new file mode 100644 index 000000000000..871fd98b7eb0 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_ipv6_route.ref.diff @@ -0,0 +1,100 @@ +--- rt2/step6/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step7/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -14,32 +14,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] +- } + ] + } + ], +@@ -58,32 +36,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] +- } + ] + } + ], +@@ -132,28 +88,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", +- "active":true, +- "labels":[ +- 16051 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..ad48c50f32ed --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step7/show_mpls_table.ref.diff @@ -0,0 +1,157 @@ +--- rt2/step6/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step7/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -7,23 +7,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.3.4" ++ "nexthop":"10.0.1.1" + } + ] + }, +@@ -35,23 +19,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-2" ++ "interface":"eth-sw1" + } + ] + }, +@@ -63,23 +31,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.3", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "nexthop":"10.0.3.4" ++ "nexthop":"10.0.1.3" + } + ] + }, +@@ -91,23 +43,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "interface":"eth-rt4-2" ++ "interface":"eth-sw1" + } + ] + }, +@@ -147,54 +83,6 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "installed":true, +- "nexthop":"10.0.3.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "installed":true, +- "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "installed":true, +- "nexthop":"10.0.1.3" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "installed":true, +- "interface":"eth-rt4-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "installed":true, +- "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "installed":true, +- "interface":"eth-sw1" +- } +- ] +- }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..3511a595c30c --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ip_route.ref.diff @@ -0,0 +1,143 @@ +--- rt2/step7/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step8/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -15,10 +15,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ } + ] + } + ], +@@ -38,10 +62,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16050 ++ ] ++ } + ] + } + ], +@@ -93,21 +141,30 @@ + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + }, + { + "fib":true, + "ip":"10.0.2.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16050 ++ ] + } + ] + } +@@ -155,12 +212,34 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.2.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.4", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt4-2", ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..96a60197ab9c --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_ipv6_route.ref.diff @@ -0,0 +1,100 @@ +--- rt2/step7/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step8/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -14,10 +14,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ } + ] + } + ], +@@ -36,10 +58,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-1", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt4-2", ++ "active":true, ++ "labels":[ ++ 16051 ++ ] ++ } + ] + } + ], +@@ -88,19 +132,28 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16051 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..04b8e997250b --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step8/show_mpls_table.ref.diff @@ -0,0 +1,157 @@ +--- rt2/step7/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step8/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -7,7 +7,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1" ++ "nexthop":"10.0.1.1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.3.4" + } + ] + }, +@@ -19,7 +35,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-2" + } + ] + }, +@@ -31,7 +63,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.3" ++ "nexthop":"10.0.1.3", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "nexthop":"10.0.3.4" + } + ] + }, +@@ -43,7 +91,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "interface":"eth-rt4-2" + } + ] + }, +@@ -83,6 +147,54 @@ + } + ] + }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "installed":true, ++ "nexthop":"10.0.3.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "installed":true, ++ "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16050, ++ "installed":true, ++ "nexthop":"10.0.1.3" ++ } ++ ] ++ }, ++ "16051":{ ++ "inLabel":16051, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "installed":true, ++ "interface":"eth-rt4-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "installed":true, ++ "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16051, ++ "installed":true, ++ "interface":"eth-sw1" ++ } ++ ] ++ }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..b7deb80554dd --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ip_route.ref.diff @@ -0,0 +1,65 @@ +--- rt2/step8/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step9/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -31,7 +31,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + }, + { +@@ -40,7 +40,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + } + ] +@@ -78,7 +78,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + }, + { +@@ -87,7 +87,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + } + ] +@@ -143,7 +143,7 @@ + "interfaceName":"eth-sw1", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + }, + { +@@ -153,7 +153,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + }, + { +@@ -163,7 +163,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16050 ++ 16500 + ] + } + ] 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 new file mode 100644 index 000000000000..cd634af4e6ee --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_ipv6_route.ref.diff @@ -0,0 +1,65 @@ +--- rt2/step8/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step9/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -29,7 +29,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + }, + { +@@ -37,7 +37,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + } + ] +@@ -73,7 +73,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + }, + { +@@ -81,7 +81,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + } + ] +@@ -134,7 +134,7 @@ + "interfaceName":"eth-rt4-1", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + }, + { +@@ -143,7 +143,7 @@ + "interfaceName":"eth-sw1", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + }, + { +@@ -152,7 +152,7 @@ + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ +- 16051 ++ 16501 + ] + } + ] 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 new file mode 100644 index 000000000000..f195264f5a3d --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/step9/show_mpls_table.ref.diff @@ -0,0 +1,178 @@ +--- rt2/step8/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt2/step9/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 +@@ -17,12 +17,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16500, + "nexthop":"10.0.2.4" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16500, + "nexthop":"10.0.3.4" + } + ] +@@ -45,12 +45,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16501, + "interface":"eth-rt4-1" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16501, + "interface":"eth-rt4-2" + } + ] +@@ -73,12 +73,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16500, + "nexthop":"10.0.2.4" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16500, + "nexthop":"10.0.3.4" + } + ] +@@ -101,12 +101,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16501, + "interface":"eth-rt4-1" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16501, + "interface":"eth-rt4-2" + } + ] +@@ -147,87 +147,87 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, ++ "16060":{ ++ "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16060, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16050, ++ "outLabel":16060, + "installed":true, + "nexthop":"10.0.2.4" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16050, +- "installed":true, +- "nexthop":"10.0.1.3" + } + ] + }, +- "16051":{ +- "inLabel":16051, ++ "16061":{ ++ "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16061, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16051, ++ "outLabel":16061, + "installed":true, + "interface":"eth-rt4-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16051, +- "installed":true, +- "interface":"eth-sw1" + } + ] + }, +- "16060":{ +- "inLabel":16060, ++ "16500":{ ++ "inLabel":16500, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16060, ++ "outLabel":16500, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16060, ++ "outLabel":16500, + "installed":true, + "nexthop":"10.0.2.4" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16500, ++ "installed":true, ++ "nexthop":"10.0.1.3" + } + ] + }, +- "16061":{ +- "inLabel":16061, ++ "16501":{ ++ "inLabel":16501, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16061, ++ "outLabel":16501, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16061, ++ "outLabel":16501, + "installed":true, + "interface":"eth-rt4-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16501, ++ "installed":true, ++ "interface":"eth-sw1" + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt2/zebra.conf b/tests/topotests/isis-tilfa-topo1/rt2/zebra.conf new file mode 100644 index 000000000000..dcb0686dc2b2 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt2/zebra.conf @@ -0,0 +1,25 @@ +log file zebra.log +! +hostname rt2 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 2.2.2.2/32 + ipv6 address 2001:db8:1000::2/128 +! +interface eth-sw1 + ip address 10.0.1.2/24 +! +interface eth-rt4-1 + ip address 10.0.2.2/24 +! +interface eth-rt4-2 + ip address 10.0.3.2/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-tilfa-topo1/rt3/isisd.conf b/tests/topotests/isis-tilfa-topo1/rt3/isisd.conf new file mode 100644 index 000000000000..986bf2804a05 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/isisd.conf @@ -0,0 +1,45 @@ +hostname rt3 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis sr-events +debug isis lsp-gen +! +interface lo + ip router isis 1 + ipv6 router isis 1 + isis passive +! +interface eth-sw1 + ip router isis 1 + ipv6 router isis 1 + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt5-1 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt5-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +router isis 1 + net 49.0000.0000.0000.0003.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + segment-routing on + segment-routing global-block 16000 23999 + segment-routing node-msd 8 + segment-routing prefix 3.3.3.3/32 index 30 + segment-routing prefix 2001:db8:1000::3/128 index 31 +! 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 new file mode 100644 index 000000000000..5a4e1ce03397 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ip_route.ref @@ -0,0 +1,453 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.1", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16040 + ] + }, + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16040 + ] + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16040 + ] + }, + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16040 + ] + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16040 + ] + } + ] + } + ], + "5.5.5.5\/32":[ + { + "prefix":"5.5.5.5\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "6.6.6.6\/32":[ + { + "prefix":"6.6.6.6\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16060 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16060 + ] + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.1.1", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + }, + { + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + }, + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + }, + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + }, + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1" + }, + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + }, + { + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2" + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + } + ] + } + ], + "10.0.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + }, + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..525a87f31d62 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_ipv6_route.ref @@ -0,0 +1,192 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16041 + ] + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16041 + ] + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "backupIndex":[ + 0, + 1 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16041 + ] + }, + { + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16041 + ] + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16041 + ] + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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 new file mode 100644 index 000000000000..13f5f2c703ef --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_mpls_table.ref @@ -0,0 +1,234 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "nexthop":"10.0.4.5" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "interface":"eth-rt5-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.2", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "nexthop":"10.0.4.5" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1", + "backupIndex":[ + 0, + 1 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "interface":"eth-rt5-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.5.5" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt5-2" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.5.5" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt5-2" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 000000000000..606595e3fa73 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,74 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0005", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt5-2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0005", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-sw1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 100, + "state": "up" + }, + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step2/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step2/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step2/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step2/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step2/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step3/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step3/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step3/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt3/step3/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt3/step3/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..e5fe6e7589f6 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ip_route.ref.diff @@ -0,0 +1,143 @@ +--- rt3/step3/show_ip_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt3/step4/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -15,34 +15,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.5.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 16040 +- ] +- }, +- { +- "ip":"10.0.4.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 16040 +- ] +- } + ] + } + ], +@@ -62,34 +38,10 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.5.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 16040 +- ] +- }, +- { +- "ip":"10.0.4.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 16040 +- ] +- } + ] + } + ], +@@ -108,30 +60,21 @@ + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16040 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 16040 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 16040 +- ] ++ "active":true + } + ] + } +@@ -212,34 +155,12 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] ++ "interfaceName":"eth-sw1" + }, + { + "ip":"10.0.1.2", + "afi":"ipv4", +- "interfaceName":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.5.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5-2", +- "active":true +- }, +- { +- "ip":"10.0.4.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5-1", +- "active":true ++ "interfaceName":"eth-sw1" + } + ] + } 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 new file mode 100644 index 000000000000..ccfbbeae69a5 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_ipv6_route.ref.diff @@ -0,0 +1,100 @@ +--- rt3/step3/show_ipv6_route.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt3/step4/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -14,32 +14,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 16041 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 16041 +- ] +- } + ] + } + ], +@@ -58,32 +36,10 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, +- "backupIndex":[ +- 0, +- 1 +- ], + "labels":[ + 3 + ] + } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 16041 +- ] +- }, +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 16041 +- ] +- } + ] + } + ], +@@ -101,28 +57,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 16041 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 16041 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true, +- "labels":[ +- 16041 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..64a8689a82db --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step4/show_mpls_table.ref.diff @@ -0,0 +1,149 @@ +--- rt3/step3/show_mpls_table.ref 2020-08-31 22:42:48.835561429 -0300 ++++ rt3/step4/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -7,23 +7,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "nexthop":"10.0.5.5" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "nexthop":"10.0.4.5" ++ "nexthop":"10.0.1.1" + } + ] + }, +@@ -35,23 +19,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "interface":"eth-rt5-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "interface":"eth-rt5-1" ++ "interface":"eth-sw1" + } + ] + }, +@@ -63,23 +31,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.2", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "nexthop":"10.0.5.5" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "nexthop":"10.0.4.5" ++ "nexthop":"10.0.1.2" + } + ] + }, +@@ -91,71 +43,7 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1", +- "backupIndex":[ +- 0, +- 1 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "interface":"eth-rt5-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "interface":"eth-rt5-1" +- } +- ] +- }, +- "16040":{ +- "inLabel":16040, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "installed":true, +- "nexthop":"10.0.1.2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "installed":true, +- "nexthop":"10.0.4.5" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16040, +- "installed":true, +- "nexthop":"10.0.5.5" +- } +- ] +- }, +- "16041":{ +- "inLabel":16041, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "installed":true, + "interface":"eth-sw1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "installed":true, +- "interface":"eth-rt5-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16041, +- "installed":true, +- "interface":"eth-rt5-2" + } + ] + }, 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 new file mode 100644 index 000000000000..de265cc25520 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ip_route.ref.diff @@ -0,0 +1,143 @@ +--- rt3/step4/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step5/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -15,10 +15,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.5.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5-2", ++ "active":true, ++ "labels":[ ++ 16040 ++ ] ++ }, ++ { ++ "ip":"10.0.4.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5-1", ++ "active":true, ++ "labels":[ ++ 16040 ++ ] ++ } + ] + } + ], +@@ -38,10 +62,34 @@ + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.5.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5-2", ++ "active":true, ++ "labels":[ ++ 16040 ++ ] ++ }, ++ { ++ "ip":"10.0.4.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5-1", ++ "active":true, ++ "labels":[ ++ 16040 ++ ] ++ } + ] + } + ], +@@ -60,21 +108,30 @@ + "ip":"10.0.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16040 ++ ] + }, + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16040 ++ ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16040 ++ ] + } + ] + } +@@ -155,12 +212,34 @@ + { + "ip":"10.0.1.1", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] + }, + { + "ip":"10.0.1.2", + "afi":"ipv4", +- "interfaceName":"eth-sw1" ++ "interfaceName":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.5.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5-2", ++ "active":true ++ }, ++ { ++ "ip":"10.0.4.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5-1", ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..947d4271e8e1 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_ipv6_route.ref.diff @@ -0,0 +1,100 @@ +--- rt3/step4/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step5/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -14,10 +14,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5-2", ++ "active":true, ++ "labels":[ ++ 16041 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5-1", ++ "active":true, ++ "labels":[ ++ 16041 ++ ] ++ } + ] + } + ], +@@ -36,10 +58,32 @@ + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, ++ "backupIndex":[ ++ 0, ++ 1 ++ ], + "labels":[ + 3 + ] + } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5-2", ++ "active":true, ++ "labels":[ ++ 16041 ++ ] ++ }, ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5-1", ++ "active":true, ++ "labels":[ ++ 16041 ++ ] ++ } + ] + } + ], +@@ -57,19 +101,28 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16041 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16041 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16041 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..3dd237b91bed --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step5/show_mpls_table.ref.diff @@ -0,0 +1,148 @@ +--- rt3/step4/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step5/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -7,7 +7,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.1" ++ "nexthop":"10.0.1.1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "nexthop":"10.0.5.5" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "nexthop":"10.0.4.5" + } + ] + }, +@@ -19,7 +35,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-sw1" ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "interface":"eth-rt5-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "interface":"eth-rt5-1" + } + ] + }, +@@ -31,7 +63,23 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.1.2" ++ "nexthop":"10.0.1.2", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "nexthop":"10.0.5.5" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "nexthop":"10.0.4.5" + } + ] + }, +@@ -43,6 +91,70 @@ + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, ++ "interface":"eth-sw1", ++ "backupIndex":[ ++ 0, ++ 1 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "interface":"eth-rt5-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "interface":"eth-rt5-1" ++ } ++ ] ++ }, ++ "16040":{ ++ "inLabel":16040, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "installed":true, ++ "nexthop":"10.0.4.5" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "installed":true, ++ "nexthop":"10.0.5.5" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16040, ++ "installed":true, ++ "nexthop":"10.0.1.2" ++ } ++ ] ++ }, ++ "16041":{ ++ "inLabel":16041, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "installed":true, ++ "interface":"eth-rt5-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "installed":true, ++ "interface":"eth-rt5-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16041, ++ "installed":true, + "interface":"eth-sw1" + } + ] 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 new file mode 100644 index 000000000000..00f0bb031a67 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ip_route.ref.diff @@ -0,0 +1,74 @@ +--- rt3/step5/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step6/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -31,7 +31,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + }, + { +@@ -40,7 +40,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + } + ] +@@ -78,7 +78,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + }, + { +@@ -87,7 +87,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + } + ] +@@ -120,7 +120,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + }, + { +@@ -130,7 +130,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16040 ++ 30040 + ] + } + ] +@@ -186,7 +186,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16060 ++ 30060 + ] + }, + { +@@ -196,7 +196,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16060 ++ 30060 + ] + } + ] 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 new file mode 100644 index 000000000000..823cd4591fa3 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_ipv6_route.ref.diff @@ -0,0 +1,74 @@ +--- rt3/step5/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step6/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -29,7 +29,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + }, + { +@@ -37,7 +37,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + } + ] +@@ -73,7 +73,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + }, + { +@@ -81,7 +81,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + } + ] +@@ -103,7 +103,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + }, + { +@@ -112,7 +112,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16041 ++ 30041 + ] + }, + { +@@ -174,7 +174,7 @@ + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ +- 16061 ++ 30061 + ] + }, + { +@@ -183,7 +183,7 @@ + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ +- 16061 ++ 30061 + ] + } + ] 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 new file mode 100644 index 000000000000..1ad228b9c24a --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step6/show_mpls_table.ref.diff @@ -0,0 +1,126 @@ +--- rt3/step5/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step6/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -17,12 +17,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "nexthop":"10.0.4.5" + } + ] +@@ -45,12 +45,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "interface":"eth-rt5-1" + } + ] +@@ -73,12 +73,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "nexthop":"10.0.4.5" + } + ] +@@ -101,12 +101,12 @@ + "backupNexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "interface":"eth-rt5-1" + } + ] +@@ -117,13 +117,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16040, ++ "outLabel":30040, + "installed":true, + "nexthop":"10.0.5.5" + }, +@@ -141,13 +141,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16041, ++ "outLabel":30041, + "installed":true, + "interface":"eth-rt5-2" + }, +@@ -201,13 +201,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16060, ++ "outLabel":30060, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16060, ++ "outLabel":30060, + "installed":true, + "nexthop":"10.0.5.5" + } +@@ -219,13 +219,13 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16061, ++ "outLabel":30061, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", +- "outLabel":16061, ++ "outLabel":30061, + "installed":true, + "interface":"eth-rt5-2" + } 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 new file mode 100644 index 000000000000..bee7c568e74f --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ip_route.ref.diff @@ -0,0 +1,25 @@ +--- rt3/step6/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step7/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -151,20 +151,14 @@ + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..05b40803043b --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_ipv6_route.ref.diff @@ -0,0 +1,24 @@ +--- rt3/step6/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step7/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -141,19 +141,13 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..3fb37faea658 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step7/show_mpls_table.ref.diff @@ -0,0 +1,45 @@ +--- rt3/step6/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step7/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -159,42 +159,6 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.4.5" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.5.5" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt5-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt5-2" +- } +- ] +- }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..c31d25261c70 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ip_route.ref.diff @@ -0,0 +1,25 @@ +--- rt3/step7/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step8/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -151,14 +151,20 @@ + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..759f28d26379 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_ipv6_route.ref.diff @@ -0,0 +1,24 @@ +--- rt3/step7/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step8/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -141,13 +141,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..0c2c8e2b09f2 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step8/show_mpls_table.ref.diff @@ -0,0 +1,45 @@ +--- rt3/step7/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step8/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -159,6 +159,42 @@ + } + ] + }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.4.5" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.5.5" ++ } ++ ] ++ }, ++ "16051":{ ++ "inLabel":16051, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt5-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt5-2" ++ } ++ ] ++ }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..b0a4851750d5 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/step9/show_mpls_table.ref.diff @@ -0,0 +1,92 @@ +--- rt3/step8/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt3/step9/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -159,73 +159,73 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, ++ "16060":{ ++ "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":30060, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":30060, + "installed":true, + "nexthop":"10.0.5.5" + } + ] + }, +- "16051":{ +- "inLabel":16051, ++ "16061":{ ++ "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":30061, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":30061, + "installed":true, + "interface":"eth-rt5-2" + } + ] + }, +- "16060":{ +- "inLabel":16060, ++ "16500":{ ++ "inLabel":16500, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":30060, ++ "outLabel":3, + "installed":true, + "nexthop":"10.0.4.5" + }, + { + "type":"SR (IS-IS)", +- "outLabel":30060, ++ "outLabel":3, + "installed":true, + "nexthop":"10.0.5.5" + } + ] + }, +- "16061":{ +- "inLabel":16061, ++ "16501":{ ++ "inLabel":16501, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":30061, ++ "outLabel":3, + "installed":true, + "interface":"eth-rt5-1" + }, + { + "type":"SR (IS-IS)", +- "outLabel":30061, ++ "outLabel":3, + "installed":true, + "interface":"eth-rt5-2" + } diff --git a/tests/topotests/isis-tilfa-topo1/rt3/zebra.conf b/tests/topotests/isis-tilfa-topo1/rt3/zebra.conf new file mode 100644 index 000000000000..3254529386ae --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt3/zebra.conf @@ -0,0 +1,25 @@ +log file zebra.log +! +hostname rt3 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 3.3.3.3/32 + ipv6 address 2001:db8:1000::3/128 +! +interface eth-sw1 + ip address 10.0.1.3/24 +! +interface eth-rt5-1 + ip address 10.0.4.3/24 +! +interface eth-rt5-2 + ip address 10.0.5.3/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-tilfa-topo1/rt4/isisd.conf b/tests/topotests/isis-tilfa-topo1/rt4/isisd.conf new file mode 100644 index 000000000000..7d411069d1ce --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/isisd.conf @@ -0,0 +1,53 @@ +hostname rt4 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis sr-events +debug isis lsp-gen +! +interface lo + ip router isis 1 + ipv6 router isis 1 + isis passive +! +interface eth-rt2-1 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt2-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt5 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt6 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +router isis 1 + net 49.0000.0000.0000.0004.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + segment-routing on + segment-routing global-block 16000 23999 + segment-routing node-msd 8 + segment-routing prefix 4.4.4.4/32 index 40 + segment-routing prefix 2001:db8:1000::4/128 index 41 +! 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 new file mode 100644 index 000000000000..3ee587ac4998 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ip_route.ref @@ -0,0 +1,423 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16010 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16010 + ] + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16030 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16030 + ] + }, + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16030 + ] + } + ] + } + ], + "5.5.5.5\/32":[ + { + "prefix":"5.5.5.5\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "6.6.6.6\/32":[ + { + "prefix":"6.6.6.6\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1" + }, + { + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + }, + { + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2" + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0, + 1, + 2 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + }, + { + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + }, + { + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0, + 1, + 2 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + }, + { + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true + }, + { + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "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", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..2f6b703d93f2 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_ipv6_route.ref @@ -0,0 +1,174 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16011 + ] + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16031 + ] + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..5433d4f100d7 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_mpls_table.ref @@ -0,0 +1,210 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt2-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt2-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.2.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.6.5" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt2-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.6.5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.7.6", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.6.5" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt6", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 000000000000..9d7a19e86833 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,86 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt2-2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0002", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt5", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0005", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt6", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0006", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step2/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step2/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step2/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step2/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step2/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step3/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step3/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step3/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt4/step3/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt4/step3/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..09a0eaa424b6 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ip_route.ref.diff @@ -0,0 +1,238 @@ +--- rt4/step3/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step4/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -14,20 +14,14 @@ + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", +- "active":true, +- "labels":[ +- 16010 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", +- "active":true, +- "labels":[ +- 16010 +- ] ++ "active":true + } + ] + } +@@ -47,20 +41,14 @@ + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -80,30 +68,21 @@ + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", +- "active":true, +- "labels":[ +- 16030 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", +- "active":true, +- "labels":[ +- 16030 +- ] ++ "active":true + }, + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 16030 +- ] ++ "active":true + } + ] + } +@@ -123,24 +102,7 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "backupIndex":[ +- 0 +- ], +- "labels":[ +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.7.6", +- "afi":"ipv4", +- "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -160,24 +122,7 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true, +- "backupIndex":[ +- 0 +- ], +- "labels":[ +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.6.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -266,31 +211,6 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.7.6", +- "afi":"ipv4", +- "interfaceName":"eth-rt6", +- "active":true +- }, +- { +- "ip":"10.0.2.2", +- "afi":"ipv4", +- "interfaceName":"eth-rt2-1", +- "active":true +- }, +- { +- "ip":"10.0.3.2", +- "afi":"ipv4", +- "interfaceName":"eth-rt2-2", + "active":true + } + ] +@@ -311,31 +231,6 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "backupIndex":[ +- 0, +- 1, +- 2 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.7.6", +- "afi":"ipv4", +- "interfaceName":"eth-rt6", +- "active":true +- }, +- { +- "ip":"10.0.2.2", +- "afi":"ipv4", +- "interfaceName":"eth-rt2-1", +- "active":true +- }, +- { +- "ip":"10.0.3.2", +- "afi":"ipv4", +- "interfaceName":"eth-rt2-2", + "active":true + } + ] +@@ -351,18 +246,7 @@ + { + "ip":"10.0.6.5", + "afi":"ipv4", +- "interfaceName":"eth-rt5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.7.6", +- "afi":"ipv4", +- "interfaceName":"eth-rt6", +- "active":true ++ "interfaceName":"eth-rt5" + } + ] + } +@@ -377,18 +261,7 @@ + { + "ip":"10.0.7.6", + "afi":"ipv4", +- "interfaceName":"eth-rt6", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "ip":"10.0.6.5", +- "afi":"ipv4", +- "interfaceName":"eth-rt5", +- "active":true ++ "interfaceName":"eth-rt6" + } + ] + } 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 new file mode 100644 index 000000000000..c1f9fa4bbae6 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_ipv6_route.ref.diff @@ -0,0 +1,128 @@ +--- rt4/step3/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step4/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -13,19 +13,13 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", +- "active":true, +- "labels":[ +- 16011 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", +- "active":true, +- "labels":[ +- 16011 +- ] ++ "active":true + } + ] + } +@@ -44,19 +38,13 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -75,28 +63,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", +- "active":true, +- "labels":[ +- 16031 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 16031 +- ] ++ "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", +- "active":true, +- "labels":[ +- 16031 +- ] ++ "active":true + } + ] + } +@@ -115,23 +94,7 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "backupIndex":[ +- 0 +- ], +- "labels":[ +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -150,23 +113,7 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "backupIndex":[ +- 0 +- ], +- "labels":[ +- 3 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "afi":"ipv6", +- "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..710f81708bfc --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step4/show_mpls_table.ref.diff @@ -0,0 +1,213 @@ +--- rt4/step3/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step4/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -1,210 +1,2 @@ + { +- "16010":{ +- "inLabel":16010, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16010, +- "installed":true, +- "nexthop":"10.0.3.2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16010, +- "installed":true, +- "nexthop":"10.0.2.2" +- } +- ] +- }, +- "16011":{ +- "inLabel":16011, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16011, +- "installed":true, +- "interface":"eth-rt2-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16011, +- "installed":true, +- "interface":"eth-rt2-1" +- } +- ] +- }, +- "16020":{ +- "inLabel":16020, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.3.2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.2.2" +- } +- ] +- }, +- "16021":{ +- "inLabel":16021, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt2-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt2-1" +- } +- ] +- }, +- "16030":{ +- "inLabel":16030, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16030, +- "installed":true, +- "nexthop":"10.0.3.2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16030, +- "installed":true, +- "nexthop":"10.0.2.2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16030, +- "installed":true, +- "nexthop":"10.0.6.5" +- } +- ] +- }, +- "16031":{ +- "inLabel":16031, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16031, +- "installed":true, +- "interface":"eth-rt2-2" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16031, +- "installed":true, +- "interface":"eth-rt2-1" +- }, +- { +- "type":"SR (IS-IS)", +- "outLabel":16031, +- "installed":true, +- "interface":"eth-rt5" +- } +- ] +- }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.6.5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "nexthop":"10.0.7.6" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "interface":"eth-rt6" +- } +- ] +- }, +- "16060":{ +- "inLabel":16060, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.7.6", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "nexthop":"10.0.6.5" +- } +- ] +- }, +- "16061":{ +- "inLabel":16061, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt6", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "interface":"eth-rt5" +- } +- ] +- } + } 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 new file mode 100644 index 000000000000..e19f6b293c7d --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ip_route.ref.diff @@ -0,0 +1,238 @@ +--- rt4/step4/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step5/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -14,14 +14,20 @@ + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16010 ++ ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16010 ++ ] + } + ] + } +@@ -41,14 +47,20 @@ + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -68,21 +80,30 @@ + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16030 ++ ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16030 ++ ] + }, + { + "fib":true, + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 16030 ++ ] + } + ] + } +@@ -102,7 +123,24 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "backupIndex":[ ++ 0 ++ ], ++ "labels":[ ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.7.6", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt6", ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -122,7 +160,24 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "backupIndex":[ ++ 0 ++ ], ++ "labels":[ ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.6.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5", ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -211,6 +266,31 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.7.6", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt6", ++ "active":true ++ }, ++ { ++ "ip":"10.0.2.2", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt2-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.2", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt2-2", + "active":true + } + ] +@@ -231,6 +311,31 @@ + "ip":"10.0.6.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", ++ "active":true, ++ "backupIndex":[ ++ 0, ++ 1, ++ 2 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.7.6", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt6", ++ "active":true ++ }, ++ { ++ "ip":"10.0.2.2", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt2-1", ++ "active":true ++ }, ++ { ++ "ip":"10.0.3.2", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt2-2", + "active":true + } + ] +@@ -246,7 +351,18 @@ + { + "ip":"10.0.6.5", + "afi":"ipv4", +- "interfaceName":"eth-rt5" ++ "interfaceName":"eth-rt5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.7.6", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt6", ++ "active":true + } + ] + } +@@ -261,7 +377,18 @@ + { + "ip":"10.0.7.6", + "afi":"ipv4", +- "interfaceName":"eth-rt6" ++ "interfaceName":"eth-rt6", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "ip":"10.0.6.5", ++ "afi":"ipv4", ++ "interfaceName":"eth-rt5", ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..52891943964b --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_ipv6_route.ref.diff @@ -0,0 +1,128 @@ +--- rt4/step4/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step5/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -13,13 +13,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16011 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16011 ++ ] + } + ] + } +@@ -38,13 +44,19 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -63,19 +75,28 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", +- "active":true ++ "active":true, ++ "labels":[ ++ 16031 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 16031 ++ ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", +- "active":true ++ "active":true, ++ "labels":[ ++ 16031 ++ ] + } + ] + } +@@ -94,7 +115,23 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "backupIndex":[ ++ 0 ++ ], ++ "labels":[ ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt6", ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -113,7 +150,23 @@ + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "backupIndex":[ ++ 0 ++ ], ++ "labels":[ ++ 3 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "afi":"ipv6", ++ "interfaceName":"eth-rt5", ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..8bcd28aa2dab --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step5/show_mpls_table.ref.diff @@ -0,0 +1,213 @@ +--- rt4/step4/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step5/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -1,2 +1,210 @@ + { ++ "16010":{ ++ "inLabel":16010, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16010, ++ "installed":true, ++ "nexthop":"10.0.3.2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16010, ++ "installed":true, ++ "nexthop":"10.0.2.2" ++ } ++ ] ++ }, ++ "16011":{ ++ "inLabel":16011, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16011, ++ "installed":true, ++ "interface":"eth-rt2-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16011, ++ "installed":true, ++ "interface":"eth-rt2-1" ++ } ++ ] ++ }, ++ "16020":{ ++ "inLabel":16020, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.3.2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.2.2" ++ } ++ ] ++ }, ++ "16021":{ ++ "inLabel":16021, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt2-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt2-1" ++ } ++ ] ++ }, ++ "16030":{ ++ "inLabel":16030, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16030, ++ "installed":true, ++ "nexthop":"10.0.3.2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16030, ++ "installed":true, ++ "nexthop":"10.0.2.2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16030, ++ "installed":true, ++ "nexthop":"10.0.6.5" ++ } ++ ] ++ }, ++ "16031":{ ++ "inLabel":16031, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16031, ++ "installed":true, ++ "interface":"eth-rt2-2" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16031, ++ "installed":true, ++ "interface":"eth-rt2-1" ++ }, ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16031, ++ "installed":true, ++ "interface":"eth-rt5" ++ } ++ ] ++ }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.6.5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.7.6" ++ } ++ ] ++ }, ++ "16051":{ ++ "inLabel":16051, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "interface":"eth-rt6" ++ } ++ ] ++ }, ++ "16060":{ ++ "inLabel":16060, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.7.6", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.6.5" ++ } ++ ] ++ }, ++ "16061":{ ++ "inLabel":16061, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt6", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "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 new file mode 100644 index 000000000000..03f31f727317 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ip_route.ref.diff @@ -0,0 +1,11 @@ +--- rt4/step5/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step6/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -102,7 +102,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16030 ++ 30030 + ] + } + ] 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 new file mode 100644 index 000000000000..43621e117c16 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_ipv6_route.ref.diff @@ -0,0 +1,11 @@ +--- rt4/step5/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step6/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -86,7 +86,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16031 ++ 30031 + ] + }, + { 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 new file mode 100644 index 000000000000..871824bb6a01 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step6/show_mpls_table.ref.diff @@ -0,0 +1,20 @@ +--- rt4/step5/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step6/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -89,7 +89,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":16030, ++ "outLabel":30030, + "installed":true, + "nexthop":"10.0.6.5" + } +@@ -113,7 +113,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":16031, ++ "outLabel":30031, + "installed":true, + "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 new file mode 100644 index 000000000000..1f1de16c0e90 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ip_route.ref.diff @@ -0,0 +1,24 @@ +--- rt4/step6/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step7/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -126,9 +126,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -137,10 +134,7 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..1c2f0f6fef29 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_ipv6_route.ref.diff @@ -0,0 +1,24 @@ +--- rt4/step6/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step7/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -118,9 +118,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -128,10 +125,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..dfe7aef93a93 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step7/show_mpls_table.ref.diff @@ -0,0 +1,53 @@ +--- rt4/step6/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step7/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -119,50 +119,6 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.6.5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "nexthop":"10.0.7.6" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "interface":"eth-rt6" +- } +- ] +- }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..e9445650a777 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ip_route.ref.diff @@ -0,0 +1,24 @@ +--- rt4/step7/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step8/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -126,6 +126,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -134,7 +137,10 @@ + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..0d699ad92e9e --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_ipv6_route.ref.diff @@ -0,0 +1,24 @@ +--- rt4/step7/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step8/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -118,6 +118,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -125,7 +128,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..145d3b1fa1dd --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step8/show_mpls_table.ref.diff @@ -0,0 +1,53 @@ +--- rt4/step7/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step8/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -119,6 +119,50 @@ + } + ] + }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.6.5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.7.6" ++ } ++ ] ++ }, ++ "16051":{ ++ "inLabel":16051, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "interface":"eth-rt6" ++ } ++ ] ++ }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..6ae67bcfbe65 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/step9/show_mpls_table.ref.diff @@ -0,0 +1,102 @@ +--- rt4/step8/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt4/step9/show_mpls_table.ref 2020-08-31 22:42:48.839561398 -0300 +@@ -119,15 +119,15 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, ++ "16060":{ ++ "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.6.5", ++ "nexthop":"10.0.7.6", + "backupIndex":[ + 0 + ] +@@ -137,19 +137,19 @@ + { + "type":"SR (IS-IS)", + "outLabel":3, +- "nexthop":"10.0.7.6" ++ "nexthop":"10.0.6.5" + } + ] + }, +- "16051":{ +- "inLabel":16051, ++ "16061":{ ++ "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-rt5", ++ "interface":"eth-rt6", + "backupIndex":[ + 0 + ] +@@ -159,19 +159,19 @@ + { + "type":"SR (IS-IS)", + "outLabel":3, +- "interface":"eth-rt6" ++ "interface":"eth-rt5" + } + ] + }, +- "16060":{ +- "inLabel":16060, ++ "16500":{ ++ "inLabel":16500, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "nexthop":"10.0.7.6", ++ "nexthop":"10.0.6.5", + "backupIndex":[ + 0 + ] +@@ -181,19 +181,19 @@ + { + "type":"SR (IS-IS)", + "outLabel":3, +- "nexthop":"10.0.6.5" ++ "nexthop":"10.0.7.6" + } + ] + }, +- "16061":{ +- "inLabel":16061, ++ "16501":{ ++ "inLabel":16501, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, +- "interface":"eth-rt6", ++ "interface":"eth-rt5", + "backupIndex":[ + 0 + ] +@@ -203,7 +203,7 @@ + { + "type":"SR (IS-IS)", + "outLabel":3, +- "interface":"eth-rt5" ++ "interface":"eth-rt6" + } + ] + } diff --git a/tests/topotests/isis-tilfa-topo1/rt4/zebra.conf b/tests/topotests/isis-tilfa-topo1/rt4/zebra.conf new file mode 100644 index 000000000000..4945897e9d40 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt4/zebra.conf @@ -0,0 +1,28 @@ +log file zebra.log +! +hostname rt4 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 4.4.4.4/32 + ipv6 address 2001:db8:1000::4/128 +! +interface eth-rt2-1 + ip address 10.0.2.4/24 +! +interface eth-rt2-2 + ip address 10.0.3.4/24 +! +interface eth-rt5 + ip address 10.0.6.4/24 +! +interface eth-rt6 + ip address 10.0.7.4/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-tilfa-topo1/rt5/isisd.conf b/tests/topotests/isis-tilfa-topo1/rt5/isisd.conf new file mode 100644 index 000000000000..be52eb0322dc --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/isisd.conf @@ -0,0 +1,53 @@ +hostname rt5 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis sr-events +debug isis lsp-gen +! +interface lo + ip router isis 1 + ipv6 router isis 1 + isis passive +! +interface eth-rt3-1 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt3-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt4 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt6 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +router isis 1 + net 49.0000.0000.0000.0005.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + segment-routing on + segment-routing global-block 16000 23999 + segment-routing node-msd 8 + segment-routing prefix 5.5.5.5/32 index 50 + segment-routing prefix 2001:db8:1000::5/128 index 51 +! 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 new file mode 100644 index 000000000000..ce320d0b1297 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ip_route.ref @@ -0,0 +1,423 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 16010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 16010 + ] + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "6.6.6.6\/32":[ + { + "prefix":"6.6.6.6\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0, + 1, + 2 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + }, + { + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0, + 1, + 2 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + }, + { + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1" + }, + { + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true + }, + { + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2" + } + ] + } + ], + "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", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.6.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..5bda17760e27 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_ipv6_route.ref @@ -0,0 +1,174 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 16011 + ] + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 3 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::6\/128":[ + { + "prefix":"2001:db8:1000::6\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..84ba09910caf --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_mpls_table.ref @@ -0,0 +1,210 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.4.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.6.4" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt3-1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.6.4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.8.6", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.6.4" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt6", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt4" + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 000000000000..4a3e62612304 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,86 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt3-2", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0003", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt4", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0004", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt6", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0006", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step2/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step2/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step2/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step2/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step2/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step3/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step3/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step3/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step3/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step3/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..f9f01414c9fa --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ip_route.ref.diff @@ -0,0 +1,33 @@ +--- rt5/step3/show_ip_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt5/step4/show_ip_route.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -69,7 +69,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 16020 ++ 3 + ] + } + ] +@@ -126,9 +126,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -137,10 +134,7 @@ + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } 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 new file mode 100644 index 000000000000..3e3c7d8541dd --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_ipv6_route.ref.diff @@ -0,0 +1,33 @@ +--- rt5/step3/show_ipv6_route.ref 2020-08-31 22:42:48.839561398 -0300 ++++ rt5/step4/show_ipv6_route.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -55,7 +55,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 16021 ++ 3 + ] + }, + { +@@ -118,9 +118,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -128,10 +125,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..21c426e678f3 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step4/show_mpls_table.ref.diff @@ -0,0 +1,71 @@ +--- rt5/step3/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt5/step4/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -53,7 +53,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":16020, ++ "outLabel":3, + "installed":true, + "nexthop":"10.0.6.4" + } +@@ -77,7 +77,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":16021, ++ "outLabel":3, + "installed":true, + "interface":"eth-rt4" + } +@@ -119,50 +119,6 @@ + } + ] + }, +- "16040":{ +- "inLabel":16040, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.6.4", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "nexthop":"10.0.8.6" +- } +- ] +- }, +- "16041":{ +- "inLabel":16041, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt4", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "interface":"eth-rt6" +- } +- ] +- }, + "16060":{ + "inLabel":16060, + "installed":true, 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 new file mode 100644 index 000000000000..49253b130f19 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ip_route.ref.diff @@ -0,0 +1,33 @@ +--- rt5/step4/show_ip_route.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt5/step5/show_ip_route.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -69,7 +69,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 3 ++ 16020 + ] + } + ] +@@ -126,6 +126,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -134,7 +137,10 @@ + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..2ee7db9e7e1e --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_ipv6_route.ref.diff @@ -0,0 +1,33 @@ +--- rt5/step4/show_ipv6_route.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt5/step5/show_ipv6_route.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -55,7 +55,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 3 ++ 16021 + ] + }, + { +@@ -118,6 +118,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -125,7 +128,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt6", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..269b8ddc940c --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step5/show_mpls_table.ref.diff @@ -0,0 +1,71 @@ +--- rt5/step4/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt5/step5/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -53,7 +53,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16020, + "installed":true, + "nexthop":"10.0.6.4" + } +@@ -77,7 +77,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } +@@ -119,6 +119,50 @@ + } + ] + }, ++ "16040":{ ++ "inLabel":16040, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.6.4", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.8.6" ++ } ++ ] ++ }, ++ "16041":{ ++ "inLabel":16041, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt4", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "interface":"eth-rt6" ++ } ++ ] ++ }, + "16060":{ + "inLabel":16060, + "installed":true, diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step6/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step6/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step6/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step6/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..f70ac77e6a9c --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/step6/show_mpls_table.ref.diff @@ -0,0 +1,110 @@ +--- rt5/step5/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt5/step6/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 +@@ -1,6 +1,6 @@ + { +- "16010":{ +- "inLabel":16010, ++ "30010":{ ++ "inLabel":30010, + "installed":true, + "nexthops":[ + { +@@ -17,8 +17,8 @@ + } + ] + }, +- "16011":{ +- "inLabel":16011, ++ "30011":{ ++ "inLabel":30011, + "installed":true, + "nexthops":[ + { +@@ -35,8 +35,8 @@ + } + ] + }, +- "16020":{ +- "inLabel":16020, ++ "30020":{ ++ "inLabel":30020, + "installed":true, + "nexthops":[ + { +@@ -59,8 +59,8 @@ + } + ] + }, +- "16021":{ +- "inLabel":16021, ++ "30021":{ ++ "inLabel":30021, + "installed":true, + "nexthops":[ + { +@@ -83,8 +83,8 @@ + } + ] + }, +- "16030":{ +- "inLabel":16030, ++ "30030":{ ++ "inLabel":30030, + "installed":true, + "nexthops":[ + { +@@ -101,8 +101,8 @@ + } + ] + }, +- "16031":{ +- "inLabel":16031, ++ "30031":{ ++ "inLabel":30031, + "installed":true, + "nexthops":[ + { +@@ -119,8 +119,8 @@ + } + ] + }, +- "16040":{ +- "inLabel":16040, ++ "30040":{ ++ "inLabel":30040, + "installed":true, + "nexthops":[ + { +@@ -141,8 +141,8 @@ + } + ] + }, +- "16041":{ +- "inLabel":16041, ++ "30041":{ ++ "inLabel":30041, + "installed":true, + "nexthops":[ + { +@@ -163,8 +163,8 @@ + } + ] + }, +- "16060":{ +- "inLabel":16060, ++ "30060":{ ++ "inLabel":30060, + "installed":true, + "nexthops":[ + { +@@ -185,8 +185,8 @@ + } + ] + }, +- "16061":{ +- "inLabel":16061, ++ "30061":{ ++ "inLabel":30061, + "installed":true, + "nexthops":[ + { diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step7/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step7/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step7/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step7/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step7/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step7/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step8/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step8/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step8/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step8/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step8/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step8/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step9/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step9/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step9/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step9/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/step9/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt5/step9/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt5/zebra.conf b/tests/topotests/isis-tilfa-topo1/rt5/zebra.conf new file mode 100644 index 000000000000..4cfea1a59f86 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt5/zebra.conf @@ -0,0 +1,28 @@ +log file zebra.log +! +hostname rt5 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 5.5.5.5/32 + ipv6 address 2001:db8:1000::5/128 +! +interface eth-rt3-1 + ip address 10.0.4.5/24 +! +interface eth-rt3-2 + ip address 10.0.5.5/24 +! +interface eth-rt4 + ip address 10.0.6.5/24 +! +interface eth-rt6 + ip address 10.0.8.5/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-tilfa-topo1/rt6/isisd.conf b/tests/topotests/isis-tilfa-topo1/rt6/isisd.conf new file mode 100644 index 000000000000..db47622a1027 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/isisd.conf @@ -0,0 +1,39 @@ +hostname rt6 +log file isisd.log +! +debug isis events +debug isis route-events +debug isis spf-events +debug isis sr-events +debug isis lsp-gen +! +interface lo + ip router isis 1 + ipv6 router isis 1 + isis passive +! +interface eth-rt4 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +interface eth-rt5 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 + isis fast-reroute ti-lfa +! +router isis 1 + net 49.0000.0000.0000.0006.00 + is-type level-1 + lsp-gen-interval 2 + topology ipv6-unicast + segment-routing on + segment-routing global-block 16000 23999 + segment-routing node-msd 8 + segment-routing prefix 6.6.6.6/32 index 60 + segment-routing prefix 2001:db8:1000::6/128 index 61 +! 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 new file mode 100644 index 000000000000..c9615d1e458b --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ip_route.ref @@ -0,0 +1,413 @@ +{ + "1.1.1.1\/32":[ + { + "prefix":"1.1.1.1\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 16010 + ] + }, + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16010 + ] + } + ] + } + ], + "2.2.2.2\/32":[ + { + "prefix":"2.2.2.2\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 16020 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "3.3.3.3\/32":[ + { + "prefix":"3.3.3.3\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 16030 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "5.5.5.5\/32":[ + { + "prefix":"5.5.5.5\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "10.0.1.0\/24":[ + { + "prefix":"10.0.1.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "10.0.2.0\/24":[ + { + "prefix":"10.0.2.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "10.0.4.0\/24":[ + { + "prefix":"10.0.4.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "10.0.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..b69c1491ec78 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_ipv6_route.ref @@ -0,0 +1,173 @@ +{ + "2001:db8:1000::1\/128":[ + { + "prefix":"2001:db8:1000::1\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16011 + ] + } + ] + } + ], + "2001:db8:1000::2\/128":[ + { + "prefix":"2001:db8:1000::2\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 16021 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::3\/128":[ + { + "prefix":"2001:db8:1000::3\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 16031 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ], + "2001:db8:1000::5\/128":[ + { + "prefix":"2001:db8:1000::5\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5", + "active":true, + "backupIndex":[ + 0 + ], + "labels":[ + 3 + ] + } + ], + "backupNexthops":[ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true, + "labels":[ + 3 + ] + } + ] + } + ] +} 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 new file mode 100644 index 000000000000..2aa794124a31 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_mpls_table.ref @@ -0,0 +1,214 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.8.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.8.5" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt5" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.7.4" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt4" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.7.4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.8.5" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt4", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt5" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.8.5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "nexthop":"10.0.7.4" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt5", + "backupIndex":[ + 0 + ] + } + ], + "backupNexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "interface":"eth-rt4" + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 000000000000..49c40a471c67 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,46 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0004", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + }, + { + "name": "eth-rt5", + "vrf": "default", + "state": { + "frr-isisd:isis": { + "adjacencies": { + "adjacency": [ + { + "neighbor-sys-type": "level-1", + "neighbor-sysid": "0000.0000.0005", + "neighbor-extended-circuit-id": 0, + "hold-timer": 9, + "neighbor-priority": 0, + "state": "up" + } + ] + } + } + } + } + ] + } +} diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step2/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step2/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step2/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step2/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step2/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step2/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step3/show_ip_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step3/show_ip_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step3/show_ipv6_route.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step3/show_ipv6_route.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/topotests/isis-tilfa-topo1/rt6/step3/show_mpls_table.ref.diff b/tests/topotests/isis-tilfa-topo1/rt6/step3/show_mpls_table.ref.diff new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..7e6810d6d31a --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ip_route.ref.diff @@ -0,0 +1,55 @@ +--- rt6/step3/show_ip_route.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt6/step4/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -16,7 +16,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 16010 ++ 3 + ] + }, + { +@@ -50,9 +50,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 16020 + ] + } + ], +@@ -61,10 +58,7 @@ + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -124,9 +118,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -135,10 +126,7 @@ + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..8c424f60650d --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_ipv6_route.ref.diff @@ -0,0 +1,55 @@ +--- rt6/step3/show_ipv6_route.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt6/step4/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -15,7 +15,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 16011 ++ 3 + ] + }, + { +@@ -47,9 +47,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 16021 + ] + } + ], +@@ -57,10 +54,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 3 +- ] ++ "active":true + } + ] + } +@@ -117,9 +111,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -127,10 +118,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..2ebbab8a2f6e --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step4/show_mpls_table.ref.diff @@ -0,0 +1,117 @@ +--- rt6/step3/show_mpls_table.ref 2020-08-31 22:42:48.843561366 -0300 ++++ rt6/step4/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -11,7 +11,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":16010, ++ "outLabel":3, + "installed":true, + "nexthop":"10.0.7.4" + } +@@ -29,53 +29,9 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":16011, +- "installed":true, +- "interface":"eth-rt4" +- } +- ] +- }, +- "16020":{ +- "inLabel":16020, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16020, +- "installed":true, +- "nexthop":"10.0.7.4", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", + "outLabel":3, +- "nexthop":"10.0.8.5" +- } +- ] +- }, +- "16021":{ +- "inLabel":16021, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":16021, + "installed":true, +- "interface":"eth-rt4", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "interface":"eth-rt5" ++ "interface":"eth-rt4" + } + ] + }, +@@ -123,50 +79,6 @@ + } + ] + }, +- "16040":{ +- "inLabel":16040, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.7.4", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "nexthop":"10.0.8.5" +- } +- ] +- }, +- "16041":{ +- "inLabel":16041, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt4", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "interface":"eth-rt5" +- } +- ] +- }, + "16050":{ + "inLabel":16050, + "installed":true, 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 new file mode 100644 index 000000000000..5151f715809e --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ip_route.ref.diff @@ -0,0 +1,55 @@ +--- rt6/step4/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step5/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -16,7 +16,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 3 ++ 16010 + ] + }, + { +@@ -50,6 +50,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 16020 + ] + } + ], +@@ -58,7 +61,10 @@ + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -118,6 +124,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -126,7 +135,10 @@ + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..2ddc9f82b62c --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_ipv6_route.ref.diff @@ -0,0 +1,55 @@ +--- rt6/step4/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step5/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -15,7 +15,7 @@ + "interfaceName":"eth-rt4", + "active":true, + "labels":[ +- 3 ++ 16011 + ] + }, + { +@@ -47,6 +47,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 16021 + ] + } + ], +@@ -54,7 +57,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } +@@ -111,6 +117,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -118,7 +127,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt5", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..18354ea604f6 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step5/show_mpls_table.ref.diff @@ -0,0 +1,120 @@ +--- rt6/step4/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step5/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -11,7 +11,7 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16010, + "installed":true, + "nexthop":"10.0.7.4" + } +@@ -29,12 +29,56 @@ + }, + { + "type":"SR (IS-IS)", +- "outLabel":3, ++ "outLabel":16011, + "installed":true, + "interface":"eth-rt4" + } + ] + }, ++ "16020":{ ++ "inLabel":16020, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16020, ++ "installed":true, ++ "nexthop":"10.0.7.4", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.8.5" ++ } ++ ] ++ }, ++ "16021":{ ++ "inLabel":16021, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":16021, ++ "installed":true, ++ "interface":"eth-rt4", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "interface":"eth-rt5" ++ } ++ ] ++ }, + "16030":{ + "inLabel":16030, + "installed":true, +@@ -79,6 +123,50 @@ + } + ] + }, ++ "16040":{ ++ "inLabel":16040, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.7.4", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.8.5" ++ } ++ ] ++ }, ++ "16041":{ ++ "inLabel":16041, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt4", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "interface":"eth-rt5" ++ } ++ ] ++ }, + "16050":{ + "inLabel":16050, + "installed":true, 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 new file mode 100644 index 000000000000..cddb6ab4bc1a --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ip_route.ref.diff @@ -0,0 +1,20 @@ +--- rt6/step5/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step6/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -26,7 +26,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16010 ++ 30010 + ] + } + ] +@@ -89,7 +89,7 @@ + 0 + ], + "labels":[ +- 16030 ++ 30030 + ] + } + ], 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 new file mode 100644 index 000000000000..389d87edc9fd --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_ipv6_route.ref.diff @@ -0,0 +1,20 @@ +--- rt6/step5/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step6/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -24,7 +24,7 @@ + "interfaceName":"eth-rt5", + "active":true, + "labels":[ +- 16011 ++ 30011 + ] + } + ] +@@ -84,7 +84,7 @@ + 0 + ], + "labels":[ +- 16031 ++ 30031 + ] + } + ], 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 new file mode 100644 index 000000000000..8d5385dd0c81 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step6/show_mpls_table.ref.diff @@ -0,0 +1,38 @@ +--- rt6/step5/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step6/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -5,7 +5,7 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16010, ++ "outLabel":30010, + "installed":true, + "nexthop":"10.0.8.5" + }, +@@ -23,7 +23,7 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16011, ++ "outLabel":30011, + "installed":true, + "interface":"eth-rt5" + }, +@@ -85,7 +85,7 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16030, ++ "outLabel":30030, + "installed":true, + "nexthop":"10.0.8.5", + "backupIndex":[ +@@ -107,7 +107,7 @@ + "nexthops":[ + { + "type":"SR (IS-IS)", +- "outLabel":16031, ++ "outLabel":30031, + "installed":true, + "interface":"eth-rt5", + "backupIndex":[ 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 new file mode 100644 index 000000000000..e9b88ce90b65 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ip_route.ref.diff @@ -0,0 +1,24 @@ +--- rt6/step6/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step7/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -161,9 +161,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -172,10 +169,7 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..a65d3e8e40d2 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_ipv6_route.ref.diff @@ -0,0 +1,24 @@ +--- rt6/step6/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step7/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -152,9 +152,6 @@ + "active":true, + "backupIndex":[ + 0 +- ], +- "labels":[ +- 3 + ] + } + ], +@@ -162,10 +159,7 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true, +- "labels":[ +- 3 +- ] ++ "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 new file mode 100644 index 000000000000..0d119554c7b6 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step7/show_mpls_table.ref.diff @@ -0,0 +1,52 @@ +--- rt6/step6/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step7/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -166,49 +166,5 @@ + "interface":"eth-rt5" + } + ] +- }, +- "16050":{ +- "inLabel":16050, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "nexthop":"10.0.8.5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "nexthop":"10.0.7.4" +- } +- ] +- }, +- "16051":{ +- "inLabel":16051, +- "installed":true, +- "nexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "installed":true, +- "interface":"eth-rt5", +- "backupIndex":[ +- 0 +- ] +- } +- ], +- "backupNexthops":[ +- { +- "type":"SR (IS-IS)", +- "outLabel":3, +- "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 new file mode 100644 index 000000000000..cb9d758f3249 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ip_route.ref.diff @@ -0,0 +1,24 @@ +--- rt6/step7/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step8/show_ip_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -161,6 +161,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -169,7 +172,10 @@ + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..cac719262de8 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_ipv6_route.ref.diff @@ -0,0 +1,24 @@ +--- rt6/step7/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step8/show_ipv6_route.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -152,6 +152,9 @@ + "active":true, + "backupIndex":[ + 0 ++ ], ++ "labels":[ ++ 3 + ] + } + ], +@@ -159,7 +162,10 @@ + { + "afi":"ipv6", + "interfaceName":"eth-rt4", +- "active":true ++ "active":true, ++ "labels":[ ++ 3 ++ ] + } + ] + } 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 new file mode 100644 index 000000000000..917954b07741 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step8/show_mpls_table.ref.diff @@ -0,0 +1,52 @@ +--- rt6/step7/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step8/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -166,5 +166,49 @@ + "interface":"eth-rt5" + } + ] ++ }, ++ "16050":{ ++ "inLabel":16050, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "nexthop":"10.0.8.5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "nexthop":"10.0.7.4" ++ } ++ ] ++ }, ++ "16051":{ ++ "inLabel":16051, ++ "installed":true, ++ "nexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "installed":true, ++ "interface":"eth-rt5", ++ "backupIndex":[ ++ 0 ++ ] ++ } ++ ], ++ "backupNexthops":[ ++ { ++ "type":"SR (IS-IS)", ++ "outLabel":3, ++ "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 new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..e69de29bb2d1 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 new file mode 100644 index 000000000000..3c9558e56a9d --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/step9/show_mpls_table.ref.diff @@ -0,0 +1,24 @@ +--- rt6/step8/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 ++++ rt6/step9/show_mpls_table.ref 2020-08-31 22:42:48.847561334 -0300 +@@ -167,8 +167,8 @@ + } + ] + }, +- "16050":{ +- "inLabel":16050, ++ "16500":{ ++ "inLabel":16500, + "installed":true, + "nexthops":[ + { +@@ -189,8 +189,8 @@ + } + ] + }, +- "16051":{ +- "inLabel":16051, ++ "16501":{ ++ "inLabel":16501, + "installed":true, + "nexthops":[ + { diff --git a/tests/topotests/isis-tilfa-topo1/rt6/zebra.conf b/tests/topotests/isis-tilfa-topo1/rt6/zebra.conf new file mode 100644 index 000000000000..6084010a9355 --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/rt6/zebra.conf @@ -0,0 +1,22 @@ +log file zebra.log +! +hostname rt6 +! +debug zebra kernel +debug zebra packet +debug zebra mpls +! +interface lo + ip address 6.6.6.6/32 + ipv6 address 2001:db8:1000::6/128 +! +interface eth-rt4 + ip address 10.0.7.6/24 +! +interface eth-rt5 + ip address 10.0.8.6/24 +! +ip forwarding +! +line vty +! diff --git a/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py b/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py new file mode 100755 index 000000000000..6bc097b0e7bd --- /dev/null +++ b/tests/topotests/isis-tilfa-topo1/test_isis_tilfa_topo1.py @@ -0,0 +1,674 @@ +#!/usr/bin/env python + +# +# test_isis_tilfa_topo1.py +# Part of NetDEF Topology Tests +# +# Copyright (c) 2020 by +# Network Device Education Foundation, Inc. ("NetDEF") +# +# Permission to use, copy, modify, and/or distribute this software +# for any purpose with or without fee is hereby granted, provided +# that the above copyright notice and this permission notice appear +# in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# + +""" +test_isis_tilfa_topo1.py: + + +---------+ + | | + | RT1 | + | 1.1.1.1 | + | | + +---------+ + |eth-sw1 + | + | + | + +---------+ | +---------+ + | | | | | + | RT2 |eth-sw1 | eth-sw1| RT3 | + | 2.2.2.2 +----------+----------+ 3.3.3.3 | + | | 10.0.1.0/24 | | + +---------+ +---------+ + eth-rt4-1| |eth-rt4-2 eth-rt5-1| |eth-rt5-2 + | | | | + 10.0.2.0/24| |10.0.3.0/24 10.0.4.0/24| |10.0.5.0/24 + | | | | + eth-rt2-1| |eth-rt2-2 eth-rt3-1| |eth-rt3-2 + +---------+ +---------+ + | | | | + | RT4 | 10.0.6.0/24 | RT5 | + | 4.4.4.4 +---------------------+ 5.5.5.5 | + | |eth-rt5 eth-rt4| | + +---------+ +---------+ + eth-rt6| |eth-rt6 + | | + 10.0.7.0/24| |10.0.8.0/24 + | +---------+ | + | | | | + | | RT6 | | + +----------+ 6.6.6.6 +-----------+ + eth-rt4| |eth-rt5 + +---------+ +""" + +import os +import sys +import pytest +import json +import re +import tempfile +from time import sleep +from functools import partial + +# Save the Current Working Directory to find configuration files. +CWD = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(CWD, '../')) + +# pylint: disable=C0413 +# Import topogen and topotest helpers +from lib import topotest +from lib.topogen import Topogen, TopoRouter, get_topogen +from lib.topolog import logger + +# Required to instantiate the topology builder class. +from mininet.topo import Topo + +# Global multi-dimensional dictionary containing all expected outputs +outputs = {} + +class TemplateTopo(Topo): + "Test topology builder" + def build(self, *_args, **_opts): + "Build function" + tgen = get_topogen(self) + + # + # Define FRR Routers + # + for router in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + tgen.add_router(router) + + # + # Define connections + # + switch = tgen.add_switch('s1') + switch.add_link(tgen.gears['rt1'], nodeif="eth-sw1") + switch.add_link(tgen.gears['rt2'], nodeif="eth-sw1") + switch.add_link(tgen.gears['rt3'], nodeif="eth-sw1") + + switch = tgen.add_switch('s2') + switch.add_link(tgen.gears['rt2'], nodeif="eth-rt4-1") + switch.add_link(tgen.gears['rt4'], nodeif="eth-rt2-1") + + switch = tgen.add_switch('s3') + switch.add_link(tgen.gears['rt2'], nodeif="eth-rt4-2") + switch.add_link(tgen.gears['rt4'], nodeif="eth-rt2-2") + + switch = tgen.add_switch('s4') + switch.add_link(tgen.gears['rt3'], nodeif="eth-rt5-1") + switch.add_link(tgen.gears['rt5'], nodeif="eth-rt3-1") + + switch = tgen.add_switch('s5') + switch.add_link(tgen.gears['rt3'], nodeif="eth-rt5-2") + switch.add_link(tgen.gears['rt5'], nodeif="eth-rt3-2") + + switch = tgen.add_switch('s6') + switch.add_link(tgen.gears['rt4'], nodeif="eth-rt5") + switch.add_link(tgen.gears['rt5'], nodeif="eth-rt4") + + switch = tgen.add_switch('s7') + switch.add_link(tgen.gears['rt4'], nodeif="eth-rt6") + switch.add_link(tgen.gears['rt6'], nodeif="eth-rt4") + + switch = tgen.add_switch('s8') + switch.add_link(tgen.gears['rt5'], nodeif="eth-rt6") + switch.add_link(tgen.gears['rt6'], nodeif="eth-rt5") + + # + # Populate multi-dimensional dictionary containing all expected outputs + # + files = ["show_ip_route.ref", + "show_ipv6_route.ref", + "show_mpls_table.ref", + "show_yang_interface_isis_adjacencies.ref"] + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + outputs[rname] = {} + for step in range(1, 9 + 1): + outputs[rname][step] = {} + for file in files: + if step == 1: + # Get snapshots relative to the expected initial network convergence + filename = '{}/{}/step{}/{}'.format(CWD, rname, step, file) + outputs[rname][step][file] = open(filename).read() + else: + if file == "show_yang_interface_isis_adjacencies.ref": + continue + + # Get diff relative to the previous step + filename = '{}/{}/step{}/{}.diff'.format(CWD, rname, step, file) + + # Create temporary files in order to apply the diff + f_in = tempfile.NamedTemporaryFile() + f_in.write(outputs[rname][step - 1][file]) + f_in.flush() + f_out = tempfile.NamedTemporaryFile() + os.system("patch -s -o %s %s %s" %(f_out.name, f_in.name, filename)) + + # Store the updated snapshot and remove the temporary files + outputs[rname][step][file] = open(f_out.name).read() + f_in.close() + f_out.close() + +def setup_module(mod): + "Sets up the pytest environment" + tgen = Topogen(TemplateTopo, mod.__name__) + tgen.start_topology() + + router_list = tgen.routers() + + # For all registered routers, load the zebra configuration file + for rname, router in router_list.iteritems(): + router.load_config( + TopoRouter.RD_ZEBRA, + os.path.join(CWD, '{}/zebra.conf'.format(rname)) + ) + router.load_config( + TopoRouter.RD_ISIS, + os.path.join(CWD, '{}/isisd.conf'.format(rname)) + ) + + tgen.start_router() + +def teardown_module(mod): + "Teardown the pytest environment" + tgen = get_topogen() + + # This function tears down the whole topology. + tgen.stop_topology() + +def router_compare_json_output(rname, command, reference): + "Compare router JSON output" + + logger.info('Comparing router "%s" "%s" output', rname, command) + + tgen = get_topogen() + expected = json.loads(reference) + + # Run test function until we get an result. Wait at most 60 seconds. + test_func = partial(topotest.router_json_cmp, + tgen.gears[rname], command, expected) + _, diff = topotest.run_and_expect(test_func, None, count=120, wait=0.5) + assertmsg = '"{}" JSON output mismatches the expected result'.format(rname) + assert diff is None, assertmsg + +# +# Step 1 +# +# Test initial network convergence +# +def test_isis_adjacencies_step1(): + logger.info("Test (step 1): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + outputs[rname][1]["show_yang_interface_isis_adjacencies.ref"]) + +def test_rib_ipv4_step1(): + logger.info("Test (step 1): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][1]["show_ip_route.ref"]) + +def test_rib_ipv6_step1(): + logger.info("Test (step 1): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][1]["show_ipv6_route.ref"]) + +def test_mpls_lib_step1(): + logger.info("Test (step 1): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][1]["show_mpls_table.ref"]) + +# +# Step 2 +# +# Action(s): +# -Disable TI-LFA link protection on rt2's eth-sw1 interface +# +# Expected changes: +# -rt2 should uninstall the backup nexthops from destinations reachable over eth-sw1. +# +def test_rib_ipv4_step2(): + logger.info("Test (step 2): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Disabling TI-LFA link protection on rt2\'s eth-sw1 interface') + tgen.net['rt2'].cmd('vtysh -c "conf t" -c "interface eth-sw1" -c "no isis fast-reroute ti-lfa"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][2]["show_ip_route.ref"]) + +def test_rib_ipv6_step2(): + logger.info("Test (step 2): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][2]["show_ipv6_route.ref"]) + +def test_mpls_lib_step2(): + logger.info("Test (step 2): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][2]["show_mpls_table.ref"]) + +# +# Step 3 +# +# Action(s): +# -Enable TI-LFA link protection on rt2's eth-sw1 interface +# +# Expected changes: +# -rt2 should install backup nexthops for destinations reachable over eth-sw1. +# +def test_rib_ipv4_step3(): + logger.info("Test (step 3): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Enabling TI-LFA link protection on rt2\'s eth-sw1 interface') + tgen.net['rt2'].cmd('vtysh -c "conf t" -c "interface eth-sw1" -c "isis fast-reroute ti-lfa"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][3]["show_ip_route.ref"]) + +def test_rib_ipv6_step3(): + logger.info("Test (step 3): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][3]["show_ipv6_route.ref"]) + +def test_mpls_lib_step3(): + logger.info("Test (step 3): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][3]["show_mpls_table.ref"]) + +# +# Step 4 +# +# Action(s): +# -Disable SR on rt4 +# +# Expected changes: +# -rt4 should uninstall all Prefix-SIDs from the network +# -rt4 should uninstall all TI-LFA backup nexthops +# -All routers should uninstall rt4's Prefix-SIDs +# -All routers should uninstall all SR labels for destinations whose nexthop is rt4 +# -All routers should uninstall all TI-LFA backup nexthops that point to rt4 +# -All routers should uninstall all TI-LFA backup nexthops that use rt4's Prefix-SIDs +# +def test_rib_ipv4_step4(): + logger.info("Test (step 4): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Disabling SR on rt4') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no segment-routing on"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][4]["show_ip_route.ref"]) + +def test_rib_ipv6_step4(): + logger.info("Test (step 4): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][4]["show_ipv6_route.ref"]) + +def test_mpls_lib_step4(): + logger.info("Test (step 4): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][4]["show_mpls_table.ref"]) + +# +# Step 5 +# +# Action(s): +# -Enable SR on rt4 +# +# Expected changes: +# -Reverse all changes done on the previous step +# +def test_rib_ipv4_step5(): + logger.info("Test (step 5): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Enabling SR on rt4') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing on"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][5]["show_ip_route.ref"]) + +def test_rib_ipv6_step5(): + logger.info("Test (step 5): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][5]["show_ipv6_route.ref"]) + +def test_mpls_lib_step5(): + logger.info("Test (step 5): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][5]["show_mpls_table.ref"]) + +# +# Step 6 +# +# Action(s): +# -Change rt5's SRGB +# +# Expected changes: +# -All routers should update all SR labels for destinations whose primary or backup nexthop is rt5 +# +def test_rib_ipv4_step6(): + logger.info("Test (step 6): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Changing rt5\'s SRGB') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing global-block 30000 37999"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][6]["show_ip_route.ref"]) + +def test_rib_ipv6_step6(): + logger.info("Test (step 6): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][6]["show_ipv6_route.ref"]) + +def test_mpls_lib_step6(): + logger.info("Test (step 6): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][6]["show_mpls_table.ref"]) + +# +# Step 7 +# +# Action(s): +# -Delete rt5's Prefix-SIDs +# +# Expected changes: +# -All routers should uninstall rt5's Prefix-SIDs +# -All routers should uninstall all TI-LFA backup nexthops that use rt5's Prefix-SIDs +# +def test_rib_ipv4_step7(): + logger.info("Test (step 7): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Deleting rt5\'s Prefix-SIDs') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no segment-routing prefix 5.5.5.5/32 index 50"') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no segment-routing prefix 2001:db8:1000::5/128 index 51"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][7]["show_ip_route.ref"]) + +def test_rib_ipv6_step7(): + logger.info("Test (step 7): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][7]["show_ipv6_route.ref"]) + +def test_mpls_lib_step7(): + logger.info("Test (step 7): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][7]["show_mpls_table.ref"]) + +# +# Step 8 +# +# Action(s): +# -Re-add rt5's Prefix-SIDs +# +# Expected changes: +# -Reverse all changes done on the previous step +# +def test_rib_ipv4_step8(): + logger.info("Test (step 8): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Re-adding rt5\'s Prefix-SIDs') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 5.5.5.5/32 index 50"') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::5/128 index 51"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][8]["show_ip_route.ref"]) + +def test_rib_ipv6_step8(): + logger.info("Test (step 8): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][8]["show_ipv6_route.ref"]) + +def test_mpls_lib_step8(): + logger.info("Test (step 8): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][8]["show_mpls_table.ref"]) + +# +# Step 9 +# +# Action(s): +# -Change rt5's Prefix-SIDs +# +# Expected changes: +# -All routers should update rt5's Prefix-SIDs +# -All routers should update all TI-LFA backup nexthops that use rt5's Prefix-SIDs +# +def test_rib_ipv4_step9(): + logger.info("Test (step 9): verify IPv4 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Re-adding rt5\'s Prefix-SIDs') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 5.5.5.5/32 index 500"') + tgen.net['rt5'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::5/128 index 501"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + outputs[rname][9]["show_ip_route.ref"]) + +def test_rib_ipv6_step9(): + logger.info("Test (step 9): verify IPv6 RIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ipv6 route isis json", + outputs[rname][9]["show_ipv6_route.ref"]) + +def test_mpls_lib_step9(): + logger.info("Test (step 9): verify MPLS LIB") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show mpls table json", + outputs[rname][9]["show_mpls_table.ref"]) + +# Memory leak test template +def test_memory_leak(): + "Run the memory leak test and report results." + tgen = get_topogen() + if not tgen.is_memleak_enabled(): + pytest.skip('Memory leak test/report is disabled') + + tgen.report_memory_leaks() + +if __name__ == '__main__': + args = ["-s"] + sys.argv[1:] + sys.exit(pytest.main(args)) diff --git a/yang/frr-isisd.yang b/yang/frr-isisd.yang index 79941a50e7d1..06d1a793b5a9 100644 --- a/yang/frr-isisd.yang +++ b/yang/frr-isisd.yang @@ -336,6 +336,26 @@ module frr-isisd { } } + grouping interface-config-ti-lfa { + container ti-lfa { + description + "TI-LFA configuration."; + leaf enable { + type boolean; + default false; + description + "Enables TI-LFA computation."; + } + leaf node-protection { + type boolean; + must ". = 'false' or ../enable = 'true'"; + default false; + description + "Node protection is provided by the alternate."; + } + } + } + grouping interface-config { description "Interface configuration grouping"; @@ -638,6 +658,20 @@ module frr-isisd { } } + container fast-reroute { + description + "Interface IP Fast-reroute configuration."; + container level-1 { + description + "Level-1 IP Fast-reroute configuration."; + uses interface-config-ti-lfa; + } + container level-2 { + description + "Level-2 IP Fast-reroute configuration."; + uses interface-config-ti-lfa; + } + } } grouping adjacency-state {