From 0b7005375f37efe712820b283bc8677fc93ab57b Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 7 Aug 2019 20:00:58 -0300 Subject: [PATCH 01/18] lib: constify a few parameters of helper functions Parameters should be const whenever possible to improve code readability and remove the need to cast away the constness of const arguments. Signed-off-by: Renato Westphal --- lib/if.c | 13 +++++++------ lib/if.h | 12 ++++++------ lib/prefix.h | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/if.c b/lib/if.c index ff95cd9043..5c0f5e61aa 100644 --- a/lib/if.c +++ b/lib/if.c @@ -410,7 +410,7 @@ struct interface *if_lookup_by_index_all_vrf(ifindex_t ifindex) } /* Lookup interface by IP address. */ -struct interface *if_lookup_exact_address(void *src, int family, +struct interface *if_lookup_exact_address(const void *src, int family, vrf_id_t vrf_id) { struct vrf *vrf = vrf_lookup_by_id(vrf_id); @@ -442,7 +442,7 @@ struct interface *if_lookup_exact_address(void *src, int family, } /* Lookup interface by IP address. */ -struct connected *if_lookup_address(void *matchaddr, int family, +struct connected *if_lookup_address(const void *matchaddr, int family, vrf_id_t vrf_id) { struct vrf *vrf = vrf_lookup_by_id(vrf_id); @@ -479,7 +479,7 @@ struct connected *if_lookup_address(void *matchaddr, int family, } /* Lookup interface by prefix */ -struct interface *if_lookup_prefix(struct prefix *prefix, vrf_id_t vrf_id) +struct interface *if_lookup_prefix(const struct prefix *prefix, vrf_id_t vrf_id) { struct vrf *vrf = vrf_lookup_by_id(vrf_id); struct listnode *cnode; @@ -982,7 +982,8 @@ nbr_connected_log(struct nbr_connected *connected, char *str) } /* If two connected address has same prefix return 1. */ -static int connected_same_prefix(struct prefix *p1, struct prefix *p2) +static int connected_same_prefix(const struct prefix *p1, + const struct prefix *p2) { if (p1->family == p2->family) { if (p1->family == AF_INET @@ -1010,7 +1011,7 @@ unsigned int connected_count_by_family(struct interface *ifp, int family) } struct connected *connected_lookup_prefix_exact(struct interface *ifp, - struct prefix *p) + const struct prefix *p) { struct listnode *node; struct listnode *next; @@ -1049,7 +1050,7 @@ struct connected *connected_delete_by_prefix(struct interface *ifp, /* Find the address on our side that will be used when packets are sent to dst. */ struct connected *connected_lookup_prefix(struct interface *ifp, - struct prefix *addr) + const struct prefix *addr) { struct listnode *cnode; struct connected *c; diff --git a/lib/if.h b/lib/if.h index ac8d8e70ba..6a36806566 100644 --- a/lib/if.h +++ b/lib/if.h @@ -512,11 +512,11 @@ extern struct interface *if_create_name(const char *name, vrf_id_t vrf_id); extern struct interface *if_create_ifindex(ifindex_t ifindex, vrf_id_t vrf_id); extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id); extern struct interface *if_lookup_by_index_all_vrf(ifindex_t); -extern struct interface *if_lookup_exact_address(void *matchaddr, int family, - vrf_id_t vrf_id); -extern struct connected *if_lookup_address(void *matchaddr, int family, +extern struct interface *if_lookup_exact_address(const void *matchaddr, + int family, vrf_id_t vrf_id); +extern struct connected *if_lookup_address(const void *matchaddr, int family, vrf_id_t vrf_id); -extern struct interface *if_lookup_prefix(struct prefix *prefix, +extern struct interface *if_lookup_prefix(const struct prefix *prefix, vrf_id_t vrf_id); size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz, struct interface ***result, vrf_id_t vrf_id); @@ -575,9 +575,9 @@ connected_add_by_prefix(struct interface *, struct prefix *, struct prefix *); extern struct connected *connected_delete_by_prefix(struct interface *, struct prefix *); extern struct connected *connected_lookup_prefix(struct interface *, - struct prefix *); + const struct prefix *); extern struct connected *connected_lookup_prefix_exact(struct interface *, - struct prefix *); + const struct prefix *); extern unsigned int connected_count_by_family(struct interface *, int family); extern struct nbr_connected *nbr_connected_new(void); extern void nbr_connected_free(struct nbr_connected *); diff --git a/lib/prefix.h b/lib/prefix.h index f2952c38c3..4b2d90d63a 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -522,7 +522,7 @@ static inline int is_default_prefix(const struct prefix *p) return 0; } -static inline int is_host_route(struct prefix *p) +static inline int is_host_route(const struct prefix *p) { if (p->family == AF_INET) return (p->prefixlen == IPV4_MAX_BITLEN); From 3056368301733d2e8f956a87a19602783ee33602 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 7 Aug 2019 19:54:00 -0300 Subject: [PATCH 02/18] isisd: introduce new adjacency hooks The 'isis_adj_ip_enabled_hook' hook will be called whenever an adjacency goes from zero to one or more IPv4 or IPv6 addresses. Conversely, the 'isis_adj_ip_disabled_hook' hook will be called whenever an adjacency goes from one or more IPv4/IPv6 addresses to no addresses at all. These hooks will be used by the upcoming SR code to add/delete Adj-SIDs depending on the IP addresses present in the remote adjacencies. Signed-off-by: Renato Westphal --- isisd/isis_adjacency.h | 4 ++++ isisd/isis_tlvs.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/isisd/isis_adjacency.h b/isisd/isis_adjacency.h index 8f3d63c297..834eba7925 100644 --- a/isisd/isis_adjacency.h +++ b/isisd/isis_adjacency.h @@ -118,6 +118,10 @@ void isis_adj_process_threeway(struct isis_adjacency *adj, struct isis_threeway_adj *tw_adj, enum isis_adj_usage adj_usage); DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj)) +DECLARE_HOOK(isis_adj_ip_enabled_hook, + (struct isis_adjacency *adj, int family), (adj, family)) +DECLARE_HOOK(isis_adj_ip_disabled_hook, + (struct isis_adjacency *adj, int family), (adj, family)) void isis_adj_state_change(struct isis_adjacency **adj, enum isis_adj_state state, const char *reason); void isis_adj_print(struct isis_adjacency *adj); diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 5b0b709206..761005d0cd 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -4413,10 +4413,22 @@ static void tlvs_protocols_supported_to_adj(struct isis_tlvs *tlvs, memcpy(adj->nlpids.nlpids, reduced.nlpids, reduced.count); } +DEFINE_HOOK(isis_adj_ip_enabled_hook, (struct isis_adjacency *adj, int family), + (adj, family)) +DEFINE_HOOK(isis_adj_ip_disabled_hook, + (struct isis_adjacency *adj, int family), (adj, family)) + static void tlvs_ipv4_addresses_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj, bool *changed) { + bool ipv4_enabled = false; + + if (adj->ipv4_address_count == 0 && tlvs->ipv4_address.count > 0) + ipv4_enabled = true; + else if (adj->ipv4_address_count > 0 && tlvs->ipv4_address.count == 0) + hook_call(isis_adj_ip_disabled_hook, adj, AF_INET); + if (adj->ipv4_address_count != tlvs->ipv4_address.count) { *changed = true; adj->ipv4_address_count = tlvs->ipv4_address.count; @@ -4440,12 +4452,22 @@ static void tlvs_ipv4_addresses_to_adj(struct isis_tlvs *tlvs, *changed = true; adj->ipv4_addresses[i] = addr->addr; } + + if (ipv4_enabled) + hook_call(isis_adj_ip_enabled_hook, adj, AF_INET); } static void tlvs_ipv6_addresses_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj, bool *changed) { + bool ipv6_enabled = false; + + if (adj->ipv6_address_count == 0 && tlvs->ipv6_address.count > 0) + ipv6_enabled = true; + else if (adj->ipv6_address_count > 0 && tlvs->ipv6_address.count == 0) + hook_call(isis_adj_ip_disabled_hook, adj, AF_INET6); + if (adj->ipv6_address_count != tlvs->ipv6_address.count) { *changed = true; adj->ipv6_address_count = tlvs->ipv6_address.count; @@ -4469,6 +4491,9 @@ static void tlvs_ipv6_addresses_to_adj(struct isis_tlvs *tlvs, *changed = true; adj->ipv6_addresses[i] = addr->addr; } + + if (ipv6_enabled) + hook_call(isis_adj_ip_enabled_hook, adj, AF_INET6); } void isis_tlvs_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj, From 9cd06cd7b9ee0a966d7ae9a7d23385a2d287845d Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Sat, 10 Aug 2019 17:57:43 -0300 Subject: [PATCH 03/18] isisd: split vty_out_timestr() into two helper functions The new log_uptime() function logs an UNIX timestamp to a buffer provided by the user. It's very flexibile and can be used in a variety of contexts, different from vty_out_timestr() which is too tied to the VTY code. Signed-off-by: Renato Westphal --- isisd/isis_misc.c | 20 ++++++++++++++++++++ isisd/isis_misc.h | 1 + 2 files changed, 21 insertions(+) diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c index 25f7f8609b..27d06e8da7 100644 --- a/isisd/isis_misc.c +++ b/isisd/isis_misc.c @@ -538,6 +538,26 @@ void log_multiline(int priority, const char *prefix, const char *format, ...) XFREE(MTYPE_TMP, p); } +char *log_uptime(time_t uptime, char *buf, size_t nbuf) +{ + struct tm *tm; + time_t difftime = time(NULL); + difftime -= uptime; + tm = gmtime(&difftime); + + if (difftime < ONE_DAY_SECOND) + snprintf(buf, nbuf, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, + tm->tm_sec); + else if (difftime < ONE_WEEK_SECOND) + snprintf(buf, nbuf, "%dd%02dh%02dm", tm->tm_yday, tm->tm_hour, + tm->tm_min); + else + snprintf(buf, nbuf, "%02dw%dd%02dh", tm->tm_yday / 7, + tm->tm_yday - ((tm->tm_yday / 7) * 7), tm->tm_hour); + + return buf; +} + void vty_multiline(struct vty *vty, const char *prefix, const char *format, ...) { char shortbuf[256]; diff --git a/isisd/isis_misc.h b/isisd/isis_misc.h index fbfabaf24f..5cdbbfb058 100644 --- a/isisd/isis_misc.h +++ b/isisd/isis_misc.h @@ -80,6 +80,7 @@ enum { ISIS_UI_LEVEL_BRIEF, #include "lib/log.h" void log_multiline(int priority, const char *prefix, const char *format, ...) PRINTFRR(3, 4); +char *log_uptime(time_t uptime, char *buf, size_t nbuf); struct vty; void vty_multiline(struct vty *vty, const char *prefix, const char *format, ...) PRINTFRR(3, 4); From 885e241337e2975b7318f316bb690ad8267ea70c Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 6 Sep 2019 00:57:14 -0300 Subject: [PATCH 04/18] isisd: remove refcount from the isis_nexthop structure isisd implements an optimization that allows multiple routes to share the same nexthop (using a refcount) in order to save memory. Now that SR support is coming, however, it will be necessary to embed additional SR-related information inside the isis_nexthop structure. But this can only be done if the nexthops aren't shared among routes anymore. Removing this memory optimization should have minimal impact since the isis_nexthop structure is really small. On large networks with thousands of routes, the memory saving would be in the order of a few kilobytes. Not something we should be concerned about nowadays. Signed-off-by: Renato Westphal --- isisd/isis_route.c | 16 +--------------- isisd/isis_route.h | 1 - isisd/isisd.c | 1 - isisd/isisd.h | 1 - 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/isisd/isis_route.c b/isisd/isis_route.c index 05394e0fe4..516e3f90b9 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -65,32 +65,18 @@ static struct isis_nexthop *isis_nexthop_create(int family, union g_addr *ip, { struct isis_nexthop *nexthop; - nexthop = nexthoplookup(isis->nexthops, family, ip, ifindex); - if (nexthop) { - nexthop->lock++; - return nexthop; - } - nexthop = XCALLOC(MTYPE_ISIS_NEXTHOP, sizeof(struct isis_nexthop)); nexthop->family = family; nexthop->ifindex = ifindex; nexthop->ip = *ip; - listnode_add(isis->nexthops, nexthop); - nexthop->lock++; return nexthop; } static void isis_nexthop_delete(struct isis_nexthop *nexthop) { - nexthop->lock--; - if (nexthop->lock == 0) { - listnode_delete(isis->nexthops, nexthop); - XFREE(MTYPE_ISIS_NEXTHOP, nexthop); - } - - return; + XFREE(MTYPE_ISIS_NEXTHOP, nexthop); } static struct isis_nexthop *nexthoplookup(struct list *nexthops, int family, diff --git a/isisd/isis_route.h b/isisd/isis_route.h index 2326bb8228..96bcdc3508 100644 --- a/isisd/isis_route.h +++ b/isisd/isis_route.h @@ -31,7 +31,6 @@ struct isis_nexthop { ifindex_t ifindex; int family; union g_addr ip; - unsigned int lock; }; struct isis_route_info { diff --git a/isisd/isisd.c b/isisd/isisd.c index 298629e246..2a8c503ae0 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -88,7 +88,6 @@ void isis_new(unsigned long process_id, vrf_id_t vrf_id) isis->area_list = list_new(); isis->init_circ_list = list_new(); isis->uptime = time(NULL); - isis->nexthops = list_new(); dyn_cache_init(); /* * uncomment the next line for full debugs diff --git a/isisd/isisd.h b/isisd/isisd.h index 052cc10928..53776b2ec6 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -69,7 +69,6 @@ struct isis { uint32_t router_id; /* Router ID from zebra */ struct list *area_list; /* list of IS-IS areas */ struct list *init_circ_list; - struct list *nexthops; /* IP next hops from this IS */ uint8_t max_area_addrs; /* maximumAreaAdresses */ struct area_addr *man_area_addrs; /* manualAreaAddresses */ uint32_t debugs; /* bitmap for debug */ From 7e405d3b19152838dd6e8f03e4ba288940f3b9d5 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 7 Aug 2019 13:35:07 -0300 Subject: [PATCH 05/18] isisd: add segment-routing YANG nodes and skeleton callbacks Most definitions were borrowed from the IETF IS-IS SR YANG module, with a few adaptations. Of particular notice are the following: * No support for the configuration of multiple SRGBs. * No distinction between local and connected Prefix-SIDs, both are configured the same way. Signed-off-by: Renato Westphal --- isisd/isis_nb.c | 50 +++++++++++ isisd/isis_nb.h | 22 +++++ isisd/isis_nb_config.c | 185 +++++++++++++++++++++++++++++++++++++++++ yang/frr-isisd.yang | 101 ++++++++++++++++++++++ 4 files changed, 358 insertions(+) diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index da4322bd44..bdfa71091e 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -454,6 +454,56 @@ const struct frr_yang_module_info frr_isisd_info = { .modify = isis_instance_mpls_te_router_address_modify, }, }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/enabled", + .cbs = { + .modify = isis_instance_segment_routing_enabled_modify, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/srgb/lower-bound", + .cbs = { + .modify = isis_instance_segment_routing_srgb_lower_bound_modify, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/srgb/upper-bound", + .cbs = { + .modify = isis_instance_segment_routing_srgb_upper_bound_modify, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/msd/node-msd", + .cbs = { + .modify = isis_instance_segment_routing_msd_node_msd_modify, + .destroy = isis_instance_segment_routing_msd_node_msd_destroy, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid", + .cbs = { + .create = isis_instance_segment_routing_prefix_sid_map_prefix_sid_create, + .destroy = isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value-type", + .cbs = { + .modify = isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value", + .cbs = { + .modify = isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/last-hop-behavior", + .cbs = { + .modify = isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify, + }, + }, { .xpath = "/frr-interface:lib/interface/frr-isisd:isis", .cbs = { diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index 65aa95cd69..43ee361ca8 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -172,6 +172,28 @@ int lib_interface_isis_ipv4_routing_modify(struct nb_cb_modify_args *args); int lib_interface_isis_ipv6_routing_modify(struct nb_cb_modify_args *args); int lib_interface_isis_circuit_type_modify(struct nb_cb_modify_args *args); int lib_interface_isis_bfd_monitoring_modify(struct nb_cb_modify_args *args); +int isis_instance_segment_routing_enabled_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_enabled_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_srgb_lower_bound_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_srgb_upper_bound_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_msd_node_msd_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_msd_node_msd_destroy( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify( + struct nb_cb_modify_args *args); +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify( + struct nb_cb_modify_args *args); int lib_interface_isis_csnp_interval_level_1_modify( struct nb_cb_modify_args *args); int lib_interface_isis_csnp_interval_level_2_modify( diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index 2f56fac186..f97202c9a8 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -1402,6 +1402,191 @@ int isis_instance_mpls_te_router_address_destroy( return NB_OK; } +/* + * XPath: /frr-isisd:isis/instance/segment-routing/enabled + */ +int isis_instance_segment_routing_enabled_modify(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/srgb/lower-bound + */ +int isis_instance_segment_routing_srgb_lower_bound_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/srgb/upper-bound + */ +int isis_instance_segment_routing_srgb_upper_bound_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/msd/node-msd + */ +int isis_instance_segment_routing_msd_node_msd_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +int isis_instance_segment_routing_msd_node_msd_destroy( + enum nb_event event, const struct lyd_node *dnode) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid + */ +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy( + enum nb_event event, const struct lyd_node *dnode) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: + * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value-type + */ +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: + * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value + */ +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + +/* + * XPath: + * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/last-hop-behavior + */ +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + switch (event) { + case NB_EV_VALIDATE: + case NB_EV_PREPARE: + case NB_EV_ABORT: + case NB_EV_APPLY: + /* TODO: implement me. */ + break; + } + + return NB_OK; +} + /* * XPath: /frr-interface:lib/interface/frr-isisd:isis */ diff --git a/yang/frr-isisd.yang b/yang/frr-isisd.yang index 57f81892e0..fc0110c24a 100644 --- a/yang/frr-isisd.yang +++ b/yang/frr-isisd.yang @@ -1161,6 +1161,107 @@ module frr-isisd { "Stable IP address of the advertising router."; } } + + container segment-routing { + description + "Segment Routing global configuration."; + leaf enabled { + type boolean; + default "false"; + description + "Enables segment-routing protocol extensions."; + } + container srgb { + description + "Global blocks to be advertised."; + must "./upper-bound > ./lower-bound"; + leaf lower-bound { + type uint32; + default "16000"; + description + "Lower value in the label range."; + } + leaf upper-bound { + type uint32; + default "23999"; + description + "Upper value in the label range."; + } + } + container msd { + description + "MSD configuration."; + leaf node-msd { + type uint8; + description + "Node MSD is the lowest MSD supported by the node."; + } + } + container prefix-sid-map { + description + "Prefix SID configuration."; + list prefix-sid { + key "prefix"; + unique "sid-value-type sid-value"; + description + "List of prefix SID mapped to IPv4/IPv6 + local prefixes."; + leaf prefix { + type inet:ip-prefix; + description + "Connected prefix sid."; + } + leaf sid-value-type { + type enumeration { + enum "index" { + value 0; + description + "The value will be interpreted as an index."; + } + enum "absolute" { + value 1; + description + "The value will become interpreted as an absolute + value."; + } + } + default "index"; + description + "This leaf defines how value must be interpreted."; + } + leaf sid-value { + type uint32; + mandatory true; + description + "Value associated with prefix. The value must be + interpreted in the context of sid-value-type."; + } + leaf last-hop-behavior { + type enumeration { + enum "explicit-null" { + value 0; + description + "Use explicit-null for the SID."; + } + enum "no-php" { + value 1; + description + "Do not use Penultimate Hop Popping (PHP) + for the SID."; + } + enum "php" { + value 2; + description + "Use PHP for the SID."; + } + } + default "php"; + description + "Configure last hop behavior."; + } + } + } + } } } From 8f6c893629f609c2313150ef9ceaecd8125a3357 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 7 Aug 2019 13:37:00 -0300 Subject: [PATCH 06/18] isisd: add segment-routing CLI commands In the name of consistency, these commands are very similar to the ospfd SR configuration commands. Signed-off-by: Renato Westphal --- isisd/isis_cli.c | 218 +++++++++++++++++++++++++++++++++++++++++++++++ isisd/isis_nb.c | 9 ++ isisd/isis_nb.h | 8 ++ 3 files changed, 235 insertions(+) diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index c12c7fa936..0101e30ad3 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -1355,6 +1355,215 @@ void cli_show_isis_mt_ipv6_dstsrc(struct vty *vty, struct lyd_node *dnode, vty_out(vty, "\n"); } +/* + * XPath: /frr-isisd:isis/instance/segment-routing/enabled + */ +DEFPY (isis_sr_enable, + isis_sr_enable_cmd, + "segment-routing on", + SR_STR + "Enable Segment Routing\n") +{ + nb_cli_enqueue_change(vty, "./segment-routing/enabled", NB_OP_MODIFY, + "true"); + + return nb_cli_apply_changes(vty, NULL); +} + +DEFPY (no_isis_sr_enable, + no_isis_sr_enable_cmd, + "no segment-routing [on]", + NO_STR + SR_STR + "Disable Segment Routing\n") +{ + nb_cli_enqueue_change(vty, "./segment-routing/enabled", NB_OP_MODIFY, + "false"); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_isis_sr_enabled(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + if (!yang_dnode_get_bool(dnode, NULL)) + vty_out(vty, " no"); + + vty_out(vty, " segment-routing on\n"); +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/srgb + */ +DEFPY (isis_sr_global_block_label_range, + isis_sr_global_block_label_range_cmd, + "segment-routing global-block (16-1048575)$lower_bound (16-1048575)$upper_bound", + SR_STR + "Segment Routing Global Block label range\n" + "The lower bound of SRGB (16-1048575)\n" + "The upper bound of SRGB (16-1048575)\n") +{ + nb_cli_enqueue_change(vty, "./segment-routing/srgb/lower-bound", + NB_OP_MODIFY, lower_bound_str); + nb_cli_enqueue_change(vty, "./segment-routing/srgb/upper-bound", + NB_OP_MODIFY, upper_bound_str); + + return nb_cli_apply_changes(vty, NULL); +} + +DEFPY (no_isis_sr_global_block_label_range, + no_isis_sr_global_block_label_range_cmd, + "no segment-routing global-block [(0-1048575) (0-1048575)]", + NO_STR + SR_STR + "Segment Routing Global Block label range\n" + "The lower bound of SRGB (16-1048575)\n" + "The upper bound of SRGB (block size may not exceed 65535)\n") +{ + nb_cli_enqueue_change(vty, "./segment-routing/srgb/lower-bound", + NB_OP_MODIFY, NULL); + nb_cli_enqueue_change(vty, "./segment-routing/srgb/upper-bound", + NB_OP_MODIFY, NULL); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_isis_srgb(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + vty_out(vty, " segment-routing global-block %s %s\n", + yang_dnode_get_string(dnode, "./lower-bound"), + yang_dnode_get_string(dnode, "./upper-bound")); +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/msd/node-msd + */ +DEFPY (isis_sr_node_msd, + isis_sr_node_msd_cmd, + "segment-routing node-msd (1-16)$msd", + SR_STR + "Maximum Stack Depth for this router\n" + "Maximum number of label that can be stack (1-16)\n") +{ + nb_cli_enqueue_change(vty, "./segment-routing/msd/node-msd", + NB_OP_MODIFY, msd_str); + + return nb_cli_apply_changes(vty, NULL); +} + +DEFPY (no_isis_sr_node_msd, + no_isis_sr_node_msd_cmd, + "no segment-routing node-msd [(1-16)]", + NO_STR + SR_STR + "Maximum Stack Depth for this router\n" + "Maximum number of label that can be stack (1-16)\n") +{ + nb_cli_enqueue_change(vty, "./segment-routing/msd/node-msd", + NB_OP_DESTROY, NULL); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_isis_node_msd(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + vty_out(vty, " segment-routing node-msd %s\n", + yang_dnode_get_string(dnode, NULL)); +} + +/* + * XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid + */ +DEFPY (isis_sr_prefix_sid, + isis_sr_prefix_sid_cmd, + "segment-routing prefix\ + $prefix\ + \ + [$lh_behavior]", + SR_STR + "Prefix SID\n" + "IPv4 Prefix\n" + "IPv6 Prefix\n" + "Specify the absolute value of Prefix Segement ID\n" + "The Prefix Segment ID value\n" + "Specify the index of Prefix Segement ID\n" + "The Prefix Segment ID index\n" + "Don't request Penultimate Hop Popping (PHP)\n" + "Upstream neighbor must replace prefix-sid with explicit null label\n") +{ + nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); + nb_cli_enqueue_change(vty, "./sid-value-type", NB_OP_MODIFY, sid_type); + nb_cli_enqueue_change(vty, "./sid-value", NB_OP_MODIFY, sid_value_str); + if (lh_behavior) { + const char *value; + + if (strmatch(lh_behavior, "no-php-flag")) + value = "no-php"; + else + value = "explicit-null"; + + nb_cli_enqueue_change(vty, "./last-hop-behavior", NB_OP_MODIFY, + value); + } else + nb_cli_enqueue_change(vty, "./last-hop-behavior", NB_OP_MODIFY, + NULL); + + return nb_cli_apply_changes( + vty, "./segment-routing/prefix-sid-map/prefix-sid[prefix='%s']", + prefix_str); +} + +DEFPY (no_isis_sr_prefix_sid, + no_isis_sr_prefix_sid_cmd, + "no segment-routing prefix $prefix\ + [ []]", + NO_STR + SR_STR + "Prefix SID\n" + "IPv4 Prefix\n" + "IPv6 Prefix\n" + "Specify the absolute value of Prefix Segement ID\n" + "The Prefix Segment ID value\n" + "Specify the index of Prefix Segement ID\n" + "The Prefix Segment ID index\n" + "Don't request Penultimate Hop Popping (PHP)\n" + "Upstream neighbor must replace prefix-sid with explicit null label\n") +{ + nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); + + return nb_cli_apply_changes( + vty, "./segment-routing/prefix-sid-map/prefix-sid[prefix='%s']", + prefix_str); +} + +void cli_show_isis_prefix_sid(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + const char *prefix; + const char *lh_behavior; + const char *sid_value_type; + const char *sid_value; + + prefix = yang_dnode_get_string(dnode, "./prefix"); + lh_behavior = yang_dnode_get_string(dnode, "./last-hop-behavior"); + sid_value_type = yang_dnode_get_string(dnode, "./sid-value-type"); + sid_value = yang_dnode_get_string(dnode, "./sid-value"); + + vty_out(vty, " segment-routing prefix %s", prefix); + if (strmatch(sid_value_type, "absolute")) + vty_out(vty, " absolute"); + else + vty_out(vty, " index"); + vty_out(vty, " %s", sid_value); + if (strmatch(lh_behavior, "no-php")) + vty_out(vty, " no-php-flag"); + else if (strmatch(lh_behavior, "explicit-null")) + vty_out(vty, " explicit-null"); + vty_out(vty, "\n"); +} + /* * XPath: /frr-interface:lib/interface/frr-isisd:isis/passive */ @@ -2095,6 +2304,15 @@ void isis_cli_init(void) install_element(ISIS_NODE, &isis_topology_cmd); + install_element(ISIS_NODE, &isis_sr_enable_cmd); + install_element(ISIS_NODE, &no_isis_sr_enable_cmd); + install_element(ISIS_NODE, &isis_sr_global_block_label_range_cmd); + install_element(ISIS_NODE, &no_isis_sr_global_block_label_range_cmd); + install_element(ISIS_NODE, &isis_sr_node_msd_cmd); + install_element(ISIS_NODE, &no_isis_sr_node_msd_cmd); + install_element(ISIS_NODE, &isis_sr_prefix_sid_cmd); + install_element(ISIS_NODE, &no_isis_sr_prefix_sid_cmd); + install_element(INTERFACE_NODE, &isis_passive_cmd); install_element(INTERFACE_NODE, &isis_passwd_cmd); diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index bdfa71091e..2dedebf983 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -458,6 +458,13 @@ const struct frr_yang_module_info frr_isisd_info = { .xpath = "/frr-isisd:isis/instance/segment-routing/enabled", .cbs = { .modify = isis_instance_segment_routing_enabled_modify, + .cli_show = cli_show_isis_sr_enabled, + }, + }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing/srgb", + .cbs = { + .cli_show = cli_show_isis_srgb, }, }, { @@ -477,6 +484,7 @@ const struct frr_yang_module_info frr_isisd_info = { .cbs = { .modify = isis_instance_segment_routing_msd_node_msd_modify, .destroy = isis_instance_segment_routing_msd_node_msd_destroy, + .cli_show = cli_show_isis_node_msd, }, }, { @@ -484,6 +492,7 @@ const struct frr_yang_module_info frr_isisd_info = { .cbs = { .create = isis_instance_segment_routing_prefix_sid_map_prefix_sid_create, .destroy = isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy, + .cli_show = cli_show_isis_prefix_sid, }, }, { diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index 43ee361ca8..19ebee0e05 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -351,6 +351,14 @@ void cli_show_isis_mt_ipv6_mgmt(struct vty *vty, struct lyd_node *dnode, bool show_defaults); void cli_show_isis_mt_ipv6_dstsrc(struct vty *vty, struct lyd_node *dnode, bool show_defaults); +void cli_show_isis_sr_enabled(struct vty *vty, struct lyd_node *dnode, + bool show_defaults); +void cli_show_isis_srgb(struct vty *vty, struct lyd_node *dnode, + bool show_defaults); +void cli_show_isis_node_msd(struct vty *vty, struct lyd_node *dnode, + bool show_defaults); +void cli_show_isis_prefix_sid(struct vty *vty, struct lyd_node *dnode, + bool show_defaults); void cli_show_ip_isis_passive(struct vty *vty, struct lyd_node *dnode, bool show_defaults); void cli_show_ip_isis_password(struct vty *vty, struct lyd_node *dnode, From 26f6acafc369f1c126870b4282d5e252cc830f26 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Sat, 3 Aug 2019 22:02:37 -0300 Subject: [PATCH 07/18] isisd: add support for segment routing This is an implementation of the IS-IS SR draft [1] for FRR. The following features are supported: * IPv4 and IPv6 Prefix-SIDs; * IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs; * Index and absolute labels; * The no-php and explicit-null Prefix-SID flags; * Full integration with the Label Manager. Known limitations: * No support for Anycast-SIDs; * No support for the SID/Label Binding TLV (required for LDP interop). * No support for persistent Adj-SIDs; * No support for multiple SRGBs. [1] draft-ietf-isis-segment-routing-extensions-25 Signed-off-by: Olivier Dugeon Signed-off-by: Renato Westphal --- isisd/isis_adjacency.c | 68 ++ isisd/isis_adjacency.h | 4 + isisd/isis_cli.c | 4 +- isisd/isis_errors.c | 6 + isisd/isis_errors.h | 1 + isisd/isis_lsp.c | 66 +- isisd/isis_main.c | 19 +- isisd/isis_nb.c | 3 + isisd/isis_nb.h | 14 +- isisd/isis_nb_config.c | 266 ++++--- isisd/isis_route.c | 3 + isisd/isis_route.h | 2 + isisd/isis_spf.c | 2 + isisd/isis_sr.c | 1525 ++++++++++++++++++++++++++++++++++++++++ isisd/isis_sr.h | 259 +++++++ isisd/isis_tlvs.c | 35 +- isisd/isis_tlvs.h | 9 +- isisd/isis_zebra.c | 280 +++++++- isisd/isis_zebra.h | 16 +- isisd/isisd.c | 43 ++ isisd/isisd.h | 8 + isisd/subdir.am | 3 + lib/mpls.h | 3 +- zebra/zebra_mpls.h | 7 + 24 files changed, 2533 insertions(+), 113 deletions(-) create mode 100644 isisd/isis_sr.c create mode 100644 isisd/isis_sr.h diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index 4e0ee4448b..acfe3e2e1f 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -93,6 +93,7 @@ struct isis_adjacency *isis_new_adj(const uint8_t *id, const uint8_t *snpa, .last_dis_change = time(NULL); } } + adj->adj_sids = list_new(); return adj; } @@ -122,6 +123,44 @@ struct isis_adjacency *isis_adj_lookup_snpa(const uint8_t *ssnpa, return NULL; } +bool isis_adj_exists(const struct isis_area *area, int level, + const uint8_t *sysid) +{ + struct isis_circuit *circuit; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { + struct isis_adjacency *adj; + struct listnode *anode; + struct list *adjdb; + + switch (circuit->circ_type) { + case CIRCUIT_T_BROADCAST: + adjdb = circuit->u.bc.adjdb[level - 1]; + if (!adjdb) + continue; + + for (ALL_LIST_ELEMENTS_RO(adjdb, anode, adj)) { + if (!memcmp(adj->sysid, sysid, ISIS_SYS_ID_LEN)) + return true; + } + break; + case CIRCUIT_T_P2P: + adj = circuit->u.p2p.neighbor; + if (!adj) + break; + + if (!memcmp(adj->sysid, sysid, ISIS_SYS_ID_LEN)) + return true; + break; + default: + break; + } + } + + return false; +} + DEFINE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj)) void isis_delete_adj(void *arg) @@ -145,6 +184,7 @@ void isis_delete_adj(void *arg) XFREE(MTYPE_ISIS_ADJACENCY_INFO, adj->ipv6_addresses); adj_mt_finish(adj); + list_delete(&adj->adj_sids); XFREE(MTYPE_ISIS_ADJACENCY, adj); return; @@ -441,6 +481,9 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty, } if (detail == ISIS_UI_LEVEL_DETAIL) { + struct sr_adjacency *sra; + struct listnode *anode; + level = adj->level; vty_out(vty, "\n"); if (adj->circuit) @@ -529,6 +572,31 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty, vty_out(vty, " %s\n", buf); } } + for (ALL_LIST_ELEMENTS_RO(adj->adj_sids, anode, sra)) { + const char *adj_type; + const char *backup; + uint32_t sid; + + switch (sra->adj->circuit->circ_type) { + case CIRCUIT_T_BROADCAST: + adj_type = "LAN Adjacency-SID"; + sid = sra->u.ladj_sid->sid; + break; + case CIRCUIT_T_P2P: + adj_type = "Adjacency-SID"; + sid = sra->u.adj_sid->sid; + break; + default: + continue; + } + backup = (sra->type == ISIS_SR_LAN_BACKUP) ? " (backup)" + : ""; + + vty_out(vty, " %s %s%s: %u\n", + (sra->nexthop.family == AF_INET) ? "IPv4" + : "IPv6", + adj_type, backup, sid); + } vty_out(vty, "\n"); } return; diff --git a/isisd/isis_adjacency.h b/isisd/isis_adjacency.h index 834eba7925..ec17446ade 100644 --- a/isisd/isis_adjacency.h +++ b/isisd/isis_adjacency.h @@ -69,6 +69,7 @@ struct isis_dis_record { }; struct bfd_session; +struct isis_area; struct isis_adjacency { uint8_t snpa[ETH_ALEN]; /* NeighbourSNPAAddress */ @@ -103,6 +104,7 @@ struct isis_adjacency { uint16_t *mt_set; /* Topologies this adjacency is valid for */ unsigned int mt_count; /* Number of entries in mt_set */ struct bfd_session *bfd_session; + struct list *adj_sids; /* Segment Routing Adj-SIDs. */ }; struct isis_threeway_adj; @@ -111,6 +113,8 @@ struct isis_adjacency *isis_adj_lookup(const uint8_t *sysid, struct list *adjdb); struct isis_adjacency *isis_adj_lookup_snpa(const uint8_t *ssnpa, struct list *adjdb); +bool isis_adj_exists(const struct isis_area *area, int level, + const uint8_t *sysid); struct isis_adjacency *isis_new_adj(const uint8_t *id, const uint8_t *snpa, int level, struct isis_circuit *circuit); void isis_delete_adj(void *adj); diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 0101e30ad3..c421750a82 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -1480,7 +1480,7 @@ DEFPY (isis_sr_prefix_sid, isis_sr_prefix_sid_cmd, "segment-routing prefix\ $prefix\ - \ + \ [$lh_behavior]", SR_STR "Prefix SID\n" @@ -1518,7 +1518,7 @@ DEFPY (isis_sr_prefix_sid, DEFPY (no_isis_sr_prefix_sid, no_isis_sr_prefix_sid_cmd, "no segment-routing prefix $prefix\ - [ []]", + [ []]", NO_STR SR_STR "Prefix SID\n" diff --git a/isisd/isis_errors.c b/isisd/isis_errors.c index 755e70dbf6..7530d0b966 100644 --- a/isisd/isis_errors.c +++ b/isisd/isis_errors.c @@ -37,6 +37,12 @@ static struct log_ref ferr_isis_err[] = { .description = "Isis has detected an error within configuration for the router", .suggestion = "Ensure configuration is correct" }, + { + .code = EC_ISIS_SID_OVERFLOW, + .title = "SID index overflow", + .description = "Isis has detected that a SID index falls outside of its associated SRGB range", + .suggestion = "Configure a larger SRGB" + }, { .code = END_FERR, } diff --git a/isisd/isis_errors.h b/isisd/isis_errors.h index 0732737607..d5674dbf30 100644 --- a/isisd/isis_errors.h +++ b/isisd/isis_errors.h @@ -26,6 +26,7 @@ enum isis_log_refs { EC_ISIS_PACKET = ISIS_FERR_START, EC_ISIS_CONFIG, + EC_ISIS_SID_OVERFLOW, }; extern void isis_error_init(void); diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index effd19ed7d..e578f616f4 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -55,6 +55,7 @@ #include "isisd/isis_mt.h" #include "isisd/isis_tlvs.h" #include "isisd/isis_te.h" +#include "isisd/isis_sr.h" #include "isisd/fabricd.h" #include "isisd/isis_tx_queue.h" #include "isisd/isis_nb.h" @@ -763,9 +764,15 @@ static void lsp_build_ext_reach_ipv4(struct isis_lsp *lsp, if (area->oldmetric) isis_tlvs_add_oldstyle_ip_reach(lsp->tlvs, ipv4, metric); - if (area->newmetric) - isis_tlvs_add_extended_ip_reach(lsp->tlvs, ipv4, - metric); + if (area->newmetric) { + struct sr_prefix_cfg *pcfg = NULL; + + if (area->srdb.enabled) + pcfg = isis_sr_cfg_prefix_find(area, ipv4); + + isis_tlvs_add_extended_ip_reach(lsp->tlvs, ipv4, metric, + true, pcfg); + } } } @@ -792,9 +799,14 @@ static void lsp_build_ext_reach_ipv6(struct isis_lsp *lsp, metric = MAX_WIDE_PATH_METRIC; if (!src_p || !src_p->prefixlen) { + struct sr_prefix_cfg *pcfg = NULL; + + if (area->srdb.enabled) + pcfg = isis_sr_cfg_prefix_find(area, p); + isis_tlvs_add_ipv6_reach(lsp->tlvs, isis_area_ipv6_topology(area), - p, metric); + p, metric, true, pcfg); } else if (isis_area_ipv6_dstsrc_enabled(area)) { isis_tlvs_add_ipv6_dstsrc_reach(lsp->tlvs, ISIS_MT_IPV6_DSTSRC, @@ -910,6 +922,33 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area) area->area_tag); } + /* Add Router Capability TLV. */ + if (isis->router_id != 0) { + struct isis_router_cap cap = {}; + + cap.router_id.s_addr = isis->router_id; + + /* Add SR Sub-TLVs if SR is enabled. */ + if (area->srdb.enabled) { + struct isis_sr_db *srdb = &area->srdb; + uint32_t range_size; + + range_size = srdb->config.srgb_upper_bound + - srdb->config.srgb_lower_bound + 1; + cap.srgb.flags = ISIS_SUBTLV_SRGB_FLAG_I + | ISIS_SUBTLV_SRGB_FLAG_V; + cap.srgb.range_size = range_size; + cap.srgb.lower_bound = srdb->config.srgb_lower_bound; + cap.algo[0] = SR_ALGORITHM_SPF; + cap.algo[1] = SR_ALGORITHM_UNSET; + cap.msd = srdb->config.msd; + } + + isis_tlvs_set_router_capability(lsp->tlvs, &cap); + lsp_debug("ISIS (%s): Adding Router Capabilities information", + area->area_tag); + } + /* IPv4 address and TE router ID TLVs. * In case of the first one we don't follow "C" vendor, * but "J" vendor behavior - one IPv4 address is put @@ -996,13 +1035,21 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area) } if (area->newmetric) { + struct sr_prefix_cfg *pcfg = NULL; + lsp_debug( "ISIS (%s): Adding te-style IP reachability for %s", area->area_tag, prefix2str(ipv4, buf, sizeof(buf))); + + if (area->srdb.enabled) + pcfg = isis_sr_cfg_prefix_find( + area, ipv4); + isis_tlvs_add_extended_ip_reach( - lsp->tlvs, ipv4, metric); + lsp->tlvs, ipv4, metric, false, + pcfg); } } } @@ -1014,14 +1061,21 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area) for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, ipnode, ipv6)) { + struct sr_prefix_cfg *pcfg = NULL; + lsp_debug( "ISIS (%s): Adding IPv6 reachability for %s", area->area_tag, prefix2str(ipv6, buf, sizeof(buf))); + + if (area->srdb.enabled) + pcfg = isis_sr_cfg_prefix_find(area, + ipv6); + isis_tlvs_add_ipv6_reach( lsp->tlvs, isis_area_ipv6_topology(area), ipv6, - metric); + metric, false, pcfg); } } diff --git a/isisd/isis_main.c b/isisd/isis_main.c index 4c841dffe2..78654b2f1c 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -83,7 +83,9 @@ struct zebra_privs_t isisd_privs = { .cap_num_i = 0}; /* isisd options */ -struct option longopts[] = {{0}}; +static const struct option longopts[] = { + {"int_num", required_argument, NULL, 'I'}, + {0}}; /* Master of threads. */ struct thread_master *master; @@ -99,6 +101,7 @@ void sigusr1(void); static __attribute__((__noreturn__)) void terminate(int i) { + isis_sr_term(); isis_zebra_stop(); exit(i); } @@ -196,13 +199,16 @@ FRR_DAEMON_INFO(isisd, ISIS, .vty_port = ISISD_VTY_PORT, int main(int argc, char **argv, char **envp) { int opt; + int instance = 1; #ifdef FABRICD frr_preinit(&fabricd_di, argc, argv); #else frr_preinit(&isisd_di, argc, argv); #endif - frr_opt_add("", longopts, ""); + frr_opt_add( + "I:", longopts, + " -I, --int_num Set instance number (label-manager)\n"); /* Command line argument treatment. */ while (1) { @@ -214,6 +220,12 @@ int main(int argc, char **argv, char **envp) switch (opt) { case 0: break; + case 'I': + instance = atoi(optarg); + if (instance < 1 || instance > (unsigned short)-1) + zlog_err("Instance %i out of range (1..%u)", + instance, (unsigned short)-1); + break; default: frr_help_exit(1); break; @@ -242,13 +254,14 @@ int main(int argc, char **argv, char **envp) isis_redist_init(); isis_route_map_init(); isis_mpls_te_init(); + isis_sr_init(); lsp_init(); mt_init(); /* create the global 'isis' instance */ isis_new(1, VRF_DEFAULT); - isis_zebra_init(master); + isis_zebra_init(master, instance); isis_bfd_init(); fabricd_init(); diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index 2dedebf983..8e976d9bc8 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -464,6 +464,7 @@ const struct frr_yang_module_info frr_isisd_info = { { .xpath = "/frr-isisd:isis/instance/segment-routing/srgb", .cbs = { + .apply_finish = isis_instance_segment_routing_srgb_apply_finish, .cli_show = cli_show_isis_srgb, }, }, @@ -492,6 +493,8 @@ const struct frr_yang_module_info frr_isisd_info = { .cbs = { .create = isis_instance_segment_routing_prefix_sid_map_prefix_sid_create, .destroy = isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy, + .pre_validate = isis_instance_segment_routing_prefix_sid_map_prefix_sid_pre_validate, + .apply_finish = isis_instance_segment_routing_prefix_sid_map_prefix_sid_apply_finish, .cli_show = cli_show_isis_prefix_sid, }, }, diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index 19ebee0e05..58f6c38926 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -183,11 +183,11 @@ int isis_instance_segment_routing_srgb_upper_bound_modify( int isis_instance_segment_routing_msd_node_msd_modify( struct nb_cb_modify_args *args); int isis_instance_segment_routing_msd_node_msd_destroy( - struct nb_cb_modify_args *args); + struct nb_cb_destroy_args *args); int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create( - struct nb_cb_modify_args *args); + struct nb_cb_create_args *args); int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy( - struct nb_cb_modify_args *args); + struct nb_cb_destroy_args *args); int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify( struct nb_cb_modify_args *args); int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify( @@ -279,6 +279,10 @@ struct yang_data * lib_interface_isis_event_counters_authentication_fails_get_elem( struct nb_cb_get_elem_args *args); +/* Optional 'pre_validate' callbacks. */ +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_pre_validate( + struct nb_cb_pre_validate_args *args); + /* Optional 'apply_finish' callbacks. */ void ietf_backoff_delay_apply_finish(struct nb_cb_apply_finish_args *args); void area_password_apply_finish(struct nb_cb_apply_finish_args *args); @@ -291,6 +295,10 @@ void default_info_origin_ipv6_apply_finish( void redistribute_apply_finish(const struct lyd_node *dnode, int family); void redistribute_ipv4_apply_finish(struct nb_cb_apply_finish_args *args); void redistribute_ipv6_apply_finish(struct nb_cb_apply_finish_args *args); +void isis_instance_segment_routing_srgb_apply_finish( + struct nb_cb_apply_finish_args *args); +void isis_instance_segment_routing_prefix_sid_map_prefix_sid_apply_finish( + struct nb_cb_apply_finish_args *args); /* Optional 'cli_show' callbacks. */ void cli_show_router_isis(struct vty *vty, struct lyd_node *dnode, diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index f97202c9a8..ec3b7baa31 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -1405,35 +1405,78 @@ int isis_instance_mpls_te_router_address_destroy( /* * XPath: /frr-isisd:isis/instance/segment-routing/enabled */ -int isis_instance_segment_routing_enabled_modify(enum nb_event event, - const struct lyd_node *dnode, - union nb_resource *resource) +int isis_instance_segment_routing_enabled_modify( + struct nb_cb_modify_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; + struct isis_area *area; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + area = nb_running_get_entry(args->dnode, NULL, true); + area->srdb.config.enabled = yang_dnode_get_bool(args->dnode, NULL); + + if (area->srdb.config.enabled) { + if (IS_DEBUG_ISIS(DEBUG_EVENTS)) + zlog_debug("SR: Segment Routing: OFF -> ON"); + + if (isis_sr_start(area) == 0) + area->srdb.enabled = true; + } else { + if (IS_DEBUG_ISIS(DEBUG_EVENTS)) + zlog_debug("SR: Segment Routing: ON -> OFF"); + + isis_sr_stop(area); + area->srdb.enabled = false; } return NB_OK; } +/* + * XPath: /frr-isisd:isis/instance/segment-routing/srgb + */ +void isis_instance_segment_routing_srgb_apply_finish( + struct nb_cb_apply_finish_args *args) +{ + struct isis_area *area; + uint32_t lower_bound, upper_bound; + int ret; + + area = nb_running_get_entry(args->dnode, NULL, true); + lower_bound = yang_dnode_get_uint32(args->dnode, "./lower-bound"); + upper_bound = yang_dnode_get_uint32(args->dnode, "./upper-bound"); + + ret = isis_sr_cfg_srgb_update(area, lower_bound, upper_bound); + if (area->srdb.config.enabled) { + if (ret == 0) + area->srdb.enabled = true; + else { + isis_sr_stop(area); + area->srdb.enabled = false; + } + } +} + /* * XPath: /frr-isisd:isis/instance/segment-routing/srgb/lower-bound */ int isis_instance_segment_routing_srgb_lower_bound_modify( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_modify_args *args) { - switch (event) { + uint32_t lower_bound = yang_dnode_get_uint32(args->dnode, NULL); + + switch (args->event) { case NB_EV_VALIDATE: + if (!IS_MPLS_UNRESERVED_LABEL(lower_bound)) { + zlog_warn("Invalid SRGB lower bound: %" PRIu32, + lower_bound); + return NB_ERR_VALIDATION; + } + break; case NB_EV_PREPARE: case NB_EV_ABORT: case NB_EV_APPLY: - /* TODO: implement me. */ break; } @@ -1444,15 +1487,21 @@ int isis_instance_segment_routing_srgb_lower_bound_modify( * XPath: /frr-isisd:isis/instance/segment-routing/srgb/upper-bound */ int isis_instance_segment_routing_srgb_upper_bound_modify( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_modify_args *args) { - switch (event) { + uint32_t upper_bound = yang_dnode_get_uint32(args->dnode, NULL); + + switch (args->event) { case NB_EV_VALIDATE: + if (!IS_MPLS_UNRESERVED_LABEL(upper_bound)) { + zlog_warn("Invalid SRGB upper bound: %" PRIu32, + upper_bound); + return NB_ERR_VALIDATION; + } + break; case NB_EV_PREPARE: case NB_EV_ABORT: case NB_EV_APPLY: - /* TODO: implement me. */ break; } @@ -1463,32 +1512,31 @@ int isis_instance_segment_routing_srgb_upper_bound_modify( * XPath: /frr-isisd:isis/instance/segment-routing/msd/node-msd */ int isis_instance_segment_routing_msd_node_msd_modify( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_modify_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; - } + struct isis_area *area; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + area = nb_running_get_entry(args->dnode, NULL, true); + area->srdb.config.msd = yang_dnode_get_uint8(args->dnode, NULL); + isis_sr_cfg_msd_update(area); return NB_OK; } int isis_instance_segment_routing_msd_node_msd_destroy( - enum nb_event event, const struct lyd_node *dnode) + struct nb_cb_destroy_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; - } + struct isis_area *area; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + area = nb_running_get_entry(args->dnode, NULL, true); + area->srdb.config.msd = 0; + isis_sr_cfg_msd_update(area); return NB_OK; } @@ -1497,34 +1545,86 @@ int isis_instance_segment_routing_msd_node_msd_destroy( * XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid */ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_create_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ + struct isis_area *area; + struct prefix prefix; + struct sr_prefix_cfg *pcfg; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + area = nb_running_get_entry(args->dnode, NULL, true); + yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); + + pcfg = isis_sr_cfg_prefix_add(area, &prefix); + nb_running_set_entry(args->dnode, pcfg); + + return NB_OK; +} + +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy( + struct nb_cb_destroy_args *args) +{ + struct sr_prefix_cfg *pcfg; + struct isis_area *area; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + pcfg = nb_running_unset_entry(args->dnode); + area = pcfg->area; + isis_sr_cfg_prefix_del(pcfg); + lsp_regenerate_schedule(area, area->is_type, 0); + + return NB_OK; +} + +int isis_instance_segment_routing_prefix_sid_map_prefix_sid_pre_validate( + struct nb_cb_pre_validate_args *args) +{ + uint32_t srgb_lbound; + uint32_t srgb_ubound; + uint32_t srgb_range; + uint32_t sid; + enum sr_sid_value_type sid_type; + + srgb_lbound = yang_dnode_get_uint32(args->dnode, + "../../srgb/lower-bound"); + srgb_ubound = yang_dnode_get_uint32(args->dnode, + "../../srgb/upper-bound"); + sid = yang_dnode_get_uint32(args->dnode, "./sid-value"); + sid_type = yang_dnode_get_enum(args->dnode, "./sid-value-type"); + + srgb_range = srgb_ubound - srgb_lbound + 1; + switch (sid_type) { + case SR_SID_VALUE_TYPE_INDEX: + if (sid >= srgb_range) { + zlog_warn("SID index %u falls outside local SRGB range", + sid); + return NB_ERR_VALIDATION; + } + break; + case SR_SID_VALUE_TYPE_ABSOLUTE: + if (!IS_MPLS_UNRESERVED_LABEL(sid)) { + zlog_warn("Invalid absolute SID %u", sid); + return NB_ERR_VALIDATION; + } break; } return NB_OK; } -int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy( - enum nb_event event, const struct lyd_node *dnode) +void isis_instance_segment_routing_prefix_sid_map_prefix_sid_apply_finish( + struct nb_cb_apply_finish_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; - } + struct sr_prefix_cfg *pcfg; + struct isis_area *area; - return NB_OK; + pcfg = nb_running_get_entry(args->dnode, NULL, true); + area = pcfg->area; + lsp_regenerate_schedule(area, area->is_type, 0); } /* @@ -1532,17 +1632,15 @@ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy( * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value-type */ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_modify_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; - } + struct sr_prefix_cfg *pcfg; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + pcfg = nb_running_get_entry(args->dnode, NULL, true); + pcfg->sid_type = yang_dnode_get_enum(args->dnode, NULL); return NB_OK; } @@ -1552,17 +1650,15 @@ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modif * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value */ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_modify_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; - } + struct sr_prefix_cfg *pcfg; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + pcfg = nb_running_get_entry(args->dnode, NULL, true); + pcfg->sid = yang_dnode_get_uint32(args->dnode, NULL); return NB_OK; } @@ -1572,17 +1668,15 @@ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify( * /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/last-hop-behavior */ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify( - enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource) + struct nb_cb_modify_args *args) { - switch (event) { - case NB_EV_VALIDATE: - case NB_EV_PREPARE: - case NB_EV_ABORT: - case NB_EV_APPLY: - /* TODO: implement me. */ - break; - } + struct sr_prefix_cfg *pcfg; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + pcfg = nb_running_get_entry(args->dnode, NULL, true); + pcfg->last_hop_behavior = yang_dnode_get_enum(args->dnode, NULL); return NB_OK; } diff --git a/isisd/isis_route.c b/isisd/isis_route.c index 516e3f90b9..fa6af6c216 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -70,6 +70,7 @@ static struct isis_nexthop *isis_nexthop_create(int family, union g_addr *ip, nexthop->family = family; nexthop->ifindex = ifindex; nexthop->ip = *ip; + isis_sr_nexthop_reset(&nexthop->sr); return nexthop; } @@ -129,6 +130,7 @@ static void adjinfo2nexthop(int family, struct list *nexthops, nh = isis_nexthop_create( AF_INET, &ip, adj->circuit->interface->ifindex); + memcpy(nh->sysid, adj->sysid, sizeof(nh->sysid)); listnode_add(nexthops, nh); break; } @@ -143,6 +145,7 @@ static void adjinfo2nexthop(int family, struct list *nexthops, nh = isis_nexthop_create( AF_INET6, &ip, adj->circuit->interface->ifindex); + memcpy(nh->sysid, adj->sysid, sizeof(nh->sysid)); listnode_add(nexthops, nh); break; } diff --git a/isisd/isis_route.h b/isisd/isis_route.h index 96bcdc3508..0356668d7e 100644 --- a/isisd/isis_route.h +++ b/isisd/isis_route.h @@ -31,6 +31,8 @@ struct isis_nexthop { ifindex_t ifindex; int family; union g_addr ip; + uint8_t sysid[ISIS_SYS_ID_LEN]; + struct sr_nexthop_info sr; }; struct isis_route_info { diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 30b9f88615..3091650ef1 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1214,6 +1214,8 @@ static int isis_run_spf_cb(struct thread *thread) isis_area_verify_routes(area); + isis_area_verify_sr(area); + /* walk all circuits and reset any spf specific flags */ struct listnode *node; struct isis_circuit *circuit; diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c new file mode 100644 index 0000000000..54689ea48d --- /dev/null +++ b/isisd/isis_sr.c @@ -0,0 +1,1525 @@ +/* + * This is an implementation of Segment Routing for IS-IS + * as per draft draft-ietf-isis-segment-routing-extensions-25 + * + * Copyright (C) 2019 Orange Labs http://www.orange.com + * + * Author: Olivier Dugeon + * Contributor: Renato Westphal for NetDEF + * + * 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 "if.h" +#include "linklist.h" +#include "log.h" +#include "command.h" +#include "termtable.h" +#include "memory.h" +#include "prefix.h" +#include "table.h" +#include "vty.h" +#include "zclient.h" +#include "lib/lib_errors.h" + +#include "isisd/isisd.h" +#include "isisd/isis_spf.h" +#include "isisd/isis_spf_private.h" +#include "isisd/isis_adjacency.h" +#include "isisd/isis_route.h" +#include "isisd/isis_mt.h" +#include "isisd/isis_sr.h" +#include "isisd/isis_tlvs.h" +#include "isisd/isis_misc.h" +#include "isisd/isis_zebra.h" +#include "isisd/isis_errors.h" + +DEFINE_MTYPE_STATIC(ISISD, ISIS_SR_INFO, "ISIS segment routing information") + +static void isis_sr_prefix_uninstall(struct sr_prefix *srp); +static void isis_sr_prefix_reinstall(struct sr_prefix *srp, + bool replace_semantics); + +/*----------------------------------------------------------------------------*/ + +static inline int sr_prefix_sid_compare(const struct sr_prefix *a, + const struct sr_prefix *b) +{ + return prefix_cmp(&a->prefix, &b->prefix); +} +DECLARE_RBTREE_UNIQ(tree_sr_node_prefix, struct sr_prefix, node_entry, + sr_prefix_sid_compare) +DECLARE_RBTREE_UNIQ(tree_sr_area_prefix, struct sr_prefix, area_entry, + sr_prefix_sid_compare) + +static inline int sr_prefix_sid_cfg_compare(const struct sr_prefix_cfg *a, + const struct sr_prefix_cfg *b) +{ + return prefix_cmp(&a->prefix, &b->prefix); +} +DECLARE_RBTREE_UNIQ(tree_sr_prefix_cfg, struct sr_prefix_cfg, entry, + sr_prefix_sid_cfg_compare) + +static inline int sr_node_compare(const struct sr_node *a, + const struct sr_node *b) +{ + return memcmp(a->sysid, b->sysid, ISIS_SYS_ID_LEN); +} +DECLARE_RBTREE_UNIQ(tree_sr_node, struct sr_node, entry, sr_node_compare) + +/*----------------------------------------------------------------------------*/ + +/* Returns true if the interface/address pair corresponds to a Node-SID. */ +static bool isis_sr_prefix_is_node_sid(const struct interface *ifp, + const struct prefix *prefix) +{ + return (if_is_loopback(ifp) && is_host_route(prefix)); +} + +/* Handle changes in the local SRGB configuration. */ +int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, + uint32_t upper_bound) +{ + struct isis_sr_db *srdb = &area->srdb; + + /* First release the old SRGB. */ + if (srdb->config.enabled) + isis_zebra_release_label_range(srdb->config.srgb_lower_bound, + srdb->config.srgb_upper_bound); + + srdb->config.srgb_lower_bound = lower_bound; + srdb->config.srgb_upper_bound = upper_bound; + + if (srdb->enabled) { + struct sr_prefix *srp; + + /* Request new SRGB if SR is enabled. */ + if (isis_zebra_request_label_range( + srdb->config.srgb_lower_bound, + srdb->config.srgb_upper_bound + - srdb->config.srgb_lower_bound + 1)) + return -1; + + /* Reinstall local Prefix-SIDs to update their input labels. */ + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { + frr_each (tree_sr_area_prefix, + &area->srdb.prefix_sids[level - 1], srp) { + isis_sr_prefix_reinstall(srp, false); + } + } + + lsp_regenerate_schedule(area, area->is_type, 0); + } else if (srdb->config.enabled) { + /* Try to enable SR again using the new SRGB. */ + if (isis_sr_start(area) == 0) + area->srdb.enabled = true; + } + + return 0; +} + +/* Handle changes in the local MSD configuration. */ +void isis_sr_cfg_msd_update(struct isis_area *area) +{ + lsp_regenerate_schedule(area, area->is_type, 0); +} + +/* Handle new Prefix-SID configuration. */ +struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, + const struct prefix *prefix) +{ + struct sr_prefix_cfg *pcfg; + struct interface *ifp; + + pcfg = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*pcfg)); + pcfg->prefix = *prefix; + pcfg->area = area; + + /* Pull defaults from the YANG module. */ + pcfg->sid_type = yang_get_default_enum( + "%s/prefix-sid-map/prefix-sid/sid-value-type", ISIS_SR); + pcfg->last_hop_behavior = yang_get_default_enum( + "%s/prefix-sid-map/prefix-sid/last-hop-behavior", ISIS_SR); + + /* Set the N-flag when appropriate. */ + ifp = if_lookup_prefix(prefix, VRF_DEFAULT); + if (ifp && isis_sr_prefix_is_node_sid(ifp, prefix)) + pcfg->node_sid = true; + + /* Save prefix-sid configuration. */ + tree_sr_prefix_cfg_add(&area->srdb.config.prefix_sids, pcfg); + + return pcfg; +} + +/* Handle removal of locally configured Prefix-SID. */ +void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg) +{ + struct isis_area *area; + + area = pcfg->area; + tree_sr_prefix_cfg_del(&area->srdb.config.prefix_sids, pcfg); + XFREE(MTYPE_ISIS_SR_INFO, pcfg); +} + +/* Lookup Prefix-SID in the local configuration. */ +struct sr_prefix_cfg *isis_sr_cfg_prefix_find(struct isis_area *area, + union prefixconstptr prefix) +{ + struct sr_prefix_cfg pcfg = {}; + + prefix_copy(&pcfg.prefix, prefix.p); + return tree_sr_prefix_cfg_find(&area->srdb.config.prefix_sids, &pcfg); +} + +/* Fill in Prefix-SID Sub-TLV according to the corresponding configuration. */ +void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, bool external, + struct isis_prefix_sid *psid) +{ + /* Set SID algorithm. */ + psid->algorithm = SR_ALGORITHM_SPF; + + /* Set SID flags. */ + psid->flags = 0; + switch (pcfg->last_hop_behavior) { + case SR_LAST_HOP_BEHAVIOR_EXP_NULL: + SET_FLAG(psid->flags, ISIS_PREFIX_SID_NO_PHP); + SET_FLAG(psid->flags, ISIS_PREFIX_SID_EXPLICIT_NULL); + break; + case SR_LAST_HOP_BEHAVIOR_NO_PHP: + SET_FLAG(psid->flags, ISIS_PREFIX_SID_NO_PHP); + UNSET_FLAG(psid->flags, ISIS_PREFIX_SID_EXPLICIT_NULL); + break; + case SR_LAST_HOP_BEHAVIOR_PHP: + UNSET_FLAG(psid->flags, ISIS_PREFIX_SID_NO_PHP); + UNSET_FLAG(psid->flags, ISIS_PREFIX_SID_EXPLICIT_NULL); + break; + } + if (external) + SET_FLAG(psid->flags, ISIS_PREFIX_SID_READVERTISED); + if (pcfg->node_sid) + SET_FLAG(psid->flags, ISIS_PREFIX_SID_NODE); + + /* Set SID value. */ + psid->value = pcfg->sid; + if (pcfg->sid_type == SR_SID_VALUE_TYPE_ABSOLUTE) { + SET_FLAG(psid->flags, ISIS_PREFIX_SID_VALUE); + SET_FLAG(psid->flags, ISIS_PREFIX_SID_LOCAL); + } +} + +/*----------------------------------------------------------------------------*/ + +static struct sr_prefix *isis_sr_prefix_add(struct isis_area *area, + struct sr_node *srn, + union prefixconstptr prefix, + bool local, + const struct isis_prefix_sid *psid) +{ + struct sr_prefix *srp; + + srp = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*srp)); + prefix_copy(&srp->prefix, prefix.p); + srp->sid = *psid; + srp->local_label = MPLS_INVALID_LABEL; + if (local) { + srp->type = ISIS_SR_PREFIX_LOCAL; + isis_sr_nexthop_reset(&srp->u.local.info); + } else { + srp->type = ISIS_SR_PREFIX_REMOTE; + srp->u.remote.rinfo = NULL; + } + srp->srn = srn; + tree_sr_node_prefix_add(&srn->prefix_sids, srp); + /* TODO: this might fail if we have Anycast SIDs in the IS-IS area. */ + tree_sr_area_prefix_add(&area->srdb.prefix_sids[srn->level - 1], srp); + + return srp; +} + +static void isis_sr_prefix_del(struct isis_area *area, struct sr_node *srn, + struct sr_prefix *srp) +{ + isis_sr_prefix_uninstall(srp); + tree_sr_node_prefix_del(&srn->prefix_sids, srp); + tree_sr_area_prefix_del(&area->srdb.prefix_sids[srn->level - 1], srp); + XFREE(MTYPE_ISIS_SR_INFO, srp); +} + +static struct sr_prefix *isis_sr_prefix_find_area(struct isis_area *area, + int level, + union prefixconstptr prefix) +{ + struct sr_prefix srp = {}; + + prefix_copy(&srp.prefix, prefix.p); + return tree_sr_area_prefix_find(&area->srdb.prefix_sids[level - 1], + &srp); +} + +static struct sr_prefix *isis_sr_prefix_find_node(struct sr_node *srn, + union prefixconstptr prefix) +{ + struct sr_prefix srp = {}; + + prefix_copy(&srp.prefix, prefix.p); + return tree_sr_node_prefix_find(&srn->prefix_sids, &srp); +} + +static struct sr_node *isis_sr_node_add(struct isis_area *area, int level, + const uint8_t *sysid, + const struct isis_router_cap *cap) +{ + struct sr_node *srn; + + srn = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*srn)); + srn->level = level; + memcpy(srn->sysid, sysid, ISIS_SYS_ID_LEN); + srn->cap = *cap; + srn->area = area; + tree_sr_node_prefix_init(&srn->prefix_sids); + tree_sr_node_add(&area->srdb.sr_nodes[level - 1], srn); + + return srn; +} + +static void isis_sr_node_del(struct isis_area *area, int level, + struct sr_node *srn) +{ + /* Remove and uninstall Prefix-SIDs. */ + while (tree_sr_node_prefix_count(&srn->prefix_sids) > 0) { + struct sr_prefix *srp; + + srp = tree_sr_node_prefix_first(&srn->prefix_sids); + isis_sr_prefix_del(area, srn, srp); + } + + tree_sr_node_del(&area->srdb.sr_nodes[level - 1], srn); + XFREE(MTYPE_ISIS_SR_INFO, srn); +} + +static struct sr_node *isis_sr_node_find(struct isis_area *area, int level, + const uint8_t *sysid) +{ + struct sr_node srn = {}; + + memcpy(srn.sysid, sysid, ISIS_SYS_ID_LEN); + return tree_sr_node_find(&area->srdb.sr_nodes[level - 1], &srn); +} + +static void isis_sr_adj_srgb_update(struct isis_area *area, uint8_t *sysid, + int level) +{ + struct sr_prefix *srp; + + frr_each (tree_sr_area_prefix, &area->srdb.prefix_sids[level - 1], + srp) { + struct listnode *node; + struct isis_nexthop *nh; + + if (srp->type == ISIS_SR_PREFIX_LOCAL) + continue; + + if (srp->u.remote.rinfo == NULL) + continue; + + for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, + nh)) { + if (memcmp(nh->sysid, sysid, ISIS_SYS_ID_LEN) != 0) + continue; + + /* + * Reinstall all Prefix-SID nexthops using route replace + * semantics. + */ + isis_sr_prefix_reinstall(srp, true); + break; + } + } +} + +void isis_sr_nexthop_update(struct sr_nexthop_info *srnh, mpls_label_t label) +{ + srnh->label = label; + if (srnh->uptime == 0) + srnh->uptime = time(NULL); +} + +void isis_sr_nexthop_reset(struct sr_nexthop_info *srnh) +{ + srnh->label = MPLS_INVALID_LABEL; + srnh->uptime = 0; +} + +/*----------------------------------------------------------------------------*/ + +/* Lookup IS-IS route in the SPT. */ +static struct isis_route_info * +isis_sr_prefix_lookup_route(struct isis_area *area, enum spf_tree_id tree_id, + struct sr_prefix *srp) +{ + struct route_node *rn; + int level = srp->srn->level; + + rn = route_node_lookup(area->spftree[tree_id][level - 1]->route_table, + &srp->prefix); + if (rn) { + route_unlock_node(rn); + if (rn->info) + return rn->info; + } + + return NULL; +} + +/* Calculate Prefix-SID input label. */ +static mpls_label_t isis_sr_prefix_in_label(const struct sr_prefix *srp) +{ + const struct sr_node *srn = srp->srn; + struct isis_area *area = srn->area; + + /* Absolute SID value. */ + if (CHECK_FLAG(srp->sid.flags, + ISIS_PREFIX_SID_VALUE | ISIS_PREFIX_SID_LOCAL)) + return srp->sid.value; + + /* Index SID value. */ + if (srp->sid.value >= (area->srdb.config.srgb_upper_bound + - area->srdb.config.srgb_lower_bound + 1)) { + flog_warn(EC_ISIS_SID_OVERFLOW, + "%s: SID index %u falls outside local SRGB range", + __func__, srp->sid.value); + return MPLS_INVALID_LABEL; + } + + return (area->srdb.config.srgb_lower_bound + srp->sid.value); +} + +/* Calculate Prefix-SID output label. */ +static mpls_label_t isis_sr_prefix_out_label(const struct sr_prefix *srp, + const struct sr_node *srn_nexthop, + const uint8_t *sysid) +{ + const struct sr_node *srn = srp->srn; + + /* Is the adjacency the last hop? */ + if (memcmp(sysid, srn->sysid, ISIS_SYS_ID_LEN) == 0) { + if (!CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_NO_PHP)) + return MPLS_LABEL_IMPLICIT_NULL; + + if (CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_EXPLICIT_NULL)) { + if (srp->prefix.family == AF_INET) + return MPLS_LABEL_IPV4_EXPLICIT_NULL; + else + return MPLS_LABEL_IPV6_EXPLICIT_NULL; + } + /* Fallthrough */ + } + + /* Absolute SID value. */ + if (CHECK_FLAG(srp->sid.flags, + ISIS_PREFIX_SID_VALUE | ISIS_PREFIX_SID_LOCAL)) { + /* + * V/L SIDs have local significance, so only adjacent routers + * can use them. + */ + if (srp->srn != srn_nexthop) + return MPLS_INVALID_LABEL; + return srp->sid.value; + } + + /* Index SID value. */ + if (srp->sid.value >= srn_nexthop->cap.srgb.range_size) { + flog_warn(EC_ISIS_SID_OVERFLOW, + "%s: SID index %u falls outside remote SRGB range", + __func__, srp->sid.value); + return MPLS_INVALID_LABEL; + } + + return (srn_nexthop->cap.srgb.lower_bound + srp->sid.value); +} + +/* Process local Prefix-SID and install it if possible. */ +static int isis_sr_prefix_install_local(struct sr_prefix *srp) +{ + const struct sr_node *srn = srp->srn; + struct isis_area *area = srn->area; + mpls_label_t local_label; + + /* + * No need to install LSP to local Prefix-SID unless the + * no-PHP option is configured. + */ + if (!CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_NO_PHP) + || CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_EXPLICIT_NULL)) + return -1; + + if (IS_DEBUG_ISIS(DEBUG_SR)) { + zlog_debug("ISIS-SR (%s) installing Prefix-SID %pFX %s %u (%s)", + area->area_tag, &srp->prefix, + CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE) + ? "label" + : "index", + srp->sid.value, circuit_t2string(srn->level)); + zlog_debug(" nexthop self"); + } + + /* Calculate local label. */ + local_label = isis_sr_prefix_in_label(srp); + if (local_label == MPLS_INVALID_LABEL) + return -1; + + /* Update internal state. */ + srp->local_label = local_label; + isis_sr_nexthop_update(&srp->u.local.info, MPLS_LABEL_IMPLICIT_NULL); + + /* Install Prefix-SID in the forwarding plane. */ + isis_zebra_install_prefix_sid(srp); + + return 0; +} + +/* Process remote Prefix-SID and install it if possible. */ +static int isis_sr_prefix_install_remote(struct sr_prefix *srp) +{ + const struct sr_node *srn = srp->srn; + struct isis_area *area = srn->area; + enum spf_tree_id tree_id; + struct listnode *node; + struct isis_nexthop *nexthop; + mpls_label_t local_label; + size_t nexthop_num = 0; + + /* Lookup associated IS-IS route. */ + tree_id = (srp->prefix.family == AF_INET) ? SPFTREE_IPV4 : SPFTREE_IPV6; + srp->u.remote.rinfo = isis_sr_prefix_lookup_route(area, tree_id, srp); + if (!srp->u.remote.rinfo) + /* SPF hasn't converged for this route yet. */ + return -1; + + if (IS_DEBUG_ISIS(DEBUG_SR)) + zlog_debug("ISIS-SR (%s) installing Prefix-SID %pFX %s %u (%s)", + area->area_tag, &srp->prefix, + CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE) + ? "label" + : "index", + srp->sid.value, circuit_t2string(srn->level)); + + /* Calculate local label. */ + local_label = isis_sr_prefix_in_label(srp); + if (local_label == MPLS_INVALID_LABEL) + return -1; + + for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, + nexthop)) { + struct sr_node *srn_nexthop; + mpls_label_t remote_label; + + /* Check if the nexthop advertised a SRGB. */ + srn_nexthop = + isis_sr_node_find(area, srn->level, nexthop->sysid); + if (!srn_nexthop) + goto next; + + /* + * Check if the nexthop can handle SR-MPLS encapsulated IPv4 or + * IPv6 packets. + */ + if ((nexthop->family == AF_INET + && !IS_SR_IPV4(srn_nexthop->cap.srgb)) + || (nexthop->family == AF_INET6 + && !IS_SR_IPV6(srn_nexthop->cap.srgb))) + goto next; + + remote_label = isis_sr_prefix_out_label(srp, srn_nexthop, + nexthop->sysid); + if (remote_label == MPLS_INVALID_LABEL) + goto next; + + if (IS_DEBUG_ISIS(DEBUG_SR)) { + static char buf[INET6_ADDRSTRLEN]; + + inet_ntop(nexthop->family, &nexthop->ip, buf, + sizeof(buf)); + zlog_debug(" nexthop %s label %u", buf, remote_label); + } + + isis_sr_nexthop_update(&nexthop->sr, remote_label); + nexthop_num++; + continue; + next: + isis_sr_nexthop_reset(&nexthop->sr); + } + if (nexthop_num == 0) { + if (IS_DEBUG_ISIS(DEBUG_SR)) + zlog_debug(" no valid nexthops"); + return -1; + } + + /* Update internal state. */ + srp->local_label = local_label; + + /* Install Prefix-SID in the forwarding plane. */ + isis_zebra_install_prefix_sid(srp); + + return 0; +} + +/* Process local or remote Prefix-SID and install it if possible. */ +static void isis_sr_prefix_install(struct sr_prefix *srp) +{ + const struct sr_node *srn = srp->srn; + struct isis_area *area = srn->area; + int ret; + + /* L1 routes are preferred over the L2 ones. */ + if (area->is_type == IS_LEVEL_1_AND_2) { + struct sr_prefix *srp_l1, *srp_l2; + + switch (srn->level) { + case ISIS_LEVEL1: + srp_l2 = isis_sr_prefix_find_area(area, ISIS_LEVEL2, + &srp->prefix); + if (srp_l2) + isis_sr_prefix_uninstall(srp_l2); + break; + case ISIS_LEVEL2: + srp_l1 = isis_sr_prefix_find_area(area, ISIS_LEVEL1, + &srp->prefix); + if (srp_l1) + return; + break; + default: + break; + } + } + + if (srp->type == ISIS_SR_PREFIX_LOCAL) + ret = isis_sr_prefix_install_local(srp); + else + ret = isis_sr_prefix_install_remote(srp); + if (ret != 0) + isis_sr_prefix_uninstall(srp); +} + +/* Uninstall local or remote Prefix-SID. */ +static void isis_sr_prefix_uninstall(struct sr_prefix *srp) +{ + const struct sr_node *srn = srp->srn; + struct listnode *node; + struct isis_nexthop *nexthop; + + if (srp->local_label == MPLS_INVALID_LABEL) + return; + + if (IS_DEBUG_ISIS(DEBUG_SR)) + zlog_debug( + "ISIS-SR (%s) uninstalling Prefix-SID %pFX %s %u (%s)", + srn->area->area_tag, &srp->prefix, + CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE) + ? "label" + : "index", + srp->sid.value, circuit_t2string(srn->level)); + + + /* Uninstall Prefix-SID from the forwarding plane. */ + isis_zebra_uninstall_prefix_sid(srp); + + /* Reset internal state. */ + srp->local_label = MPLS_INVALID_LABEL; + switch (srp->type) { + case ISIS_SR_PREFIX_LOCAL: + isis_sr_nexthop_reset(&srp->u.local.info); + break; + case ISIS_SR_PREFIX_REMOTE: + if (srp->u.remote.rinfo) { + for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, + node, nexthop)) + isis_sr_nexthop_reset(&nexthop->sr); + } + break; + } +} + +/* Reinstall local or remote Prefix-SID. */ +static void isis_sr_prefix_reinstall(struct sr_prefix *srp, + bool replace_semantics) +{ + /* + * Route replace semantics can be used only when we know for sure that + * the Prefix-SID input label hasn't changed. Otherwise we need to + * uninstall the Prefix-SID first using the old input label before + * reinstalling it. + */ + if (!replace_semantics) + isis_sr_prefix_uninstall(srp); + + isis_sr_prefix_install(srp); +} + +/*----------------------------------------------------------------------------*/ + +/* Parse all SR-related information from the given Router Capabilities TLV. */ +static struct sr_node * +isis_sr_parse_router_cap_tlv(struct isis_area *area, int level, + const uint8_t *sysid, + const struct isis_router_cap *router_cap) +{ + struct sr_node *srn; + + if (!router_cap || router_cap->srgb.range_size == 0) + return NULL; + + srn = isis_sr_node_find(area, level, sysid); + if (srn) { + if (memcmp(&srn->cap, router_cap, sizeof(srn->cap)) != 0) { + srn->cap = *router_cap; + SET_FLAG(srn->parse_flags, F_ISIS_SR_NODE_MODIFIED); + } else + SET_FLAG(srn->parse_flags, F_ISIS_SR_NODE_UNCHANGED); + } else { + srn = isis_sr_node_add(area, level, sysid, router_cap); + SET_FLAG(srn->parse_flags, F_ISIS_SR_NODE_NEW); + } + + return srn; +} + +/* Parse list of Prefix-SID Sub-TLVs. */ +static void isis_sr_parse_prefix_sid_subtlvs(struct sr_node *srn, + union prefixconstptr prefix, + bool local, + struct isis_item_list *prefix_sids) +{ + struct isis_area *area = srn->area; + struct isis_item *i; + + for (i = prefix_sids->head; i; i = i->next) { + struct isis_prefix_sid *psid = (struct isis_prefix_sid *)i; + struct sr_prefix *srp; + + if (psid->algorithm != SR_ALGORITHM_SPF) + continue; + + srp = isis_sr_prefix_find_node(srn, prefix); + if (srp) { + if (srp->sid.flags != psid->flags + || srp->sid.algorithm != psid->algorithm + || srp->sid.value != psid->value) { + srp->sid = *psid; + SET_FLAG(srp->parse_flags, + F_ISIS_SR_PREFIX_SID_MODIFIED); + } else + SET_FLAG(srp->parse_flags, + F_ISIS_SR_PREFIX_SID_UNCHANGED); + } else { + srp = isis_sr_prefix_add(area, srn, prefix, local, + psid); + SET_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_NEW); + } + /* + * Stop the Prefix-SID iteration since we only support the SPF + * algorithm for now. + */ + break; + } +} + +/* Parse all SR-related information from the given LSP. */ +static void isis_sr_parse_lsp(struct isis_area *area, int level, + struct sr_node **srn, struct isis_lsp *lsp) +{ + struct isis_item_list *items; + struct isis_item *i; + bool local = lsp->own_lsp; + + if (lsp->hdr.seqno == 0) { + zlog_warn("%s: lsp with 0 seq_num - ignore", __func__); + return; + } + + /* Parse the Router Capability TLV. */ + if (*srn == NULL) { + *srn = isis_sr_parse_router_cap_tlv( + area, level, lsp->hdr.lsp_id, lsp->tlvs->router_cap); + if (!*srn) + return; + } + + /* Parse the Extended IP Reachability TLV. */ + items = &lsp->tlvs->extended_ip_reach; + for (i = items->head; i; i = i->next) { + struct isis_extended_ip_reach *ir; + + ir = (struct isis_extended_ip_reach *)i; + if (!ir->subtlvs) + continue; + + isis_sr_parse_prefix_sid_subtlvs(*srn, &ir->prefix, local, + &ir->subtlvs->prefix_sids); + } + + /* Parse Multi Topology Reachable IPv6 Prefixes TLV. */ + items = isis_lookup_mt_items(&lsp->tlvs->mt_ipv6_reach, + ISIS_MT_IPV6_UNICAST); + for (i = items ? items->head : NULL; i; i = i->next) { + struct isis_ipv6_reach *ir; + + ir = (struct isis_ipv6_reach *)i; + if (!ir->subtlvs) + continue; + + isis_sr_parse_prefix_sid_subtlvs(*srn, &ir->prefix, local, + &ir->subtlvs->prefix_sids); + } +} + +/* Parse all SR-related information from the entire LSPDB. */ +static void isis_sr_parse_lspdb(struct isis_area *area) +{ + struct isis_lsp *lsp; + + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { + frr_each (lspdb, &area->lspdb[level - 1], lsp) { + struct isis_lsp *frag; + struct listnode *node; + struct sr_node *srn = NULL; + + if (LSP_PSEUDO_ID(lsp->hdr.lsp_id)) + continue; + if (!lsp->tlvs) + continue; + + isis_sr_parse_lsp(area, level, &srn, lsp); + for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) + isis_sr_parse_lsp(area, level, &srn, frag); + } + } +} + +/* Process any new/deleted/modified Prefix-SID in the LSPDB. */ +static void isis_sr_process_prefix_changes(struct sr_node *srn, + struct sr_prefix *srp) +{ + struct isis_area *area = srn->area; + + /* Log any Prefix-SID change in the LSPDB. */ + if (IS_DEBUG_ISIS(DEBUG_SR)) { + if (CHECK_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_NEW)) + zlog_debug( + "ISIS-SR (%s) Prefix-SID created: %pFX (sysid %s)", + area->area_tag, &srp->prefix, + sysid_print(srn->sysid)); + else if (CHECK_FLAG(srp->parse_flags, + F_ISIS_SR_PREFIX_SID_MODIFIED)) + zlog_debug( + "ISIS-SR (%s) Prefix-SID modified: %pFX (sysid %s)", + area->area_tag, &srp->prefix, + sysid_print(srn->sysid)); + else if (!CHECK_FLAG(srp->parse_flags, + F_ISIS_SR_PREFIX_SID_UNCHANGED)) + zlog_debug( + "ISIS-SR (%s) Prefix-SID removed: %pFX (sysid %s)", + area->area_tag, &srp->prefix, + sysid_print(srn->sysid)); + } + + /* Install/reinstall/uninstall Prefix-SID if necessary. */ + if (CHECK_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_NEW)) + isis_sr_prefix_install(srp); + else if (CHECK_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_MODIFIED)) + isis_sr_prefix_reinstall(srp, false); + else if (!CHECK_FLAG(srp->parse_flags, + F_ISIS_SR_PREFIX_SID_UNCHANGED)) { + isis_sr_prefix_del(area, srn, srp); + return; + } + + srp->parse_flags = 0; +} + +/* Process any new/deleted/modified SRGB in the LSPDB. */ +static void isis_sr_process_node_changes(struct isis_area *area, int level, + struct sr_node *srn) +{ + struct sr_prefix *srp; + uint8_t sysid[ISIS_SYS_ID_LEN]; + bool adjacent; + + memcpy(sysid, srn->sysid, sizeof(sysid)); + + /* Log any SRGB change in the LSPDB. */ + if (IS_DEBUG_ISIS(DEBUG_SR)) { + if (CHECK_FLAG(srn->parse_flags, F_ISIS_SR_NODE_NEW)) + zlog_debug("ISIS-SR (%s) SRGB created (sysid %s)", + area->area_tag, sysid_print(sysid)); + else if (CHECK_FLAG(srn->parse_flags, F_ISIS_SR_NODE_MODIFIED)) + zlog_debug("ISIS-SR (%s) SRGB modified (sysid %s)", + area->area_tag, sysid_print(sysid)); + else if (!CHECK_FLAG(srn->parse_flags, + F_ISIS_SR_NODE_UNCHANGED)) + zlog_debug("ISIS-SR (%s) SRGB removed (sysid %s)", + area->area_tag, sysid_print(sysid)); + } + + /* + * If an adjacent router's SRGB was changed or created, then reinstall + * all Prefix-SIDs from all nodes. + */ + adjacent = isis_adj_exists(area, level, sysid); + if (CHECK_FLAG(srn->parse_flags, + F_ISIS_SR_NODE_NEW | F_ISIS_SR_NODE_MODIFIED)) { + if (adjacent) + isis_sr_adj_srgb_update(area, sysid, level); + } else if (!CHECK_FLAG(srn->parse_flags, F_ISIS_SR_NODE_UNCHANGED)) { + isis_sr_node_del(area, level, srn); + + if (adjacent) + isis_sr_adj_srgb_update(area, sysid, level); + return; + } + + srn->parse_flags = 0; + + frr_each_safe (tree_sr_node_prefix, &srn->prefix_sids, srp) + isis_sr_process_prefix_changes(srn, srp); +} + +/* Parse and process all SR-related Sub-TLVs after running the SPF algorithm. */ +void isis_area_verify_sr(struct isis_area *area) +{ + struct sr_node *srn; + + if (!area->srdb.enabled) + return; + + /* Parse LSPDB to detect new/deleted/modified SR (sub-)TLVs. */ + isis_sr_parse_lspdb(area); + + /* Process possible SR-related changes in the LDPSB. */ + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { + frr_each_safe (tree_sr_node, &area->srdb.sr_nodes[level - 1], + srn) + isis_sr_process_node_changes(area, level, srn); + } +} + +/* + * Once a route is updated in the SPT, reinstall or uninstall its corresponding + * Prefix-SID (if any). + */ +static int isis_sr_route_update(struct isis_area *area, struct prefix *prefix, + struct isis_route_info *route_info) +{ + struct sr_prefix *srp; + + if (!area->srdb.enabled) + return 0; + + switch (area->is_type) { + case IS_LEVEL_1: + srp = isis_sr_prefix_find_area(area, ISIS_LEVEL1, prefix); + break; + case IS_LEVEL_2: + srp = isis_sr_prefix_find_area(area, ISIS_LEVEL2, prefix); + break; + case IS_LEVEL_1_AND_2: + srp = isis_sr_prefix_find_area(area, ISIS_LEVEL1, prefix); + if (!srp) + srp = isis_sr_prefix_find_area(area, ISIS_LEVEL2, + prefix); + break; + default: + flog_err(EC_LIB_DEVELOPMENT, "%s: unknown area level", + __func__); + exit(1); + } + + if (!srp || srp->type == ISIS_SR_PREFIX_LOCAL) + return 0; + + if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) { + isis_sr_prefix_reinstall(srp, true); + srp->u.remote.rinfo = route_info; + } else { + isis_sr_prefix_uninstall(srp); + srp->u.remote.rinfo = NULL; + } + + return 0; +} + +/*----------------------------------------------------------------------------*/ + +/* Install or uninstall (LAN)-Adj-SID. */ +static void isis_sr_adj_sid_install_uninstall(bool install, + const struct sr_adjacency *sra) +{ + struct zapi_labels zl; + struct zapi_nexthop_label *znh; + int cmd; + + cmd = install ? ZEBRA_MPLS_LABELS_ADD : ZEBRA_MPLS_LABELS_DELETE; + + memset(&zl, 0, sizeof(zl)); + zl.type = ZEBRA_LSP_ISIS_SR; + zl.local_label = sra->nexthop.label; + zl.nexthop_num = 1; + znh = &zl.nexthops[0]; + znh->family = sra->nexthop.family; + znh->address = sra->nexthop.address; + znh->type = (sra->nexthop.family == AF_INET) + ? NEXTHOP_TYPE_IPV4_IFINDEX + : NEXTHOP_TYPE_IPV6_IFINDEX; + znh->ifindex = sra->adj->circuit->interface->ifindex; + znh->label = MPLS_LABEL_IMPLICIT_NULL; + + (void)zebra_send_mpls_labels(zclient, cmd, &zl); +} + +/* Add new local Adj-SID. */ +static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, + bool backup) +{ + struct isis_circuit *circuit = adj->circuit; + struct isis_area *area = circuit->area; + struct sr_adjacency *sra; + struct isis_adj_sid *adj_sid; + struct isis_lan_adj_sid *ladj_sid; + union g_addr nexthop = {}; + uint8_t flags; + mpls_label_t local_label; + + switch (family) { + case AF_INET: + if (!circuit->ip_router) + return; + + nexthop.ipv4 = adj->ipv4_addresses[0]; + break; + case AF_INET6: + if (!circuit->ipv6_router) + return; + + nexthop.ipv6 = adj->ipv6_addresses[0]; + break; + default: + flog_err(EC_LIB_DEVELOPMENT, + "%s: unexpected address-family: %u", __func__, family); + exit(1); + } + + flags = EXT_SUBTLV_LINK_ADJ_SID_VFLG | EXT_SUBTLV_LINK_ADJ_SID_LFLG; + if (family == AF_INET6) + SET_FLAG(flags, EXT_SUBTLV_LINK_ADJ_SID_FFLG); + if (backup) + SET_FLAG(flags, EXT_SUBTLV_LINK_ADJ_SID_BFLG); + + local_label = isis_zebra_request_dynamic_label(); + if (circuit->ext == NULL) + circuit->ext = isis_alloc_ext_subtlvs(); + + if (IS_DEBUG_ISIS(DEBUG_SR)) { + char buf[INET6_ADDRSTRLEN]; + + inet_ntop(family, &nexthop, buf, sizeof(buf)); + zlog_debug("ISIS-SR (%s) installing Adj-SID %s%%%s label %u", + area->area_tag, buf, circuit->interface->name, + local_label); + } + + sra = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*sra)); + sra->type = backup ? ISIS_SR_LAN_BACKUP : ISIS_SR_ADJ_NORMAL; + sra->nexthop.family = family; + sra->nexthop.address = nexthop; + sra->nexthop.label = local_label; + switch (circuit->circ_type) { + case CIRCUIT_T_BROADCAST: + ladj_sid = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*ladj_sid)); + ladj_sid->family = family; + ladj_sid->flags = flags; + ladj_sid->weight = 0; + memcpy(ladj_sid->neighbor_id, adj->sysid, + sizeof(ladj_sid->neighbor_id)); + ladj_sid->sid = local_label; + isis_tlvs_add_lan_adj_sid(circuit->ext, ladj_sid); + sra->u.ladj_sid = ladj_sid; + break; + case CIRCUIT_T_P2P: + adj_sid = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*adj_sid)); + adj_sid->family = family; + adj_sid->flags = flags; + adj_sid->weight = 0; + adj_sid->sid = local_label; + isis_tlvs_add_adj_sid(circuit->ext, adj_sid); + sra->u.adj_sid = adj_sid; + break; + default: + flog_err(EC_LIB_DEVELOPMENT, "%s: unexpected circuit type: %u", + __func__, circuit->circ_type); + exit(1); + } + sra->adj = adj; + listnode_add(area->srdb.adj_sids, sra); + listnode_add(adj->adj_sids, sra); + + isis_sr_adj_sid_install_uninstall(true, sra); +} + +static void isis_sr_adj_sid_add(struct isis_adjacency *adj, int family) +{ + isis_sr_adj_sid_add_single(adj, family, false); + isis_sr_adj_sid_add_single(adj, family, true); +} + +/* Delete local Adj-SID. */ +static void isis_sr_adj_sid_del(struct sr_adjacency *sra) +{ + struct isis_circuit *circuit = sra->adj->circuit; + struct isis_area *area = circuit->area; + + if (IS_DEBUG_ISIS(DEBUG_SR)) { + char buf[INET6_ADDRSTRLEN]; + + inet_ntop(sra->nexthop.family, &sra->nexthop.address, buf, + sizeof(buf)); + zlog_debug("ISIS-SR (%s) uninstalling Adj-SID %s%%%s", + area->area_tag, buf, circuit->interface->name); + } + + isis_sr_adj_sid_install_uninstall(false, sra); + + switch (circuit->circ_type) { + case CIRCUIT_T_BROADCAST: + isis_zebra_release_dynamic_label(sra->u.ladj_sid->sid); + isis_tlvs_del_lan_adj_sid(circuit->ext, sra->u.ladj_sid); + break; + case CIRCUIT_T_P2P: + isis_zebra_release_dynamic_label(sra->u.adj_sid->sid); + isis_tlvs_del_adj_sid(circuit->ext, sra->u.adj_sid); + break; + default: + flog_err(EC_LIB_DEVELOPMENT, "%s: unexpected circuit type: %u", + __func__, circuit->circ_type); + exit(1); + } + + listnode_delete(area->srdb.adj_sids, sra); + listnode_delete(sra->adj->adj_sids, sra); + XFREE(MTYPE_ISIS_SR_INFO, sra); +} + +/* Remove all Adj-SIDs associated to an adjacency that is going down. */ +static int isis_sr_adj_state_change(struct isis_adjacency *adj) +{ + struct sr_adjacency *sra; + struct listnode *node, *nnode; + + if (!adj->circuit->area->srdb.enabled) + return 0; + + if (adj->adj_state == ISIS_ADJ_UP) + return 0; + + for (ALL_LIST_ELEMENTS(adj->adj_sids, node, nnode, sra)) + isis_sr_adj_sid_del(sra); + + return 0; +} + +/* + * Adjacency now has one or more IPv4/IPv6 addresses. Add new IPv4 or IPv6 + * Adj-SID accordingly. + */ +static int isis_sr_adj_ip_enabled(struct isis_adjacency *adj, int family) +{ + if (!adj->circuit->area->srdb.enabled) + return 0; + + isis_sr_adj_sid_add(adj, family); + + return 0; +} + +/* + * Adjacency doesn't have any IPv4 or IPv6 addresses anymore. Delete the + * corresponding Adj-SID(s) accordingly. + */ +static int isis_sr_adj_ip_disabled(struct isis_adjacency *adj, int family) +{ + struct sr_adjacency *sra; + struct listnode *node, *nnode; + + if (!adj->circuit->area->srdb.enabled) + return 0; + + for (ALL_LIST_ELEMENTS(adj->adj_sids, node, nnode, sra)) + if (sra->nexthop.family == family) + isis_sr_adj_sid_del(sra); + + return 0; +} + +static int isis_sr_if_new_hook(struct interface *ifp) +{ + struct isis_circuit *circuit; + struct isis_area *area; + struct connected *connected; + struct listnode *node; + + circuit = circuit_scan_by_ifp(ifp); + if (!circuit) + return 0; + + area = circuit->area; + if (!area) + return 0; + + /* + * Update the Node-SID flag of the configured Prefix-SID mappings if + * necessary. This needs to be done here since isisd reads the startup + * configuration before receiving interface information from zebra. + */ + FOR_ALL_INTERFACES_ADDRESSES (ifp, connected, node) { + struct sr_prefix_cfg *pcfg; + + pcfg = isis_sr_cfg_prefix_find(area, connected->address); + if (!pcfg) + continue; + + if (isis_sr_prefix_is_node_sid(ifp, &pcfg->prefix) + && !pcfg->node_sid) { + pcfg->node_sid = true; + lsp_regenerate_schedule(area, area->is_type, 0); + } + } + + return 0; +} + +/*----------------------------------------------------------------------------*/ + +static void isis_sr_show_prefix_sid_local(struct vty *vty, struct ttable *tt, + const struct isis_area *area, + const struct sr_prefix *srp) +{ + const struct sr_nexthop_info *srnh = &srp->u.local.info; + char buf_prefix[BUFSIZ]; + char buf_llabel[BUFSIZ]; + char buf_rlabel[BUFSIZ]; + char buf_uptime[BUFSIZ]; + + if (srp->local_label != MPLS_INVALID_LABEL) + label2str(srp->local_label, buf_llabel, sizeof(buf_llabel)); + else + snprintf(buf_llabel, sizeof(buf_llabel), "-"); + if (srnh->label != MPLS_INVALID_LABEL) { + label2str(srnh->label, buf_rlabel, sizeof(buf_rlabel)); + log_uptime(srnh->uptime, buf_uptime, sizeof(buf_uptime)); + } else { + snprintf(buf_rlabel, sizeof(buf_rlabel), "-"); + snprintf(buf_uptime, sizeof(buf_uptime), "-"); + } + + ttable_add_row(tt, "%s|%u|%s|local|%s|%s", + prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)), + srp->sid.value, buf_llabel, buf_rlabel, buf_uptime); +} + +static void isis_sr_show_prefix_sid_remote(struct vty *vty, struct ttable *tt, + const struct isis_area *area, + const struct sr_prefix *srp) +{ + struct isis_nexthop *nexthop; + struct listnode *node; + char buf_prefix[BUFSIZ]; + char buf_llabel[BUFSIZ]; + char buf_nhop[BUFSIZ]; + char buf_iface[BUFSIZ]; + char buf_rlabel[BUFSIZ]; + char buf_uptime[BUFSIZ]; + bool first = true; + + (void)prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)); + if (srp->local_label != MPLS_INVALID_LABEL) + label2str(srp->local_label, buf_llabel, sizeof(buf_llabel)); + else + snprintf(buf_llabel, sizeof(buf_llabel), "-"); + + if (!srp->u.remote.rinfo) { + ttable_add_row(tt, "%s|%u|%s|-|-|-", buf_prefix, srp->sid.value, + buf_llabel); + return; + } + + for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, + nexthop)) { + struct interface *ifp; + + inet_ntop(nexthop->family, &nexthop->ip, buf_nhop, + sizeof(buf_nhop)); + ifp = if_lookup_by_index(nexthop->ifindex, VRF_DEFAULT); + if (ifp) + strlcpy(buf_iface, ifp->name, sizeof(buf_iface)); + else + snprintf(buf_iface, sizeof(buf_iface), "ifindex %u", + nexthop->ifindex); + if (nexthop->sr.label == MPLS_INVALID_LABEL) { + snprintf(buf_rlabel, sizeof(buf_rlabel), "-"); + snprintf(buf_uptime, sizeof(buf_uptime), "-"); + } else { + label2str(nexthop->sr.label, buf_rlabel, + sizeof(buf_rlabel)); + log_uptime(nexthop->sr.uptime, buf_uptime, + sizeof(buf_uptime)); + } + + if (first) + ttable_add_row(tt, "%s|%u|%s|%s, %s|%s|%s", buf_prefix, + srp->sid.value, buf_llabel, buf_nhop, + buf_iface, buf_rlabel, buf_uptime); + else + ttable_add_row(tt, "|||%s, %s|%s|%s", buf_nhop, + buf_iface, buf_rlabel, buf_uptime); + first = false; + } +} + +static void isis_sr_show_prefix_sids(struct vty *vty, struct isis_area *area, + int level) +{ + struct sr_prefix *srp; + struct ttable *tt; + + if (tree_sr_area_prefix_count(&area->srdb.prefix_sids[level - 1]) == 0) + return; + + vty_out(vty, " IS-IS %s Prefix-SIDs:\n\n", circuit_t2string(level)); + + /* Prepare table. */ + tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]); + ttable_add_row(tt, "Prefix|SID|In Label|Nexthop|Out Label|Uptime"); + tt->style.cell.rpad = 2; + tt->style.corner = '+'; + ttable_restyle(tt); + ttable_rowseps(tt, 0, BOTTOM, true, '-'); + + frr_each (tree_sr_area_prefix, &area->srdb.prefix_sids[level - 1], + srp) { + switch (srp->type) { + case ISIS_SR_PREFIX_LOCAL: + isis_sr_show_prefix_sid_local(vty, tt, area, srp); + break; + case ISIS_SR_PREFIX_REMOTE: + isis_sr_show_prefix_sid_remote(vty, tt, area, srp); + break; + } + } + + /* Dump the generated table. */ + if (tt->nrows > 1) { + char *table; + + table = ttable_dump(tt, "\n"); + vty_out(vty, "%s\n", table); + XFREE(MTYPE_TMP, table); + } + ttable_del(tt); +} + +DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, + "show isis segment-routing prefix-sids", + SHOW_STR PROTO_HELP + "Segment-Routing\n" + "Segment-Routing Prefix-SIDs\n") +{ + struct listnode *node; + struct isis_area *area; + + for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) { + vty_out(vty, "Area %s:\n", + area->area_tag ? area->area_tag : "null"); + + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) + isis_sr_show_prefix_sids(vty, area, level); + } + + return CMD_SUCCESS; +} + +/*----------------------------------------------------------------------------*/ + +/* Try to enable SR on the given IS-IS area. */ +int isis_sr_start(struct isis_area *area) +{ + struct isis_sr_db *srdb = &area->srdb; + struct isis_circuit *circuit; + struct listnode *node; + + /* + * Request SGRB to the label manager. If the allocation fails, return + * an error to disable SR until a new SRGB is successfully allocated. + */ + if (isis_zebra_request_label_range( + srdb->config.srgb_lower_bound, + srdb->config.srgb_upper_bound + - srdb->config.srgb_lower_bound + 1)) + return -1; + + if (IS_DEBUG_ISIS(DEBUG_SR)) + zlog_debug("ISIS-SR (%s) Starting Segment Routing", + area->area_tag); + + /* Create Adj-SIDs for existing adjacencies. */ + for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { + struct isis_adjacency *adj; + struct listnode *anode; + + switch (circuit->circ_type) { + case CIRCUIT_T_BROADCAST: + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; + level++) { + for (ALL_LIST_ELEMENTS_RO( + circuit->u.bc.adjdb[level - 1], + anode, adj)) { + if (adj->ipv4_address_count > 0) + isis_sr_adj_sid_add(adj, + AF_INET); + if (adj->ipv6_address_count > 0) + isis_sr_adj_sid_add(adj, + AF_INET6); + } + } + break; + case CIRCUIT_T_P2P: + adj = circuit->u.p2p.neighbor; + if (adj && adj->ipv4_address_count > 0) + isis_sr_adj_sid_add(adj, AF_INET); + if (adj && adj->ipv6_address_count > 0) + isis_sr_adj_sid_add(adj, AF_INET6); + break; + default: + break; + } + } + + /* Regenerate LSPs. */ + lsp_regenerate_schedule(area, area->is_type, 0); + + return 0; +} + +/* Disable SR on the given IS-IS area. */ +void isis_sr_stop(struct isis_area *area) +{ + struct isis_sr_db *srdb = &area->srdb; + struct sr_adjacency *sra; + struct listnode *node, *nnode; + + if (IS_DEBUG_ISIS(DEBUG_SR)) + zlog_debug("ISIS-SR (%s) Stopping Segment Routing", + area->area_tag); + + /* Uninstall Adj-SIDs. */ + for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra)) + isis_sr_adj_sid_del(sra); + + /* Uninstall Prefix-SIDs. */ + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { + while (tree_sr_node_count(&srdb->sr_nodes[level - 1]) > 0) { + struct sr_node *srn; + + srn = tree_sr_node_first(&srdb->sr_nodes[level - 1]); + isis_sr_node_del(area, level, srn); + } + } + + /* Release SRGB. */ + isis_zebra_release_label_range(srdb->config.srgb_lower_bound, + srdb->config.srgb_upper_bound); + + /* Regenerate LSPs. */ + lsp_regenerate_schedule(area, area->is_type, 0); +} + +void isis_sr_area_init(struct isis_area *area) +{ + struct isis_sr_db *srdb = &area->srdb; + + memset(srdb, 0, sizeof(*srdb)); + srdb->enabled = false; + srdb->adj_sids = list_new(); + + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { + tree_sr_node_init(&srdb->sr_nodes[level - 1]); + tree_sr_area_prefix_init(&srdb->prefix_sids[level - 1]); + } + + /* Pull defaults from the YANG module. */ +#ifndef FABRICD + srdb->config.enabled = yang_get_default_bool("%s/enabled", ISIS_SR); + srdb->config.srgb_lower_bound = + yang_get_default_uint32("%s/srgb/lower-bound", ISIS_SR); + srdb->config.srgb_upper_bound = + yang_get_default_uint32("%s/srgb/upper-bound", ISIS_SR); +#else + srdb->config.enabled = false; + srdb->config.srgb_lower_bound = SRGB_LOWER_BOUND; + srdb->config.srgb_upper_bound = SRGB_UPPER_BOUND; +#endif + srdb->config.msd = 0; + tree_sr_prefix_cfg_init(&srdb->config.prefix_sids); +} + +void isis_sr_area_term(struct isis_area *area) +{ + struct isis_sr_db *srdb = &area->srdb; + + /* Stop Segment Routing */ + if (area->srdb.enabled) + isis_sr_stop(area); + + /* Clear Prefix-SID configuration. */ + while (tree_sr_prefix_cfg_count(&srdb->config.prefix_sids) > 0) { + struct sr_prefix_cfg *pcfg; + + pcfg = tree_sr_prefix_cfg_first(&srdb->config.prefix_sids); + isis_sr_cfg_prefix_del(pcfg); + } +} + +void isis_sr_init(void) +{ + install_element(VIEW_NODE, &show_sr_prefix_sids_cmd); + + /* Register hooks. */ + hook_register(isis_adj_state_change_hook, isis_sr_adj_state_change); + hook_register(isis_adj_ip_enabled_hook, isis_sr_adj_ip_enabled); + hook_register(isis_adj_ip_disabled_hook, isis_sr_adj_ip_disabled); + hook_register(isis_route_update_hook, isis_sr_route_update); + hook_register(isis_if_new_hook, isis_sr_if_new_hook); +} + +void isis_sr_term(void) +{ + /* Unregister hooks. */ + hook_unregister(isis_adj_state_change_hook, isis_sr_adj_state_change); + hook_unregister(isis_adj_ip_enabled_hook, isis_sr_adj_ip_enabled); + hook_unregister(isis_adj_ip_disabled_hook, isis_sr_adj_ip_disabled); + hook_unregister(isis_route_update_hook, isis_sr_route_update); + hook_unregister(isis_if_new_hook, isis_sr_if_new_hook); +} diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h new file mode 100644 index 0000000000..286ebeb953 --- /dev/null +++ b/isisd/isis_sr.h @@ -0,0 +1,259 @@ +/* + * This is an implementation of Segment Routing for IS-IS + * as per draft draft-ietf-isis-segment-routing-extensions-25 + * + * Copyright (C) 2019 Orange Labs http://www.orange.com + * + * Author: Olivier Dugeon + * Contributor: Renato Westphal for NetDEF + * + * 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_SR_H +#define _FRR_ISIS_SR_H + +#include "lib/linklist.h" +#include "lib/mpls.h" +#include "lib/nexthop.h" +#include "lib/typesafe.h" + +#include "isisd/isis_tlvs.h" + +/* + * Segment Routing information is transported through the following Sub-TLVs: + * + * Sub-TLV Name Value TLVs + * --------------------------------------------------------------------- + * SID Label 1 + * + * Prefix Segment Identifier 3 135, 235, 236 and 237 + * + * Adjacency Segment Identifier 31 22, 23, 141, 222 and 223 + * LAN Adjacency Segment Identifier 32 22, 23, 141, 222 and 223 + * + * Segment Routing Capability 2 242 + * Segment Routing Algorithm 19 242 + * Node Maximum Stack Depth (MSD) 23 242 + * + * Sub-TLV definitions, serialization and de-serialization are defined + * in isis_tlvs.[c,h]. + */ + +#define SRGB_LOWER_BOUND 16000 +#define SRGB_UPPER_BOUND 23999 + +PREDECL_RBTREE_UNIQ(tree_sr_node) +PREDECL_RBTREE_UNIQ(tree_sr_node_prefix) +PREDECL_RBTREE_UNIQ(tree_sr_area_prefix) +PREDECL_RBTREE_UNIQ(tree_sr_prefix_cfg) + +/* SR Adj-SID type. */ +enum sr_adj_type { + ISIS_SR_ADJ_NORMAL = 0, + ISIS_SR_LAN_BACKUP, +}; + +/* SR Adjacency. */ +struct sr_adjacency { + /* Adjacency type. */ + enum sr_adj_type type; + + /* Adj-SID nexthop information. */ + struct { + int family; + union g_addr address; + mpls_label_t label; + } nexthop; + + /* (LAN-)Adj-SID Sub-TLV. */ + union { + struct isis_adj_sid *adj_sid; + struct isis_lan_adj_sid *ladj_sid; + } u; + + /* Back pointer to IS-IS adjacency. */ + struct isis_adjacency *adj; +}; + +/* SR Prefix-SID type. */ +enum sr_prefix_type { + ISIS_SR_PREFIX_LOCAL = 0, + ISIS_SR_PREFIX_REMOTE, +}; + +/* SR Nexthop Information. */ +struct sr_nexthop_info { + mpls_label_t label; + time_t uptime; +}; + +/* SR Prefix-SID. */ +struct sr_prefix { + /* RB-tree entries. */ + struct tree_sr_node_prefix_item node_entry; + struct tree_sr_area_prefix_item area_entry; + + /* IP prefix. */ + struct prefix prefix; + + /* SID value, algorithm and flags. */ + struct isis_prefix_sid sid; + + /* Local label value. */ + mpls_label_t local_label; + + /* Prefix-SID type. */ + enum sr_prefix_type type; + union { + struct { + /* Information about this local Prefix-SID. */ + struct sr_nexthop_info info; + } local; + struct { + /* Route associated to this remote Prefix-SID. */ + struct isis_route_info *rinfo; + } remote; + } u; + + /* Backpointer to SR node. */ + struct sr_node *srn; + + /* Flags used while the LSPDB is being parsed. */ + uint8_t parse_flags; +#define F_ISIS_SR_PREFIX_SID_NEW 0x01 +#define F_ISIS_SR_PREFIX_SID_MODIFIED 0x02 +#define F_ISIS_SR_PREFIX_SID_UNCHANGED 0x04 +}; + +/* SR node. */ +struct sr_node { + /* RB-tree entry. */ + struct tree_sr_node_item entry; + + /* IS-IS level: ISIS_LEVEL1 or ISIS_LEVEL2. */ + int level; + + /* IS-IS node identifier. */ + uint8_t sysid[ISIS_SYS_ID_LEN]; + + /* IS-IS node capabilities (SRGB, SR Algorithms, etc). */ + struct isis_router_cap cap; + + /* List of Prefix-SIDs advertised by this node. */ + struct tree_sr_node_prefix_head prefix_sids; + + /* Backpointer to IS-IS area. */ + struct isis_area *area; + + /* Flags used while the LSPDB is being parsed. */ + uint8_t parse_flags; +#define F_ISIS_SR_NODE_NEW 0x01 +#define F_ISIS_SR_NODE_MODIFIED 0x02 +#define F_ISIS_SR_NODE_UNCHANGED 0x04 +}; + +/* NOTE: these values must be in sync with the YANG module. */ +enum sr_sid_value_type { + SR_SID_VALUE_TYPE_INDEX = 0, + SR_SID_VALUE_TYPE_ABSOLUTE = 1, +}; + +/* NOTE: these values must be in sync with the YANG module. */ +enum sr_last_hop_behavior { + SR_LAST_HOP_BEHAVIOR_EXP_NULL = 0, + SR_LAST_HOP_BEHAVIOR_NO_PHP = 1, + SR_LAST_HOP_BEHAVIOR_PHP = 2, +}; + +/* SR Prefix-SID configuration. */ +struct sr_prefix_cfg { + /* RB-tree entry. */ + struct tree_sr_prefix_cfg_item entry; + + /* IP prefix. */ + struct prefix prefix; + + /* SID value. */ + uint32_t sid; + + /* SID value type. */ + enum sr_sid_value_type sid_type; + + /* SID last hop behavior. */ + enum sr_last_hop_behavior last_hop_behavior; + + /* Does this Prefix-SID refer to a loopback address (Node-SID)? */ + bool node_sid; + + /* Backpointer to IS-IS area. */ + struct isis_area *area; +}; + +/* Per-area IS-IS Segment Routing information. */ +struct isis_sr_db { + /* Operational status of Segment Routing. */ + bool enabled; + + /* Adj-SIDs. */ + struct list *adj_sids; + + /* SR information from all nodes. */ + struct tree_sr_node_head sr_nodes[ISIS_LEVELS]; + + /* Prefix-SIDs. */ + struct tree_sr_area_prefix_head prefix_sids[ISIS_LEVELS]; + + /* Area SR configuration. */ + struct { + /* Administrative status of Segment Routing. */ + bool enabled; + + /* Segment Routing Global Block lower & upper bound. */ + uint32_t srgb_lower_bound; + uint32_t srgb_upper_bound; + + /* Maximum SID Depth supported by the node. */ + uint8_t msd; + + /* Prefix-SID mappings. */ + struct tree_sr_prefix_cfg_head prefix_sids; + } config; +}; + +/* Prototypes. */ +extern int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, + uint32_t upper_bound); +extern void isis_sr_cfg_msd_update(struct isis_area *area); +extern struct sr_prefix_cfg * +isis_sr_cfg_prefix_add(struct isis_area *area, const struct prefix *prefix); +extern void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg); +extern struct sr_prefix_cfg * +isis_sr_cfg_prefix_find(struct isis_area *area, union prefixconstptr prefix); +extern void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, + bool external, + struct isis_prefix_sid *psid); +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 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); +extern void isis_sr_area_init(struct isis_area *area); +extern void isis_sr_area_term(struct isis_area *area); +extern void isis_sr_init(void); +extern void isis_sr_term(void); + +#endif /* _FRR_ISIS_SR_H */ diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 761005d0cd..be88ee85a6 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -43,9 +43,10 @@ #include "isisd/isis_pdu.h" #include "isisd/isis_lsp.h" #include "isisd/isis_te.h" +#include "isisd/isis_sr.h" DEFINE_MTYPE_STATIC(ISISD, ISIS_TLV, "ISIS TLVs") -DEFINE_MTYPE_STATIC(ISISD, ISIS_SUBTLV, "ISIS Sub-TLVs") +DEFINE_MTYPE(ISISD, ISIS_SUBTLV, "ISIS Sub-TLVs") DEFINE_MTYPE_STATIC(ISISD, ISIS_MT_ITEM_LIST, "ISIS MT Item Lists") typedef int (*unpack_tlv_func)(enum isis_tlv_context context, uint8_t tlv_type, @@ -887,7 +888,11 @@ static int unpack_item_prefix_sid(uint16_t mtid, uint8_t len, struct stream *s, if (sid.flags & ISIS_PREFIX_SID_VALUE) { sid.value = stream_get3(s); - sid.value &= MPLS_LABEL_VALUE_MASK; + if (!IS_MPLS_UNRESERVED_LABEL(sid.value)) { + sbuf_push(log, indent, "Invalid absolute SID %u\n", + sid.value); + return 1; + } } else { sid.value = stream_getl(s); } @@ -2623,7 +2628,7 @@ static void format_tlv_router_cap(const struct isis_router_cap *router_cap, sbuf_push(buf, indent, " Algorithm: %s", router_cap->algo[0] == 0 ? "0: SPF" : "0: Strict SPF"); - for (int i = 0; i < SR_ALGORITHM_COUNT; i++) + for (int i = 1; i < SR_ALGORITHM_COUNT; i++) if (router_cap->algo[i] != SR_ALGORITHM_UNSET) sbuf_push(buf, indent, " %s", router_cap->algo[1] == 0 @@ -4630,24 +4635,42 @@ void isis_tlvs_del_lan_adj_sid(struct isis_ext_subtlvs *exts, } void isis_tlvs_add_extended_ip_reach(struct isis_tlvs *tlvs, - struct prefix_ipv4 *dest, uint32_t metric) + struct prefix_ipv4 *dest, uint32_t metric, + bool external, struct sr_prefix_cfg *pcfg) { struct isis_extended_ip_reach *r = XCALLOC(MTYPE_ISIS_TLV, sizeof(*r)); r->metric = metric; memcpy(&r->prefix, dest, sizeof(*dest)); apply_mask_ipv4(&r->prefix); + if (pcfg) { + struct isis_prefix_sid *psid = + XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*psid)); + + isis_sr_prefix_cfg2subtlv(pcfg, external, psid); + r->subtlvs = isis_alloc_subtlvs(ISIS_CONTEXT_SUBTLV_IP_REACH); + append_item(&r->subtlvs->prefix_sids, (struct isis_item *)psid); + } append_item(&tlvs->extended_ip_reach, (struct isis_item *)r); } void isis_tlvs_add_ipv6_reach(struct isis_tlvs *tlvs, uint16_t mtid, - struct prefix_ipv6 *dest, uint32_t metric) + struct prefix_ipv6 *dest, uint32_t metric, + bool external, struct sr_prefix_cfg *pcfg) { struct isis_ipv6_reach *r = XCALLOC(MTYPE_ISIS_TLV, sizeof(*r)); r->metric = metric; memcpy(&r->prefix, dest, sizeof(*dest)); apply_mask_ipv6(&r->prefix); + if (pcfg) { + struct isis_prefix_sid *psid = + XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*psid)); + + isis_sr_prefix_cfg2subtlv(pcfg, external, psid); + r->subtlvs = isis_alloc_subtlvs(ISIS_CONTEXT_SUBTLV_IP_REACH); + append_item(&r->subtlvs->prefix_sids, (struct isis_item *)psid); + } struct isis_item_list *l; l = (mtid == ISIS_MT_IPV4_UNICAST) @@ -4661,7 +4684,7 @@ void isis_tlvs_add_ipv6_dstsrc_reach(struct isis_tlvs *tlvs, uint16_t mtid, struct prefix_ipv6 *src, uint32_t metric) { - isis_tlvs_add_ipv6_reach(tlvs, mtid, dest, metric); + isis_tlvs_add_ipv6_reach(tlvs, mtid, dest, metric, false, NULL); struct isis_item_list *l = isis_get_mt_items(&tlvs->mt_ipv6_reach, mtid); diff --git a/isisd/isis_tlvs.h b/isisd/isis_tlvs.h index 2948728e2b..c3b25669b6 100644 --- a/isisd/isis_tlvs.h +++ b/isisd/isis_tlvs.h @@ -28,8 +28,11 @@ #include "openbsd-tree.h" #include "prefix.h" +DECLARE_MTYPE(ISIS_SUBTLV) + struct lspdb_head; struct isis_subtlvs; +struct sr_prefix_cfg; struct isis_area_address; struct isis_area_address { @@ -580,9 +583,11 @@ void isis_tlvs_set_te_router_id(struct isis_tlvs *tlvs, void isis_tlvs_add_oldstyle_ip_reach(struct isis_tlvs *tlvs, struct prefix_ipv4 *dest, uint8_t metric); void isis_tlvs_add_extended_ip_reach(struct isis_tlvs *tlvs, - struct prefix_ipv4 *dest, uint32_t metric); + struct prefix_ipv4 *dest, uint32_t metric, + bool external, struct sr_prefix_cfg *pcfg); void isis_tlvs_add_ipv6_reach(struct isis_tlvs *tlvs, uint16_t mtid, - struct prefix_ipv6 *dest, uint32_t metric); + struct prefix_ipv6 *dest, uint32_t metric, + bool external, struct sr_prefix_cfg *pcfg); void isis_tlvs_add_ipv6_dstsrc_reach(struct isis_tlvs *tlvs, uint16_t mtid, struct prefix_ipv6 *dest, struct prefix_ipv6 *src, diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 630264768f..3ce7562314 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -50,8 +50,16 @@ #include "isisd/isis_route.h" #include "isisd/isis_zebra.h" #include "isisd/isis_te.h" +#include "isisd/isis_sr.h" -struct zclient *zclient = NULL; +struct zclient *zclient; +static struct zclient *zclient_sync; + +/* List of chunks of labels externally assigned by zebra. */ +static struct list *label_chunk_list; +static struct listnode *current_label_chunk; + +static void isis_zebra_label_manager_connect(void); /* Router-id update message from zebra. */ static int isis_router_id_update_zebra(ZAPI_CALLBACK_ARGS) @@ -245,6 +253,88 @@ void isis_zebra_route_del_route(struct prefix *prefix, zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api); } +/* Install Prefix-SID in the forwarding plane. */ +void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) +{ + struct zapi_labels zl; + struct zapi_nexthop_label *znh; + struct listnode *node; + struct isis_nexthop *nexthop; + struct interface *ifp; + + /* Prepare message. */ + memset(&zl, 0, sizeof(zl)); + zl.type = ZEBRA_LSP_ISIS_SR; + zl.local_label = srp->local_label; + + switch (srp->type) { + case ISIS_SR_PREFIX_LOCAL: + ifp = if_lookup_by_name("lo", VRF_DEFAULT); + if (!ifp) { + zlog_warn( + "%s: couldn't install Prefix-SID %pFX: loopback interface not found", + __func__, &srp->prefix); + return; + } + + znh = &zl.nexthops[zl.nexthop_num++]; + znh->type = NEXTHOP_TYPE_IFINDEX; + znh->ifindex = ifp->ifindex; + znh->label = MPLS_LABEL_IMPLICIT_NULL; + break; + case ISIS_SR_PREFIX_REMOTE: + /* Update route in the RIB too. */ + SET_FLAG(zl.message, ZAPI_LABELS_FTN); + zl.route.prefix = srp->prefix; + 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->family = nexthop->family; + znh->address = nexthop->ip; + znh->ifindex = nexthop->ifindex; + znh->label = nexthop->sr.label; + } + break; + } + + /* Send message to zebra. */ + (void)zebra_send_mpls_labels(zclient, ZEBRA_MPLS_LABELS_REPLACE, &zl); +} + +/* Uninstall Prefix-SID from the forwarding plane. */ +void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) +{ + struct zapi_labels zl; + + /* Prepare message. */ + memset(&zl, 0, sizeof(zl)); + zl.type = ZEBRA_LSP_ISIS_SR; + zl.local_label = srp->local_label; + + if (srp->type == ISIS_SR_PREFIX_REMOTE) { + /* Update route in the RIB too. */ + SET_FLAG(zl.message, ZAPI_LABELS_FTN); + zl.route.prefix = srp->prefix; + zl.route.type = ZEBRA_ROUTE_ISIS; + zl.route.instance = 0; + } + + /* Send message to zebra. */ + (void)zebra_send_mpls_labels(zclient, ZEBRA_MPLS_LABELS_DELETE, &zl); +} + static int isis_zebra_read(ZAPI_CALLBACK_ARGS) { struct zapi_route api; @@ -302,13 +392,192 @@ void isis_zebra_redistribute_unset(afi_t afi, int type) type, 0, VRF_DEFAULT); } +/* Label Manager Requests. */ +int isis_zebra_request_label_range(uint32_t base, uint32_t chunk_size) +{ + int ret; + uint32_t start, end; + + if (zclient_sync->sock == -1) + isis_zebra_label_manager_connect(); + + ret = lm_get_label_chunk(zclient_sync, 0, base, chunk_size, &start, + &end); + if (ret < 0) { + zlog_warn("%s: error getting label range!", __func__); + return -1; + } + + return 0; +} + +void isis_zebra_release_label_range(uint32_t start, uint32_t end) +{ + int ret; + + if (zclient_sync->sock == -1) + isis_zebra_label_manager_connect(); + + ret = lm_release_label_chunk(zclient_sync, start, end); + if (ret < 0) + zlog_warn("%s: error releasing label range!", __func__); +} + +static int isis_zebra_get_label_chunk(void) +{ + int ret; + uint32_t start, end; + struct label_chunk *new_label_chunk; + + if (zclient_sync->sock == -1) + isis_zebra_label_manager_connect(); + + ret = lm_get_label_chunk(zclient_sync, 0, MPLS_LABEL_BASE_ANY, + CHUNK_SIZE, &start, &end); + if (ret < 0) { + zlog_warn("%s: error getting label chunk!", __func__); + return -1; + } + + new_label_chunk = calloc(1, sizeof(struct label_chunk)); + if (!new_label_chunk) { + zlog_warn("%s: error trying to allocate label chunk %u - %u", + __func__, start, end); + return -1; + } + + new_label_chunk->start = start; + new_label_chunk->end = end; + new_label_chunk->used_mask = 0; + + listnode_add(label_chunk_list, (void *)new_label_chunk); + + /* let's update current if needed */ + if (!current_label_chunk) + current_label_chunk = listtail(label_chunk_list); + + return 0; +} + +mpls_label_t isis_zebra_request_dynamic_label(void) +{ + struct label_chunk *label_chunk; + uint32_t i, size; + uint64_t pos; + uint32_t label = MPLS_INVALID_LABEL; + + while (current_label_chunk) { + label_chunk = listgetdata(current_label_chunk); + if (!label_chunk) + goto end; + + /* try to get next free label in currently used label chunk */ + size = label_chunk->end - label_chunk->start + 1; + for (i = 0, pos = 1; i < size; i++, pos <<= 1) { + if (!(pos & label_chunk->used_mask)) { + label_chunk->used_mask |= pos; + label = label_chunk->start + i; + goto end; + } + } + current_label_chunk = listnextnode(current_label_chunk); + } + +end: + /* + * we moved till the last chunk, or were not able to find a label, so + * let's ask for another one. + */ + if (!current_label_chunk + || current_label_chunk == listtail(label_chunk_list) + || label == MPLS_INVALID_LABEL) { + if (isis_zebra_get_label_chunk() != 0) + zlog_warn("%s: error getting label chunk!", __func__); + } + + return label; +} + +static void isis_zebra_del_label_chunk(void *val) +{ + free(val); +} + +static int isis_zebra_release_label_chunk(uint32_t start, uint32_t end) +{ + int ret; + + ret = lm_release_label_chunk(zclient_sync, start, end); + if (ret < 0) { + zlog_warn("%s: error releasing label chunk!", __func__); + return -1; + } + + return 0; +} + +void isis_zebra_release_dynamic_label(mpls_label_t label) +{ + struct listnode *node; + struct label_chunk *label_chunk; + uint64_t pos; + + for (ALL_LIST_ELEMENTS_RO(label_chunk_list, node, label_chunk)) { + if (!(label <= label_chunk->end && label >= label_chunk->start)) + continue; + + pos = 1ULL << (label - label_chunk->start); + label_chunk->used_mask &= ~pos; + + /* + * If nobody is using this chunk and it's not + * current_label_chunk, then free it. + */ + if (!label_chunk->used_mask && (current_label_chunk != node)) { + if (isis_zebra_release_label_chunk(label_chunk->start, + label_chunk->end) + != 0) + zlog_warn("%s: error releasing label chunk!", + __func__); + else { + listnode_delete(label_chunk_list, label_chunk); + isis_zebra_del_label_chunk(label_chunk); + } + } + break; + } +} + +static void isis_zebra_label_manager_connect(void) +{ + /* Connect to label manager. */ + while (zclient_socket_connect(zclient_sync) < 0) { + zlog_warn("%s: error connecting synchronous zclient!", + __func__); + sleep(1); + } + set_nonblocking(zclient_sync->sock); + while (lm_label_manager_connect(zclient_sync, 0) != 0) { + zlog_warn("%s: error connecting to label manager!", __func__); + sleep(1); + } + + label_chunk_list = list_new(); + label_chunk_list->del = isis_zebra_del_label_chunk; + while (isis_zebra_get_label_chunk() != 0) { + zlog_warn("%s: error getting first label chunk!", __func__); + sleep(1); + } +} + static void isis_zebra_connected(struct zclient *zclient) { zclient_send_reg_requests(zclient, VRF_DEFAULT); } -void isis_zebra_init(struct thread_master *master) +void isis_zebra_init(struct thread_master *master, int instance) { + /* Initialize asynchronous zclient. */ zclient = zclient_new(master, &zclient_options_default); zclient_init(zclient, PROTO_TYPE, 0, &isisd_privs); zclient->zebra_connected = isis_zebra_connected; @@ -319,7 +588,12 @@ void isis_zebra_init(struct thread_master *master) zclient->redistribute_route_add = isis_zebra_read; zclient->redistribute_route_del = isis_zebra_read; - return; + /* Initialize special zclient for synchronous message exchanges. */ + zclient_sync = zclient_new(master, &zclient_options_default); + zclient_sync->sock = -1; + zclient_sync->redist_default = ZEBRA_ROUTE_ISIS; + zclient_sync->instance = instance; + zclient_sync->privs = &isisd_privs; } void isis_zebra_stop(void) diff --git a/isisd/isis_zebra.h b/isisd/isis_zebra.h index d00f348c8e..cca2b08811 100644 --- a/isisd/isis_zebra.h +++ b/isisd/isis_zebra.h @@ -24,10 +24,18 @@ extern struct zclient *zclient; -void isis_zebra_init(struct thread_master *); +struct label_chunk { + uint32_t start; + uint32_t end; + uint64_t used_mask; +}; +#define CHUNK_SIZE 64 + +void isis_zebra_init(struct thread_master *master, int instance); void isis_zebra_stop(void); struct isis_route_info; +struct sr_prefix; void isis_zebra_route_add_route(struct prefix *prefix, struct prefix_ipv6 *src_p, @@ -35,8 +43,14 @@ void isis_zebra_route_add_route(struct prefix *prefix, void isis_zebra_route_del_route(struct prefix *prefix, struct prefix_ipv6 *src_p, struct isis_route_info *route_info); +void isis_zebra_install_prefix_sid(const struct sr_prefix *srp); +void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp); int isis_distribute_list_update(int routetype); void isis_zebra_redistribute_set(afi_t afi, int type); void isis_zebra_redistribute_unset(afi_t afi, int type); +int isis_zebra_request_label_range(uint32_t base, uint32_t chunk_size); +void isis_zebra_release_label_range(uint32_t start, uint32_t end); +mpls_label_t isis_zebra_request_dynamic_label(void); +void isis_zebra_release_dynamic_label(mpls_label_t label); #endif /* _ZEBRA_ISIS_ZEBRA_H */ diff --git a/isisd/isisd.c b/isisd/isisd.c index 2a8c503ae0..caf50addd4 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -56,6 +56,7 @@ #include "isisd/isis_events.h" #include "isisd/isis_te.h" #include "isisd/isis_mt.h" +#include "isisd/isis_sr.h" #include "isisd/fabricd.h" #include "isisd/isis_nb.h" @@ -128,6 +129,8 @@ struct isis_area *isis_area_create(const char *area_tag) thread_add_timer(master, lsp_tick, area, 1, &area->t_tick); flags_initialize(&area->flags); + isis_sr_area_init(area); + /* * Default values */ @@ -271,6 +274,8 @@ int isis_area_destroy(const char *area_tag) isis_area_invalidate_routes(area, area->is_type); isis_area_verify_routes(area); + isis_sr_area_term(area); + spftree_area_del(area); THREAD_TIMER_OFF(area->spf_timer[0]); @@ -748,6 +753,9 @@ void print_debug(struct vty *vty, int flags, int onoff) onoffs); if (flags & DEBUG_SPF_EVENTS) vty_out(vty, "IS-IS SPF events debugging is %s\n", onoffs); + if (flags & DEBUG_SR) + vty_out(vty, "IS-IS Segment Routing events debugging is %s\n", + onoffs); if (flags & DEBUG_UPDATE_PACKETS) vty_out(vty, "IS-IS Update related packet debugging is %s\n", onoffs); @@ -812,6 +820,10 @@ static int config_write_debug(struct vty *vty) vty_out(vty, "debug " PROTO_NAME " spf-events\n"); write++; } + if (flags & DEBUG_SR) { + vty_out(vty, "debug " PROTO_NAME " sr-events\n"); + write++; + } if (flags & DEBUG_UPDATE_PACKETS) { vty_out(vty, "debug " PROTO_NAME " update-packets\n"); write++; @@ -1011,6 +1023,33 @@ DEFUN (no_debug_isis_spfevents, return CMD_SUCCESS; } +DEFUN (debug_isis_srevents, + debug_isis_srevents_cmd, + "debug " PROTO_NAME " sr-events", + DEBUG_STR + PROTO_HELP + "IS-IS Segment Routing Events\n") +{ + isis->debugs |= DEBUG_SR; + print_debug(vty, DEBUG_SR, 1); + + return CMD_SUCCESS; +} + +DEFUN (no_debug_isis_srevents, + no_debug_isis_srevents_cmd, + "no debug " PROTO_NAME " sr-events", + NO_STR + UNDEBUG_STR + PROTO_HELP + "IS-IS Segment Routing Events\n") +{ + isis->debugs &= ~DEBUG_SR; + print_debug(vty, DEBUG_SR, 0); + + return CMD_SUCCESS; +} + DEFUN (debug_isis_rtevents, debug_isis_rtevents_cmd, "debug " PROTO_NAME " route-events", @@ -2198,6 +2237,8 @@ void isis_init(void) install_element(ENABLE_NODE, &no_debug_isis_upd_cmd); install_element(ENABLE_NODE, &debug_isis_spfevents_cmd); 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_rtevents_cmd); install_element(ENABLE_NODE, &no_debug_isis_rtevents_cmd); install_element(ENABLE_NODE, &debug_isis_events_cmd); @@ -2223,6 +2264,8 @@ void isis_init(void) install_element(CONFIG_NODE, &no_debug_isis_upd_cmd); install_element(CONFIG_NODE, &debug_isis_spfevents_cmd); 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_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 53776b2ec6..56ea0993fd 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -30,6 +30,7 @@ #include "isisd/isis_redist.h" #include "isisd/isis_pdu_counter.h" #include "isisd/isis_circuit.h" +#include "isisd/isis_sr.h" #include "isis_flags.h" #include "isis_lsp.h" #include "isis_memory.h" @@ -165,6 +166,8 @@ struct isis_area { struct list *mt_settings; /* MPLS-TE settings */ struct mpls_te_area *mta; + /* Segment Routing information */ + struct isis_sr_db srdb; int ipv6_circuits; bool purge_originator; /* Counters */ @@ -218,6 +221,10 @@ int isis_area_passwd_cleartext_set(struct isis_area *area, int level, int isis_area_passwd_hmac_md5_set(struct isis_area *area, int level, const char *passwd, uint8_t snp_auth); +/* YANG paths */ +#define ISIS_INSTANCE "/frr-isisd:isis/instance" +#define ISIS_SR "/frr-isisd:isis/instance/segment-routing" + /* Master of threads. */ extern struct thread_master *master; @@ -233,6 +240,7 @@ extern struct thread_master *master; #define DEBUG_FLOODING (1<<9) #define DEBUG_BFD (1<<10) #define DEBUG_TX_QUEUE (1<<11) +#define DEBUG_SR (1<<12) #define lsp_debug(...) \ do { \ diff --git a/isisd/subdir.am b/isisd/subdir.am index 94f9116d34..9e855ad8cf 100644 --- a/isisd/subdir.am +++ b/isisd/subdir.am @@ -11,6 +11,7 @@ vtysh_scan += \ isisd/isis_redist.c \ isisd/isis_spf.c \ isisd/isis_te.c \ + isisd/isis_sr.c \ isisd/isis_vty_fabricd.c \ isisd/isisd.c \ # end @@ -48,6 +49,7 @@ noinst_HEADERS += \ isisd/isis_routemap.h \ isisd/isis_spf.h \ isisd/isis_spf_private.h \ + isisd/isis_sr.h \ isisd/isis_te.h \ isisd/isis_tlvs.h \ isisd/isis_tx_queue.h \ @@ -77,6 +79,7 @@ LIBISIS_SOURCES = \ isisd/isis_route.c \ isisd/isis_routemap.c \ isisd/isis_spf.c \ + isisd/isis_sr.c \ isisd/isis_te.c \ isisd/isis_tlvs.c \ isisd/isis_tx_queue.c \ diff --git a/lib/mpls.h b/lib/mpls.h index 05cf2935e8..126dbf753d 100644 --- a/lib/mpls.h +++ b/lib/mpls.h @@ -127,7 +127,8 @@ enum lsp_types_t { ZEBRA_LSP_LDP = 2, /* LDP LSP. */ ZEBRA_LSP_BGP = 3, /* BGP LSP. */ ZEBRA_LSP_OSPF_SR = 4,/* OSPF Segment Routing LSP. */ - ZEBRA_LSP_SHARP = 5, /* Identifier for test protocol */ + ZEBRA_LSP_ISIS_SR = 5,/* IS-IS Segment Routing LSP. */ + ZEBRA_LSP_SHARP = 6, /* Identifier for test protocol */ }; /* Functions for basic label operations. */ diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 33cb614346..e468fb9c1b 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -430,6 +430,7 @@ static inline uint8_t lsp_distance(enum lsp_types_t type) case ZEBRA_LSP_NONE: case ZEBRA_LSP_SHARP: case ZEBRA_LSP_OSPF_SR: + case ZEBRA_LSP_ISIS_SR: return 150; } @@ -457,6 +458,8 @@ static inline enum lsp_types_t lsp_type_from_re_type(int re_type) return ZEBRA_LSP_BGP; case ZEBRA_ROUTE_OSPF: return ZEBRA_LSP_OSPF_SR; + case ZEBRA_ROUTE_ISIS: + return ZEBRA_LSP_ISIS_SR; case ZEBRA_ROUTE_SHARP: return ZEBRA_LSP_SHARP; default: @@ -478,6 +481,8 @@ static inline int re_type_from_lsp_type(enum lsp_types_t lsp_type) return ZEBRA_ROUTE_BGP; case ZEBRA_LSP_OSPF_SR: return ZEBRA_ROUTE_OSPF; + case ZEBRA_LSP_ISIS_SR: + return ZEBRA_ROUTE_ISIS; case ZEBRA_LSP_NONE: return ZEBRA_ROUTE_KERNEL; case ZEBRA_LSP_SHARP: @@ -505,6 +510,8 @@ static inline const char *nhlfe_type2str(enum lsp_types_t lsp_type) return "BGP"; case ZEBRA_LSP_OSPF_SR: return "SR (OSPF)"; + case ZEBRA_LSP_ISIS_SR: + return "SR (IS-IS)"; case ZEBRA_LSP_SHARP: return "SHARP"; case ZEBRA_LSP_NONE: From 9389175b755e305a08db736736554b18898f15fa Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Thu, 8 Aug 2019 16:44:23 -0300 Subject: [PATCH 08/18] doc: add documentation for IS-IS Segment Routing Signed-off-by: Olivier Dugeon --- doc/user/isisd.rst | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/doc/user/isisd.rst b/doc/user/isisd.rst index 9a0a0afb0c..f0c64b9bb0 100644 --- a/doc/user/isisd.rst +++ b/doc/user/isisd.rst @@ -470,6 +470,50 @@ Traffic Engineering .. _debugging-isis: +Segment Routing +=============== + +This is an EXPERIMENTAL support of Segment Routing as per draft +`draft-ietf-isis-segment-routing-extensions-25.txt` for MPLS dataplane. +It supports IPv4, IPv6 and ECMP and has been tested against Cisco & Juniper +routers. + +Known limitations: + - No support for level redistribution (L1 to L2 or L2 to L1) + - No support for binding SID + - No support for SRMS + +.. index:: [no] segment-routing on +.. clicmd:: [no] segment-routing on + + Enable Segment Routing. + +.. index:: [no] segment-routing global-block (0-1048575) (0-1048575) +.. clicmd:: [no] segment-routing global-block (0-1048575) (0-1048575) + + Seet the Segment Routing Global Block i.e. the label range used by MPLS + to store label in the MPLS FIB. + +.. index:: [no] segment-routing node-msd (1-16) +.. clicmd:: [no] segment-routing node-msd (1-16) + + Set the Maximum Stack Depth supported by the router. The value depend of the + MPLS dataplane. E.g. for Linux kernel, since version 4.13 it is 32. + +.. index:: [no] segment-routing prefix [no-php-flag|explicit-null] +.. clicmd:: [no] segment-routing prefix Date: Mon, 23 Sep 2019 09:38:04 -0300 Subject: [PATCH 09/18] tests: add topotest for IS-IS SR This commit introduces a comprehensive test for IS-IS Segment Routing. It features the following network topology: +---------+ | | | 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 +---------+ Each router has both an IPv4 and an IPv6 loopback address, each of which has a corresponding Prefix-SID configured. Basic SR functionality is tested. First, the topotest ensures that all expected Prefix-SIDs and Adj-SIDs are flooded and installed correctly in all routers of the network. Later, network failures are simulated and configuration changes are performed in several different routers. The topotest then checks if IS-IS has converged as expected in the network according to the network failures and configuration changes that happened. The topotest comprises 11 different steps, each with four individual tests (for a total of 44 tests). A summary of what each step does is provided below: --- STEP 1: -Initial network convergence --- Step 2: Action(s): -Disable IS-IS on the eth-rt5 interface on rt4 Expected changes: -rt4 should uninstall the Adj-SIDs pointing to rt5 -rt5 should uninstall the Adj-SIDs pointing to rt4 -rt2 should reinstall rt5's Prefix-SIDs (2 nexthops deleted) -rt3 should reinstall rt4's Prefix-SIDs (2 nexthops deleted) -rt4 should reinstall rt3's Prefix-SIDs (1 nexthop deleted) -rt4 should reinstall rt5's Prefix-SIDs (1 nexthop changed) -rt5 should reinstall rt2's Prefix-SIDs (1 nexthop deleted) -rt5 should reinstall rt4's Prefix-SIDs (1 nexthop changed) --- Step 3: Action(s): -Shut down the eth-rt4 interface on rt6 -Shut down the eth-rt5 interface on rt6 Expected changes: -All routers should uninstall rt6's Prefix-SIDs -rt4 and rt5 should uninstall the Adj-SIDs pointing to rt6 -rt4 should reconverge rt5's Prefix-SIDs through rt2 using ECMP -rt5 should reconverge rt4's Prefix-SIDs through rt3 using ECMP -rt6 should uninstall all its IS-IS routes, Prefix-SIDs and Adj-SIDs --- Step 4: Action(s): -Bring up the eth-rt4 interface on rt6 -Bring up the eth-rt5 interface on rt6 -Change rt6's SRGB Expected changes: -All routers should install rt6's Prefix-SIDs -rt4 and rt5 should install Adj-SIDs for rt6 -rt4 should reconverge rt5's Prefix-SIDs through rt6 using the new SRGB -rt5 should reconverge rt4's Prefix-SIDs through rt6 using the new SRGB -rt6 should reinstall all IS-IS routes and Prefix-SIDs from the network, and Adj-SIDs for rt4 and rt5 --- Step 5: Action(s): -Disable SR on rt6 Expected changes: -All routers should uninstall rt6's Prefix-SIDs -rt4 should uninstall rt5's Prefix-SIDs since the nexthop router hasn't SR enabled anymore -rt5 should uninstall rt4's Prefix-SIDs since the nexthop router hasn't SR enabled anymore -rt6 should uninstall all Prefix-SIDs from the network, and the Adj-SIDs for rt4 and rt5 --- Step 6: Action(s): -Enable SR on rt6 Expected changes: -All routers should install rt6's Prefix-SIDs -rt4 should install rt5's Prefix-SIDs through rt6 -rt5 should install rt4's Prefix-SIDs through rt6 -rt6 should install all Prefix-SIDs from the network, and Adj-SIDs for rt4 and rt5 --- Step 7: Action(s): -Delete rt1's Prefix-SIDs Expected changes: -All routers should uninstall rt1's Prefix-SIDs --- Step 8: Action(s): -Re-add rt1's Prefix-SIDs Expected changes: -All routers should install rt1's Prefix-SIDs --- Step 9: Action(s): -Change rt1's Prefix-SIDs to use the no-php option -Change rt6's Prefix-SIDs to stop using the explicit-null option Expected changes: -rt2 and rt3 should reinstall rt1's Prefix-SIDs accordingly -rt4 and rt5 should reinstall rt6's Prefix-SIDs accordingly --- Step 10: Action(s): -Remove the IPv4 address from rt4's eth-rt2-1 interface Expected changes: -rt2 should uninstall the IPv4 Adj-SIDs attached to the eth-rt4-1 interface -rt2 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt4 (ECMP shouldn't be used anymore) -rt4 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt2 (ECMP shouldn't be used anymore) --- Step 11: Action(s): -Restore the original network setup Expected changes: -All routes, Prefix-SIDs and Adj-SIDs should be the same as they were after the initial network convergence (step 1) Signed-off-by: Renato Westphal --- tests/topotests/isis-sr-topo1/__init__.py | 0 tests/topotests/isis-sr-topo1/rt1/isisd.conf | 30 + .../isis-sr-topo1/rt1/step1/show_ip_route.ref | 294 ++++++ .../rt1/step1/show_ipv6_route.ref | 121 +++ .../rt1/step1/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../rt1/step10/show_ip_route.ref | 287 ++++++ .../rt1/step10/show_ipv6_route.ref | 121 +++ .../rt1/step10/show_mpls_table.ref | 156 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step2/show_ip_route.ref | 287 ++++++ .../rt1/step2/show_ipv6_route.ref | 121 +++ .../rt1/step2/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step3/show_ip_route.ref | 254 +++++ .../rt1/step3/show_ipv6_route.ref | 90 ++ .../rt1/step3/show_mpls_table.ref | 98 ++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step4/show_ip_route.ref | 287 ++++++ .../rt1/step4/show_ipv6_route.ref | 121 +++ .../rt1/step4/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step5/show_ip_route.ref | 281 ++++++ .../rt1/step5/show_ipv6_route.ref | 115 +++ .../rt1/step5/show_mpls_table.ref | 98 ++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step6/show_ip_route.ref | 287 ++++++ .../rt1/step6/show_ipv6_route.ref | 121 +++ .../rt1/step6/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step7/show_ip_route.ref | 287 ++++++ .../rt1/step7/show_ipv6_route.ref | 121 +++ .../rt1/step7/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step8/show_ip_route.ref | 287 ++++++ .../rt1/step8/show_ipv6_route.ref | 121 +++ .../rt1/step8/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + .../isis-sr-topo1/rt1/step9/show_ip_route.ref | 287 ++++++ .../rt1/step9/show_ipv6_route.ref | 121 +++ .../rt1/step9/show_mpls_table.ref | 156 +++ .../show_yang_interface_isis_adjacencies.ref | 32 + tests/topotests/isis-sr-topo1/rt1/zebra.conf | 19 + tests/topotests/isis-sr-topo1/rt2/isisd.conf | 41 + .../isis-sr-topo1/rt2/step1/show_ip_route.ref | 347 +++++++ .../rt2/step1/show_ipv6_route.ref | 148 +++ .../rt2/step1/show_mpls_table.ref | 192 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../rt2/step10/show_ip_route.ref | 259 +++++ .../rt2/step10/show_ipv6_route.ref | 130 +++ .../rt2/step10/show_mpls_table.ref | 156 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step2/show_ip_route.ref | 320 ++++++ .../rt2/step2/show_ipv6_route.ref | 130 +++ .../rt2/step2/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step3/show_ip_route.ref | 273 ++++++ .../rt2/step3/show_ipv6_route.ref | 99 ++ .../rt2/step3/show_mpls_table.ref | 132 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step4/show_ip_route.ref | 320 ++++++ .../rt2/step4/show_ipv6_route.ref | 130 +++ .../rt2/step4/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step5/show_ip_route.ref | 314 ++++++ .../rt2/step5/show_ipv6_route.ref | 124 +++ .../rt2/step5/show_mpls_table.ref | 132 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step6/show_ip_route.ref | 320 ++++++ .../rt2/step6/show_ipv6_route.ref | 130 +++ .../rt2/step6/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step7/show_ip_route.ref | 317 ++++++ .../rt2/step7/show_ipv6_route.ref | 127 +++ .../rt2/step7/show_mpls_table.ref | 144 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step8/show_ip_route.ref | 320 ++++++ .../rt2/step8/show_ipv6_route.ref | 130 +++ .../rt2/step8/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt2/step9/show_ip_route.ref | 320 ++++++ .../rt2/step9/show_ipv6_route.ref | 130 +++ .../rt2/step9/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ tests/topotests/isis-sr-topo1/rt2/zebra.conf | 25 + tests/topotests/isis-sr-topo1/rt3/isisd.conf | 41 + .../isis-sr-topo1/rt3/step1/show_ip_route.ref | 347 +++++++ .../rt3/step1/show_ipv6_route.ref | 148 +++ .../rt3/step1/show_mpls_table.ref | 192 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../rt3/step10/show_ip_route.ref | 327 +++++++ .../rt3/step10/show_ipv6_route.ref | 130 +++ .../rt3/step10/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step2/show_ip_route.ref | 327 +++++++ .../rt3/step2/show_ipv6_route.ref | 130 +++ .../rt3/step2/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step3/show_ip_route.ref | 280 ++++++ .../rt3/step3/show_ipv6_route.ref | 99 ++ .../rt3/step3/show_mpls_table.ref | 132 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step4/show_ip_route.ref | 327 +++++++ .../rt3/step4/show_ipv6_route.ref | 130 +++ .../rt3/step4/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step5/show_ip_route.ref | 321 ++++++ .../rt3/step5/show_ipv6_route.ref | 124 +++ .../rt3/step5/show_mpls_table.ref | 132 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step6/show_ip_route.ref | 327 +++++++ .../rt3/step6/show_ipv6_route.ref | 130 +++ .../rt3/step6/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step7/show_ip_route.ref | 324 +++++++ .../rt3/step7/show_ipv6_route.ref | 127 +++ .../rt3/step7/show_mpls_table.ref | 144 +++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step8/show_ip_route.ref | 327 +++++++ .../rt3/step8/show_ipv6_route.ref | 130 +++ .../rt3/step8/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ .../isis-sr-topo1/rt3/step9/show_ip_route.ref | 327 +++++++ .../rt3/step9/show_ipv6_route.ref | 130 +++ .../rt3/step9/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 68 ++ tests/topotests/isis-sr-topo1/rt3/zebra.conf | 25 + tests/topotests/isis-sr-topo1/rt4/isisd.conf | 48 + .../isis-sr-topo1/rt4/step1/show_ip_route.ref | 323 +++++++ .../rt4/step1/show_ipv6_route.ref | 148 +++ .../rt4/step1/show_mpls_table.ref | 192 ++++ .../show_yang_interface_isis_adjacencies.ref | 78 ++ .../rt4/step10/show_ip_route.ref | 277 ++++++ .../rt4/step10/show_ipv6_route.ref | 139 +++ .../rt4/step10/show_mpls_table.ref | 162 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step2/show_ip_route.ref | 335 +++++++ .../rt4/step2/show_ipv6_route.ref | 139 +++ .../rt4/step2/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step3/show_ip_route.ref | 306 ++++++ .../rt4/step3/show_ipv6_route.ref | 126 +++ .../rt4/step3/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt4/step4/show_ip_route.ref | 335 +++++++ .../rt4/step4/show_ipv6_route.ref | 139 +++ .../rt4/step4/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step5/show_ip_route.ref | 329 +++++++ .../rt4/step5/show_ipv6_route.ref | 133 +++ .../rt4/step5/show_mpls_table.ref | 132 +++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step6/show_ip_route.ref | 335 +++++++ .../rt4/step6/show_ipv6_route.ref | 139 +++ .../rt4/step6/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step7/show_ip_route.ref | 329 +++++++ .../rt4/step7/show_ipv6_route.ref | 133 +++ .../rt4/step7/show_mpls_table.ref | 144 +++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step8/show_ip_route.ref | 335 +++++++ .../rt4/step8/show_ipv6_route.ref | 139 +++ .../rt4/step8/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt4/step9/show_ip_route.ref | 335 +++++++ .../rt4/step9/show_ipv6_route.ref | 139 +++ .../rt4/step9/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ tests/topotests/isis-sr-topo1/rt4/zebra.conf | 28 + tests/topotests/isis-sr-topo1/rt5/isisd.conf | 48 + .../isis-sr-topo1/rt5/step1/show_ip_route.ref | 323 +++++++ .../rt5/step1/show_ipv6_route.ref | 148 +++ .../rt5/step1/show_mpls_table.ref | 192 ++++ .../show_yang_interface_isis_adjacencies.ref | 78 ++ .../rt5/step10/show_ip_route.ref | 312 ++++++ .../rt5/step10/show_ipv6_route.ref | 139 +++ .../rt5/step10/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step2/show_ip_route.ref | 319 ++++++ .../rt5/step2/show_ipv6_route.ref | 139 +++ .../rt5/step2/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step3/show_ip_route.ref | 284 ++++++ .../rt5/step3/show_ipv6_route.ref | 126 +++ .../rt5/step3/show_mpls_table.ref | 168 ++++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt5/step4/show_ip_route.ref | 319 ++++++ .../rt5/step4/show_ipv6_route.ref | 139 +++ .../rt5/step4/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step5/show_ip_route.ref | 313 ++++++ .../rt5/step5/show_ipv6_route.ref | 133 +++ .../rt5/step5/show_mpls_table.ref | 132 +++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step6/show_ip_route.ref | 319 ++++++ .../rt5/step6/show_ipv6_route.ref | 139 +++ .../rt5/step6/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step7/show_ip_route.ref | 313 ++++++ .../rt5/step7/show_ipv6_route.ref | 133 +++ .../rt5/step7/show_mpls_table.ref | 144 +++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step8/show_ip_route.ref | 319 ++++++ .../rt5/step8/show_ipv6_route.ref | 139 +++ .../rt5/step8/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ .../isis-sr-topo1/rt5/step9/show_ip_route.ref | 319 ++++++ .../rt5/step9/show_ipv6_route.ref | 139 +++ .../rt5/step9/show_mpls_table.ref | 180 ++++ .../show_yang_interface_isis_adjacencies.ref | 60 ++ tests/topotests/isis-sr-topo1/rt5/zebra.conf | 28 + tests/topotests/isis-sr-topo1/rt6/isisd.conf | 36 + .../isis-sr-topo1/rt6/step1/show_ip_route.ref | 291 ++++++ .../rt6/step1/show_ipv6_route.ref | 121 +++ .../rt6/step1/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../rt6/step10/show_ip_route.ref | 284 ++++++ .../rt6/step10/show_ipv6_route.ref | 121 +++ .../rt6/step10/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step2/show_ip_route.ref | 284 ++++++ .../rt6/step2/show_ipv6_route.ref | 121 +++ .../rt6/step2/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step3/show_ip_route.ref | 2 + .../rt6/step3/show_ipv6_route.ref | 2 + .../rt6/step3/show_mpls_table.ref | 2 + .../show_yang_interface_isis_adjacencies.ref | 3 + .../isis-sr-topo1/rt6/step4/show_ip_route.ref | 284 ++++++ .../rt6/step4/show_ipv6_route.ref | 121 +++ .../rt6/step4/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step5/show_ip_route.ref | 266 +++++ .../rt6/step5/show_ipv6_route.ref | 103 ++ .../rt6/step5/show_mpls_table.ref | 2 + .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step6/show_ip_route.ref | 284 ++++++ .../rt6/step6/show_ipv6_route.ref | 121 +++ .../rt6/step6/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step7/show_ip_route.ref | 278 ++++++ .../rt6/step7/show_ipv6_route.ref | 115 +++ .../rt6/step7/show_mpls_table.ref | 98 ++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step8/show_ip_route.ref | 284 ++++++ .../rt6/step8/show_ipv6_route.ref | 121 +++ .../rt6/step8/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + .../isis-sr-topo1/rt6/step9/show_ip_route.ref | 284 ++++++ .../rt6/step9/show_ipv6_route.ref | 121 +++ .../rt6/step9/show_mpls_table.ref | 134 +++ .../show_yang_interface_isis_adjacencies.ref | 42 + tests/topotests/isis-sr-topo1/rt6/zebra.conf | 22 + .../isis-sr-topo1/test_isis_sr_topo1.py | 915 ++++++++++++++++++ 254 files changed, 39183 insertions(+) create mode 100644 tests/topotests/isis-sr-topo1/__init__.py create mode 100644 tests/topotests/isis-sr-topo1/rt1/isisd.conf create mode 100644 tests/topotests/isis-sr-topo1/rt1/step1/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step1/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step10/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step10/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step10/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step10/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step2/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step2/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step2/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step2/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step3/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step3/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step3/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step3/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step4/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step4/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step4/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step4/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step5/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step5/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step5/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step5/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step6/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step6/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step6/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step6/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step7/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step7/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step7/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step7/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step8/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step8/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step8/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step8/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step9/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step9/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step9/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/step9/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt1/zebra.conf create mode 100644 tests/topotests/isis-sr-topo1/rt2/isisd.conf create mode 100644 tests/topotests/isis-sr-topo1/rt2/step1/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step1/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step10/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step10/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step10/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step2/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step2/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step2/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step2/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step3/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step3/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step3/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step3/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step4/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step4/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step4/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step4/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step5/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step5/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step5/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step5/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step6/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step6/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step6/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step6/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step7/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step7/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step7/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step7/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step8/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step8/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step8/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step8/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step9/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step9/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step9/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/step9/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt2/zebra.conf create mode 100644 tests/topotests/isis-sr-topo1/rt3/isisd.conf create mode 100644 tests/topotests/isis-sr-topo1/rt3/step1/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step1/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step10/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step10/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step10/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step10/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step2/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step2/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step2/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step2/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step3/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step3/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step3/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step3/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step4/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step4/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step4/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step4/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step5/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step5/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step5/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step5/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step6/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step6/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step6/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step6/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step7/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step7/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step7/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step7/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step8/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step8/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step8/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step8/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step9/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step9/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step9/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/step9/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt3/zebra.conf create mode 100644 tests/topotests/isis-sr-topo1/rt4/isisd.conf create mode 100644 tests/topotests/isis-sr-topo1/rt4/step1/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step1/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step10/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step10/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step10/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step10/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step2/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step2/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step2/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step2/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step3/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step3/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step3/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step4/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step4/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step4/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step4/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step5/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step5/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step5/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step5/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step6/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step6/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step6/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step6/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step7/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step7/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step7/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step7/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step8/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step8/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step8/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step8/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step9/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step9/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step9/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/step9/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt4/zebra.conf create mode 100644 tests/topotests/isis-sr-topo1/rt5/isisd.conf create mode 100644 tests/topotests/isis-sr-topo1/rt5/step1/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step1/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step10/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step10/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step10/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step2/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step2/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step2/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step3/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step3/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step3/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step4/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step4/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step4/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step5/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step5/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step5/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step6/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step6/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step6/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step7/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step7/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step7/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step8/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step8/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step8/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step9/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step9/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/step9/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt5/zebra.conf create mode 100644 tests/topotests/isis-sr-topo1/rt6/isisd.conf create mode 100644 tests/topotests/isis-sr-topo1/rt6/step1/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step1/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step1/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step10/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step10/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step10/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step10/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step2/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step2/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step2/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step2/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step3/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step3/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step3/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step3/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step4/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step4/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step4/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step4/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step5/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step5/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step5/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step5/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step6/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step6/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step6/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step6/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step7/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step7/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step7/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step7/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step8/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step8/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step8/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step8/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step9/show_ip_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step9/show_ipv6_route.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step9/show_mpls_table.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/step9/show_yang_interface_isis_adjacencies.ref create mode 100644 tests/topotests/isis-sr-topo1/rt6/zebra.conf create mode 100755 tests/topotests/isis-sr-topo1/test_isis_sr_topo1.py diff --git a/tests/topotests/isis-sr-topo1/__init__.py b/tests/topotests/isis-sr-topo1/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/topotests/isis-sr-topo1/rt1/isisd.conf b/tests/topotests/isis-sr-topo1/rt1/isisd.conf new file mode 100644 index 0000000000..70ae1b07f5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/isisd.conf @@ -0,0 +1,30 @@ +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 +! +router isis 1 + net 49.0000.0000.0000.0001.00 + is-type level-1 + 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-sr-topo1/rt1/step1/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step1/show_ip_route.ref new file mode 100644 index 0000000000..6b4a59011a --- /dev/null +++ b/tests/topotests/isis-sr-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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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-sr-topo1/rt1/step1/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step1/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step1/show_mpls_table.ref new file mode 100644 index 0000000000..773f5e3d43 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step1/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step10/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step10/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step10/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step10/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step10/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step10/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step10/show_mpls_table.ref new file mode 100644 index 0000000000..25a48c2bfc --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step10/show_mpls_table.ref @@ -0,0 +1,156 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step10/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step10/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step10/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step2/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step2/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step2/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step2/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step2/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step2/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step2/show_mpls_table.ref new file mode 100644 index 0000000000..773f5e3d43 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step2/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step2/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step2/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step2/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step3/show_ip_route.ref new file mode 100644 index 0000000000..05a8498693 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step3/show_ip_route.ref @@ -0,0 +1,254 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step3/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step3/show_ipv6_route.ref new file mode 100644 index 0000000000..d50952c6c4 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step3/show_ipv6_route.ref @@ -0,0 +1,90 @@ +{ + "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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step3/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step3/show_mpls_table.ref new file mode 100644 index 0000000000..73f517a6e5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step3/show_mpls_table.ref @@ -0,0 +1,98 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step3/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step3/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step3/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step4/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step4/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step4/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step4/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step4/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step4/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step4/show_mpls_table.ref new file mode 100644 index 0000000000..ac39920ee5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step4/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17061, + "installed":true, + "interface":"eth-sw1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step4/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step4/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step4/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step5/show_ip_route.ref new file mode 100644 index 0000000000..59213686f2 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step5/show_ip_route.ref @@ -0,0 +1,281 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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 + }, + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ], + "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.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-sr-topo1/rt1/step5/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step5/show_ipv6_route.ref new file mode 100644 index 0000000000..cdfae284ba --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step5/show_ipv6_route.ref @@ -0,0 +1,115 @@ +{ + "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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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 + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step5/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step5/show_mpls_table.ref new file mode 100644 index 0000000000..73f517a6e5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step5/show_mpls_table.ref @@ -0,0 +1,98 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step5/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step5/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step5/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step6/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step6/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step6/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step6/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step6/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step6/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step6/show_mpls_table.ref new file mode 100644 index 0000000000..773f5e3d43 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step6/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step6/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step6/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step6/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step7/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step7/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step7/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step7/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step7/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step7/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step7/show_mpls_table.ref new file mode 100644 index 0000000000..773f5e3d43 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step7/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step7/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step7/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step7/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step8/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step8/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step8/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step8/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step8/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step8/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step8/show_mpls_table.ref new file mode 100644 index 0000000000..773f5e3d43 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step8/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step8/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step8/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step8/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt1/step9/show_ip_route.ref new file mode 100644 index 0000000000..6b34d5e4ff --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step9/show_ip_route.ref @@ -0,0 +1,287 @@ +{ + "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":[ + 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.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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":[ + 17050 + ] + } + ] + } + ], + "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":[ + 17060 + ] + } + ] + } + ], + "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.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-sr-topo1/rt1/step9/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt1/step9/show_ipv6_route.ref new file mode 100644 index 0000000000..c507688f5b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step9/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":[ + 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-sw1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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":[ + 17051 + ] + } + ] + } + ], + "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":[ + 17061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step9/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt1/step9/show_mpls_table.ref new file mode 100644 index 0000000000..25a48c2bfc --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step9/show_mpls_table.ref @@ -0,0 +1,156 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "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":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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":17060, + "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":17061, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt1/step9/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt1/step9/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..ce2d356f23 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt1/step9/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,32 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-sw1", + "vrf": "default", + "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-sr-topo1/rt1/zebra.conf b/tests/topotests/isis-sr-topo1/rt1/zebra.conf new file mode 100644 index 0000000000..9d71d3005f --- /dev/null +++ b/tests/topotests/isis-sr-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-sr-topo1/rt2/isisd.conf b/tests/topotests/isis-sr-topo1/rt2/isisd.conf new file mode 100644 index 0000000000..733f26bc62 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/isisd.conf @@ -0,0 +1,41 @@ +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 +! +interface eth-rt4-1 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +interface eth-rt4-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +router isis 1 + net 49.0000.0000.0000.0002.00 + is-type level-1 + 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 no-php-flag + segment-routing prefix 2001:db8:1000::2/128 index 21 no-php-flag +! diff --git a/tests/topotests/isis-sr-topo1/rt2/step1/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step1/show_ip_route.ref new file mode 100644 index 0000000000..be037aba8b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step1/show_ip_route.ref @@ -0,0 +1,347 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + }, + { + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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":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-sr-topo1/rt2/step1/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..a888198ac8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step1/show_ipv6_route.ref @@ -0,0 +1,148 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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-rt4-1", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step1/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step1/show_mpls_table.ref new file mode 100644 index 0000000000..42fde2d77f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step1/show_mpls_table.ref @@ -0,0 +1,192 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + }, + { + "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" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "installed":true, + "interface":"eth-sw1" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "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-sr-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref new file mode 100644 index 0000000000..33fbdba28f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step10/show_ip_route.ref @@ -0,0 +1,259 @@ +{ + "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, + "labels":[ + 16010 + ] + } + ] + } + ], + "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":[ + 17030 + ] + } + ] + } + ], + "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.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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.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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "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 + } + ] + } + ], + "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.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":20, + "installed":true, + "nexthops":[ + { + "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.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step10/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step10/show_ipv6_route.ref new file mode 100644 index 0000000000..19837bc700 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step10/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "labels":[ + 16011 + ] + } + ] + } + ], + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step10/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step10/show_mpls_table.ref new file mode 100644 index 0000000000..29ec55a589 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step10/show_mpls_table.ref @@ -0,0 +1,156 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.3.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-sr-topo1/rt2/step10/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step10/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step10/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step2/show_ip_route.ref new file mode 100644 index 0000000000..a110c51077 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step2/show_ip_route.ref @@ -0,0 +1,320 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step2/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step2/show_ipv6_route.ref new file mode 100644 index 0000000000..cb426897ce --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step2/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step2/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step2/show_mpls_table.ref new file mode 100644 index 0000000000..118ec89b5c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step2/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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-sr-topo1/rt2/step2/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step2/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step2/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step3/show_ip_route.ref new file mode 100644 index 0000000000..d31affeb59 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step3/show_ip_route.ref @@ -0,0 +1,273 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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 + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step3/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step3/show_ipv6_route.ref new file mode 100644 index 0000000000..d92df1918c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step3/show_ipv6_route.ref @@ -0,0 +1,99 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step3/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step3/show_mpls_table.ref new file mode 100644 index 0000000000..f1e18be26b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step3/show_mpls_table.ref @@ -0,0 +1,132 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step3/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step3/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step3/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step4/show_ip_route.ref new file mode 100644 index 0000000000..a110c51077 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step4/show_ip_route.ref @@ -0,0 +1,320 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step4/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step4/show_ipv6_route.ref new file mode 100644 index 0000000000..cb426897ce --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step4/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step4/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step4/show_mpls_table.ref new file mode 100644 index 0000000000..118ec89b5c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step4/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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-sr-topo1/rt2/step4/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step4/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step4/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step5/show_ip_route.ref new file mode 100644 index 0000000000..f378e41d8d --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step5/show_ip_route.ref @@ -0,0 +1,314 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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 + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step5/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step5/show_ipv6_route.ref new file mode 100644 index 0000000000..d63e7ceba5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step5/show_ipv6_route.ref @@ -0,0 +1,124 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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 + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step5/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step5/show_mpls_table.ref new file mode 100644 index 0000000000..f1e18be26b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step5/show_mpls_table.ref @@ -0,0 +1,132 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "installed":true, + "interface":"eth-sw1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step5/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step5/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step5/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step6/show_ip_route.ref new file mode 100644 index 0000000000..a110c51077 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step6/show_ip_route.ref @@ -0,0 +1,320 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step6/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step6/show_ipv6_route.ref new file mode 100644 index 0000000000..cb426897ce --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step6/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step6/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step6/show_mpls_table.ref new file mode 100644 index 0000000000..118ec89b5c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step6/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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-sr-topo1/rt2/step6/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step6/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step6/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step7/show_ip_route.ref new file mode 100644 index 0000000000..a9b086a248 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step7/show_ip_route.ref @@ -0,0 +1,317 @@ +{ + "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 + } + ] + } + ], + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step7/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step7/show_ipv6_route.ref new file mode 100644 index 0000000000..1c61f91451 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step7/show_ipv6_route.ref @@ -0,0 +1,127 @@ +{ + "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 + } + ] + } + ], + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step7/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step7/show_mpls_table.ref new file mode 100644 index 0000000000..0f0d24bbfb --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step7/show_mpls_table.ref @@ -0,0 +1,144 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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-sr-topo1/rt2/step7/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step7/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step7/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step8/show_ip_route.ref new file mode 100644 index 0000000000..a110c51077 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step8/show_ip_route.ref @@ -0,0 +1,320 @@ +{ + "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, + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step8/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step8/show_ipv6_route.ref new file mode 100644 index 0000000000..cb426897ce --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step8/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step8/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step8/show_mpls_table.ref new file mode 100644 index 0000000000..118ec89b5c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step8/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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-sr-topo1/rt2/step8/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step8/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step8/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt2/step9/show_ip_route.ref new file mode 100644 index 0000000000..2e4c20257f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step9/show_ip_route.ref @@ -0,0 +1,320 @@ +{ + "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, + "labels":[ + 16010 + ] + } + ] + } + ], + "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":[ + 17030 + ] + } + ] + } + ], + "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":[ + 16040 + ] + }, + { + "fib":true, + "ip":"10.0.3.4", + "afi":"ipv4", + "interfaceName":"eth-rt4-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 17050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.3", + "afi":"ipv4", + "interfaceName":"eth-sw1" + } + ] + } + ], + "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 + } + ] + } + ], + "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.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":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-sr-topo1/rt2/step9/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt2/step9/show_ipv6_route.ref new file mode 100644 index 0000000000..19837bc700 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step9/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "labels":[ + 16011 + ] + } + ] + } + ], + "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":[ + 17031 + ] + } + ] + } + ], + "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":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4-2", + "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":[ + 17051 + ] + } + ] + } + ], + "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-sr-topo1/rt2/step9/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt2/step9/show_mpls_table.ref new file mode 100644 index 0000000000..7c910fc6f6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step9/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.3.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.2.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17050, + "installed":true, + "nexthop":"10.0.1.3" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17051, + "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-sr-topo1/rt2/step9/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt2/step9/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..1e65fbff58 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt2/step9/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4-1", + "vrf": "default", + "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", + "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", + "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.0001", + "neighbor-extended-circuit-id": 2, + "hold-timer": 9, + "neighbor-priority": 64, + "state": "up" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt2/zebra.conf b/tests/topotests/isis-sr-topo1/rt2/zebra.conf new file mode 100644 index 0000000000..dcb0686dc2 --- /dev/null +++ b/tests/topotests/isis-sr-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-sr-topo1/rt3/isisd.conf b/tests/topotests/isis-sr-topo1/rt3/isisd.conf new file mode 100644 index 0000000000..ceb982ca32 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/isisd.conf @@ -0,0 +1,41 @@ +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 +! +interface eth-rt5-1 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +interface eth-rt5-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +router isis 1 + net 49.0000.0000.0000.0003.00 + is-type level-1 + topology ipv6-unicast + segment-routing on + segment-routing global-block 17000 24999 + segment-routing node-msd 8 + segment-routing prefix 3.3.3.3/32 index 30 no-php-flag + segment-routing prefix 2001:db8:1000::3/128 index 31 no-php-flag +! diff --git a/tests/topotests/isis-sr-topo1/rt3/step1/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step1/show_ip_route.ref new file mode 100644 index 0000000000..8d4fbec4b5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step1/show_ip_route.ref @@ -0,0 +1,347 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step1/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..4e4961eaf0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step1/show_ipv6_route.ref @@ -0,0 +1,148 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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-sw1", + "active":true, + "labels":[ + 16041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step1/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step1/show_mpls_table.ref new file mode 100644 index 0000000000..b7bdc3e4af --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step1/show_mpls_table.ref @@ -0,0 +1,192 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "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.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17041":{ + "inLabel":17041, + "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-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step10/show_ip_route.ref new file mode 100644 index 0000000000..9522b141b0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step10/show_ip_route.ref @@ -0,0 +1,327 @@ +{ + "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, + "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.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step10/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step10/show_ipv6_route.ref new file mode 100644 index 0000000000..fb630bc68f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step10/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "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-sw1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step10/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step10/show_mpls_table.ref new file mode 100644 index 0000000000..4aec3b6904 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step10/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step10/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step10/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step10/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step2/show_ip_route.ref new file mode 100644 index 0000000000..46ebeb8ab9 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step2/show_ip_route.ref @@ -0,0 +1,327 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step2/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step2/show_ipv6_route.ref new file mode 100644 index 0000000000..b2c774d493 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step2/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step2/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step2/show_mpls_table.ref new file mode 100644 index 0000000000..a1e64afd67 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step2/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step2/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step2/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step2/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step3/show_ip_route.ref new file mode 100644 index 0000000000..738aa17406 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step3/show_ip_route.ref @@ -0,0 +1,280 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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" + }, + { + "ip":"10.0.1.2", + "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", + "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 + } + ] + } + ], + "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-sr-topo1/rt3/step3/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step3/show_ipv6_route.ref new file mode 100644 index 0000000000..b6423cd2b8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step3/show_ipv6_route.ref @@ -0,0 +1,99 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step3/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step3/show_mpls_table.ref new file mode 100644 index 0000000000..1a2b8728e6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step3/show_mpls_table.ref @@ -0,0 +1,132 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step3/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step3/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step3/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step4/show_ip_route.ref new file mode 100644 index 0000000000..46ebeb8ab9 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step4/show_ip_route.ref @@ -0,0 +1,327 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step4/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step4/show_ipv6_route.ref new file mode 100644 index 0000000000..b2c774d493 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step4/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step4/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step4/show_mpls_table.ref new file mode 100644 index 0000000000..a1e64afd67 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step4/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step4/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step4/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step4/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step5/show_ip_route.ref new file mode 100644 index 0000000000..489b495bb1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step5/show_ip_route.ref @@ -0,0 +1,321 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step5/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step5/show_ipv6_route.ref new file mode 100644 index 0000000000..46ee7ba28e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step5/show_ipv6_route.ref @@ -0,0 +1,124 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step5/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step5/show_mpls_table.ref new file mode 100644 index 0000000000..1a2b8728e6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step5/show_mpls_table.ref @@ -0,0 +1,132 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step5/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step5/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step5/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step6/show_ip_route.ref new file mode 100644 index 0000000000..46ebeb8ab9 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step6/show_ip_route.ref @@ -0,0 +1,327 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step6/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step6/show_ipv6_route.ref new file mode 100644 index 0000000000..b2c774d493 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step6/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step6/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step6/show_mpls_table.ref new file mode 100644 index 0000000000..a1e64afd67 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step6/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step6/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step6/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step6/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step7/show_ip_route.ref new file mode 100644 index 0000000000..1e8c27c01f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step7/show_ip_route.ref @@ -0,0 +1,324 @@ +{ + "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 + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step7/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step7/show_ipv6_route.ref new file mode 100644 index 0000000000..d21700d407 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step7/show_ipv6_route.ref @@ -0,0 +1,127 @@ +{ + "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 + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step7/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step7/show_mpls_table.ref new file mode 100644 index 0000000000..e97e0d017b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step7/show_mpls_table.ref @@ -0,0 +1,144 @@ +{ + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step7/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step7/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step7/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step8/show_ip_route.ref new file mode 100644 index 0000000000..46ebeb8ab9 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step8/show_ip_route.ref @@ -0,0 +1,327 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step8/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step8/show_ipv6_route.ref new file mode 100644 index 0000000000..b2c774d493 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step8/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "labels":[ + 3 + ] + } + ] + } + ], + "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":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step8/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step8/show_mpls_table.ref new file mode 100644 index 0000000000..a1e64afd67 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step8/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step8/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step8/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step8/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt3/step9/show_ip_route.ref new file mode 100644 index 0000000000..9522b141b0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step9/show_ip_route.ref @@ -0,0 +1,327 @@ +{ + "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, + "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.1.2", + "afi":"ipv4", + "interfaceName":"eth-sw1", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.5.5", + "afi":"ipv4", + "interfaceName":"eth-rt5-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.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" + }, + { + "ip":"10.0.1.2", + "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", + "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-sr-topo1/rt3/step9/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt3/step9/show_ipv6_route.ref new file mode 100644 index 0000000000..fb630bc68f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step9/show_ipv6_route.ref @@ -0,0 +1,130 @@ +{ + "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, + "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-sw1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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":20, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "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-rt5-2", + "active":true, + "labels":[ + 16061 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt5-1", + "active":true, + "labels":[ + 16061 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step9/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt3/step9/show_mpls_table.ref new file mode 100644 index 0000000000..4aec3b6904 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step9/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "17010":{ + "inLabel":17010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.1.1" + } + ] + }, + "17011":{ + "inLabel":17011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17020":{ + "inLabel":17020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17021":{ + "inLabel":17021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17030":{ + "inLabel":17030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17031":{ + "inLabel":17031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "17040":{ + "inLabel":17040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.1.2" + } + ] + }, + "17041":{ + "inLabel":17041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-sw1" + } + ] + }, + "17050":{ + "inLabel":17050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17051":{ + "inLabel":17051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5-1" + } + ] + }, + "17060":{ + "inLabel":17060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.5.5" + }, + { + "type":"SR (IS-IS)", + "outLabel":16060, + "installed":true, + "nexthop":"10.0.4.5" + } + ] + }, + "17061":{ + "inLabel":17061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16061, + "installed":true, + "interface":"eth-rt5-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt3/step9/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt3/step9/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..9c8a4056c0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt3/step9/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,68 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt5-1", + "vrf": "default", + "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", + "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", + "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": 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-sr-topo1/rt3/zebra.conf b/tests/topotests/isis-sr-topo1/rt3/zebra.conf new file mode 100644 index 0000000000..3254529386 --- /dev/null +++ b/tests/topotests/isis-sr-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-sr-topo1/rt4/isisd.conf b/tests/topotests/isis-sr-topo1/rt4/isisd.conf new file mode 100644 index 0000000000..07a7867cbb --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/isisd.conf @@ -0,0 +1,48 @@ +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 +! +interface eth-rt2-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +interface eth-rt5 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +interface eth-rt6 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +router isis 1 + net 49.0000.0000.0000.0004.00 + is-type level-1 + 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 no-php-flag + segment-routing prefix 2001:db8:1000::4/128 index 41 no-php-flag +! diff --git a/tests/topotests/isis-sr-topo1/rt4/step1/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step1/show_ip_route.ref new file mode 100644 index 0000000000..f06182b088 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step1/show_ip_route.ref @@ -0,0 +1,323 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16050 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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" + } + ] + } + ], + "10.0.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "distance":115, + "metric":20, + "nexthops":[ + { + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6" + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "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-sr-topo1/rt4/step1/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..f5772f2726 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step1/show_ipv6_route.ref @@ -0,0 +1,148 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16051 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step1/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step1/show_mpls_table.ref new file mode 100644 index 0000000000..b7fb69dcde --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step1/show_mpls_table.ref @@ -0,0 +1,192 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.6.5" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..5889349cd8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,78 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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", + "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", + "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-sr-topo1/rt4/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step10/show_ip_route.ref new file mode 100644 index 0000000000..d7d42120a0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step10/show_ip_route.ref @@ -0,0 +1,277 @@ +{ + "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.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.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16030 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18050 + ] + } + ] + } + ], + "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, + "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.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-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.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.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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step10/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step10/show_ipv6_route.ref new file mode 100644 index 0000000000..235c1facc6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step10/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18051 + ] + } + ] + } + ], + "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, + "labels":[ + 3 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step10/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step10/show_mpls_table.ref new file mode 100644 index 0000000000..86ceaf4883 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step10/show_mpls_table.ref @@ -0,0 +1,162 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.3.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":16020, + "installed":true, + "nexthop":"10.0.3.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step10/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step10/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step10/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step2/show_ip_route.ref new file mode 100644 index 0000000000..4789f7268f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step2/show_ip_route.ref @@ -0,0 +1,335 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step2/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step2/show_ipv6_route.ref new file mode 100644 index 0000000000..871b303cab --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step2/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step2/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step2/show_mpls_table.ref new file mode 100644 index 0000000000..ff83c374f0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step2/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step2/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step2/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step2/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref new file mode 100644 index 0000000000..d86562deb9 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step3/show_ip_route.ref @@ -0,0 +1,306 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "5.5.5.5\/32":[ + { + "prefix":"5.5.5.5\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.2.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16050 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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":30, + "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.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":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":40, + "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", + "active":true + } + ] + } + ], + "10.0.8.0\/24":[ + { + "prefix":"10.0.8.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "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 + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step3/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step3/show_ipv6_route.ref new file mode 100644 index 0000000000..c09f584641 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step3/show_ipv6_route.ref @@ -0,0 +1,126 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16051 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step3/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step3/show_mpls_table.ref new file mode 100644 index 0000000000..85c6c055c9 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step3/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt2-1" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step3/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step3/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..f7327f0517 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step3/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step4/show_ip_route.ref new file mode 100644 index 0000000000..3c7dfda0a3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step4/show_ip_route.ref @@ -0,0 +1,335 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18050 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step4/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step4/show_ipv6_route.ref new file mode 100644 index 0000000000..38b51822dd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step4/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18051 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step4/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step4/show_mpls_table.ref new file mode 100644 index 0000000000..4e5638f34f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step4/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step4/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step4/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step4/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step5/show_ip_route.ref new file mode 100644 index 0000000000..90f69c06b8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step5/show_ip_route.ref @@ -0,0 +1,329 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "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 + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step5/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step5/show_ipv6_route.ref new file mode 100644 index 0000000000..04056ed873 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step5/show_ipv6_route.ref @@ -0,0 +1,133 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "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 + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step5/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step5/show_mpls_table.ref new file mode 100644 index 0000000000..4df722be4f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step5/show_mpls_table.ref @@ -0,0 +1,132 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step5/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step5/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step5/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step6/show_ip_route.ref new file mode 100644 index 0000000000..3c7dfda0a3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step6/show_ip_route.ref @@ -0,0 +1,335 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18050 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step6/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step6/show_ipv6_route.ref new file mode 100644 index 0000000000..38b51822dd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step6/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18051 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step6/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step6/show_mpls_table.ref new file mode 100644 index 0000000000..4e5638f34f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step6/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step6/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step6/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step6/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step7/show_ip_route.ref new file mode 100644 index 0000000000..a3ac4ac109 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step7/show_ip_route.ref @@ -0,0 +1,329 @@ +{ + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + } + ] + } + ], + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18050 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step7/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step7/show_ipv6_route.ref new file mode 100644 index 0000000000..c59abbd2f5 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step7/show_ipv6_route.ref @@ -0,0 +1,133 @@ +{ + "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 + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true + } + ] + } + ], + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18051 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step7/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step7/show_mpls_table.ref new file mode 100644 index 0000000000..512c057b31 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step7/show_mpls_table.ref @@ -0,0 +1,144 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step7/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step7/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step7/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step8/show_ip_route.ref new file mode 100644 index 0000000000..3c7dfda0a3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step8/show_ip_route.ref @@ -0,0 +1,335 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18050 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step8/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step8/show_ipv6_route.ref new file mode 100644 index 0000000000..38b51822dd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step8/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18051 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step8/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step8/show_mpls_table.ref new file mode 100644 index 0000000000..4e5638f34f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step8/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step8/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step8/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step8/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt4/step9/show_ip_route.ref new file mode 100644 index 0000000000..73598e4605 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step9/show_ip_route.ref @@ -0,0 +1,335 @@ +{ + "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":[ + 16020 + ] + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true, + "labels":[ + 16020 + ] + } + ] + } + ], + "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 + ] + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18050 + ] + } + ] + } + ], + "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, + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.5.0\/24":[ + { + "prefix":"10.0.5.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.3.2", + "afi":"ipv4", + "interfaceName":"eth-rt2-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.6.0\/24":[ + { + "prefix":"10.0.6.0\/24", + "protocol":"isis", + "distance":115, + "metric":30, + "nexthops":[ + { + "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" + } + ] + } + ], + "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.7.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step9/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt4/step9/show_ipv6_route.ref new file mode 100644 index 0000000000..235c1facc6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step9/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt2-1", + "active":true, + "labels":[ + 16021 + ] + } + ] + } + ], + "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-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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18051 + ] + } + ] + } + ], + "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, + "labels":[ + 3 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step9/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt4/step9/show_mpls_table.ref new file mode 100644 index 0000000000..5cdd99e425 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step9/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "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":16020, + "installed":true, + "nexthop":"10.0.3.2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.2.2" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt2-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":16021, + "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" + } + ] + }, + "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" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18050, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18051, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.7.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt4/step9/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt4/step9/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..d2fad659bd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt4/step9/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt2-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt4/zebra.conf b/tests/topotests/isis-sr-topo1/rt4/zebra.conf new file mode 100644 index 0000000000..4945897e9d --- /dev/null +++ b/tests/topotests/isis-sr-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-sr-topo1/rt5/isisd.conf b/tests/topotests/isis-sr-topo1/rt5/isisd.conf new file mode 100644 index 0000000000..b0fcdede07 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/isisd.conf @@ -0,0 +1,48 @@ +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 +! +interface eth-rt3-2 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +interface eth-rt4 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +interface eth-rt6 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +router isis 1 + net 49.0000.0000.0000.0005.00 + is-type level-1 + 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 no-php-flag + segment-routing prefix 2001:db8:1000::5/128 index 51 no-php-flag +! diff --git a/tests/topotests/isis-sr-topo1/rt5/step1/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step1/show_ip_route.ref new file mode 100644 index 0000000000..8eaf40f236 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step1/show_ip_route.ref @@ -0,0 +1,323 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + }, + { + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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, + "labels":[ + 16040 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step1/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..294567edc8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step1/show_ipv6_route.ref @@ -0,0 +1,148 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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, + "labels":[ + 16021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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, + "labels":[ + 16041 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step1/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step1/show_mpls_table.ref new file mode 100644 index 0000000000..9054c9c4af --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step1/show_mpls_table.ref @@ -0,0 +1,192 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "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":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "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":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.6.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..0342069fe3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,78 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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", + "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", + "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-sr-topo1/rt5/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref new file mode 100644 index 0000000000..a5a0bacaad --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step10/show_ip_route.ref @@ -0,0 +1,312 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18040 + ] + } + ] + } + ], + "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, + "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":30, + "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.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step10/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step10/show_ipv6_route.ref new file mode 100644 index 0000000000..c02d3cfaea --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step10/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 18041 + ] + } + ] + } + ], + "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, + "labels":[ + 3 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step10/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step10/show_mpls_table.ref new file mode 100644 index 0000000000..e43ef6671d --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step10/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step10/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step10/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step10/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref new file mode 100644 index 0000000000..101b811d3b --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step2/show_ip_route.ref @@ -0,0 +1,319 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 16040 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step2/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step2/show_ipv6_route.ref new file mode 100644 index 0000000000..fa426317ba --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step2/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 16041 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step2/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step2/show_mpls_table.ref new file mode 100644 index 0000000000..660e319a50 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step2/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step2/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step2/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step2/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref new file mode 100644 index 0000000000..dff6c5f7eb --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step3/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "4.4.4.4\/32":[ + { + "prefix":"4.4.4.4\/32", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.4.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17040 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17040 + ] + } + ] + } + ], + "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":30, + "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.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":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.7.0\/24":[ + { + "prefix":"10.0.7.0\/24", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "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 + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step3/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step3/show_ipv6_route.ref new file mode 100644 index 0000000000..a3e705f384 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step3/show_ipv6_route.ref @@ -0,0 +1,126 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "2001:db8:1000::4\/128":[ + { + "prefix":"2001:db8:1000::4\/128", + "protocol":"isis", + "selected":true, + "destSelected":true, + "distance":115, + "metric":40, + "installed":true, + "nexthops":[ + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17041 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17041 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step3/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step3/show_mpls_table.ref new file mode 100644 index 0000000000..9df3fc9ef6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step3/show_mpls_table.ref @@ -0,0 +1,168 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17040, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17040, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17041, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17041, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step3/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step3/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..0466f315c1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step3/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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" + } + ] + } + } + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref new file mode 100644 index 0000000000..6b29ff2d44 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step4/show_ip_route.ref @@ -0,0 +1,319 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18040 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step4/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step4/show_ipv6_route.ref new file mode 100644 index 0000000000..e9f8fe227c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step4/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 18041 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step4/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step4/show_mpls_table.ref new file mode 100644 index 0000000000..4d13108d7d --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step4/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step4/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step4/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step4/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref new file mode 100644 index 0000000000..cadb674ba3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step5/show_ip_route.ref @@ -0,0 +1,313 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "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 + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step5/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step5/show_ipv6_route.ref new file mode 100644 index 0000000000..60c645092e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step5/show_ipv6_route.ref @@ -0,0 +1,133 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true + } + ] + } + ], + "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 + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step5/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step5/show_mpls_table.ref new file mode 100644 index 0000000000..c60383093f --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step5/show_mpls_table.ref @@ -0,0 +1,132 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step5/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step5/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step5/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref new file mode 100644 index 0000000000..6b29ff2d44 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step6/show_ip_route.ref @@ -0,0 +1,319 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18040 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step6/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step6/show_ipv6_route.ref new file mode 100644 index 0000000000..e9f8fe227c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step6/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 18041 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step6/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step6/show_mpls_table.ref new file mode 100644 index 0000000000..4d13108d7d --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step6/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step6/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step6/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step6/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref new file mode 100644 index 0000000000..72b89ccf69 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step7/show_ip_route.ref @@ -0,0 +1,313 @@ +{ + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18040 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step7/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step7/show_ipv6_route.ref new file mode 100644 index 0000000000..e05cc1e282 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step7/show_ipv6_route.ref @@ -0,0 +1,133 @@ +{ + "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-2", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 18041 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step7/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step7/show_mpls_table.ref new file mode 100644 index 0000000000..2b1e67ea71 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step7/show_mpls_table.ref @@ -0,0 +1,144 @@ +{ + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step7/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step7/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step7/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref new file mode 100644 index 0000000000..6b29ff2d44 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step8/show_ip_route.ref @@ -0,0 +1,319 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18040 + ] + } + ] + } + ], + "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, + "labels":[ + 0 + ] + } + ] + } + ], + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step8/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step8/show_ipv6_route.ref new file mode 100644 index 0000000000..e9f8fe227c --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step8/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 18041 + ] + } + ] + } + ], + "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, + "labels":[ + 2 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step8/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step8/show_mpls_table.ref new file mode 100644 index 0000000000..4d13108d7d --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step8/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":0, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":2, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step8/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step8/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step8/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref new file mode 100644 index 0000000000..cc37894d67 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step9/show_ip_route.ref @@ -0,0 +1,319 @@ +{ + "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":[ + 17010 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17010 + ] + } + ] + } + ], + "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":[ + 17020 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17020 + ] + } + ] + } + ], + "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":[ + 17030 + ] + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true, + "labels":[ + 17030 + ] + } + ] + } + ], + "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.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true, + "labels":[ + 18040 + ] + } + ] + } + ], + "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, + "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":30, + "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 + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "active":true + } + ] + } + ], + "10.0.3.0\/24":[ + { + "prefix":"10.0.3.0\/24", + "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 + }, + { + "fib":true, + "ip":"10.0.5.3", + "afi":"ipv4", + "interfaceName":"eth-rt3-2", + "active":true + }, + { + "fib":true, + "ip":"10.0.8.6", + "afi":"ipv4", + "interfaceName":"eth-rt6", + "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.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.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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step9/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt5/step9/show_ipv6_route.ref new file mode 100644 index 0000000000..c02d3cfaea --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step9/show_ipv6_route.ref @@ -0,0 +1,139 @@ +{ + "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-2", + "active":true, + "labels":[ + 17011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17011 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17021 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17021 + ] + } + ] + } + ], + "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-2", + "active":true, + "labels":[ + 17031 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt3-1", + "active":true, + "labels":[ + 17031 + ] + } + ] + } + ], + "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-rt6", + "active":true, + "labels":[ + 18041 + ] + } + ] + } + ], + "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, + "labels":[ + 3 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step9/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt5/step9/show_mpls_table.ref new file mode 100644 index 0000000000..e43ef6671d --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step9/show_mpls_table.ref @@ -0,0 +1,180 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17010, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17011, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17020, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17021, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.5.3" + }, + { + "type":"SR (IS-IS)", + "outLabel":17030, + "installed":true, + "nexthop":"10.0.4.3" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-2" + }, + { + "type":"SR (IS-IS)", + "outLabel":17031, + "installed":true, + "interface":"eth-rt3-1" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18040, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":18041, + "installed":true, + "interface":"eth-rt6" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true + } + ] + }, + "16060":{ + "inLabel":16060, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "nexthop":"10.0.8.6" + } + ] + }, + "16061":{ + "inLabel":16061, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":3, + "installed":true, + "interface":"eth-rt6" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt5/step9/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt5/step9/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..3518cc13e1 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt5/step9/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,60 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt3-1", + "vrf": "default", + "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", + "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-rt6", + "vrf": "default", + "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-sr-topo1/rt5/zebra.conf b/tests/topotests/isis-sr-topo1/rt5/zebra.conf new file mode 100644 index 0000000000..4cfea1a59f --- /dev/null +++ b/tests/topotests/isis-sr-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-sr-topo1/rt6/isisd.conf b/tests/topotests/isis-sr-topo1/rt6/isisd.conf new file mode 100644 index 0000000000..16c34dfae6 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/isisd.conf @@ -0,0 +1,36 @@ +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 +! +interface eth-rt5 + ip router isis 1 + ipv6 router isis 1 + isis network point-to-point + isis hello-multiplier 3 +! +router isis 1 + net 49.0000.0000.0000.0006.00 + is-type level-1 + 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 explicit-null + segment-routing prefix 2001:db8:1000::6/128 index 61 explicit-null +! diff --git a/tests/topotests/isis-sr-topo1/rt6/step1/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step1/show_ip_route.ref new file mode 100644 index 0000000000..324b71f7b8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step1/show_ip_route.ref @@ -0,0 +1,291 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step1/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step1/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step1/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step1/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step1/show_mpls_table.ref new file mode 100644 index 0000000000..970251fe8a --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step1/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.7.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step1/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step10/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step10/show_ip_route.ref new file mode 100644 index 0000000000..9d0c331ff2 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step10/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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":30, + "installed":true, + "nexthops":[ + { + "fib":true, + "ip":"10.0.7.4", + "afi":"ipv4", + "interfaceName":"eth-rt4", + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step10/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step10/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step10/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step10/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step10/show_mpls_table.ref new file mode 100644 index 0000000000..a79406b300 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step10/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "18010":{ + "inLabel":18010, + "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" + } + ] + }, + "18011":{ + "inLabel":18011, + "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" + } + ] + }, + "18020":{ + "inLabel":18020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18021":{ + "inLabel":18021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18030":{ + "inLabel":18030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18031":{ + "inLabel":18031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "18040":{ + "inLabel":18040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18041":{ + "inLabel":18041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18050":{ + "inLabel":18050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18051":{ + "inLabel":18051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step10/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step10/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step10/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step2/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step2/show_ip_route.ref new file mode 100644 index 0000000000..e4df0d846e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step2/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step2/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step2/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step2/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step2/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step2/show_mpls_table.ref new file mode 100644 index 0000000000..970251fe8a --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step2/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "16010":{ + "inLabel":16010, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.7.4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16010, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "16011":{ + "inLabel":16011, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt4" + }, + { + "type":"SR (IS-IS)", + "outLabel":16011, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "16020":{ + "inLabel":16020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "16021":{ + "inLabel":16021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16030":{ + "inLabel":16030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "16031":{ + "inLabel":16031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "16040":{ + "inLabel":16040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "16041":{ + "inLabel":16041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "16050":{ + "inLabel":16050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "16051":{ + "inLabel":16051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step2/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step2/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step2/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step3/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step3/show_ip_route.ref new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step3/show_ip_route.ref @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step3/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step3/show_ipv6_route.ref new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step3/show_ipv6_route.ref @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step3/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step3/show_mpls_table.ref new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step3/show_mpls_table.ref @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step3/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step3/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..0db3279e44 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step3/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,3 @@ +{ + +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step4/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step4/show_ip_route.ref new file mode 100644 index 0000000000..e4df0d846e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step4/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step4/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step4/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step4/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step4/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step4/show_mpls_table.ref new file mode 100644 index 0000000000..a79406b300 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step4/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "18010":{ + "inLabel":18010, + "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" + } + ] + }, + "18011":{ + "inLabel":18011, + "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" + } + ] + }, + "18020":{ + "inLabel":18020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18021":{ + "inLabel":18021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18030":{ + "inLabel":18030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18031":{ + "inLabel":18031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "18040":{ + "inLabel":18040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18041":{ + "inLabel":18041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18050":{ + "inLabel":18050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18051":{ + "inLabel":18051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step4/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step4/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step4/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step5/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step5/show_ip_route.ref new file mode 100644 index 0000000000..c200a9f476 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step5/show_ip_route.ref @@ -0,0 +1,266 @@ +{ + "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 + }, + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step5/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step5/show_ipv6_route.ref new file mode 100644 index 0000000000..2bf4b70be8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step5/show_ipv6_route.ref @@ -0,0 +1,103 @@ +{ + "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-rt5", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step5/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step5/show_mpls_table.ref new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step5/show_mpls_table.ref @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step5/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step5/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step5/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step6/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step6/show_ip_route.ref new file mode 100644 index 0000000000..e4df0d846e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step6/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step6/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step6/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step6/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step6/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step6/show_mpls_table.ref new file mode 100644 index 0000000000..a79406b300 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step6/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "18010":{ + "inLabel":18010, + "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" + } + ] + }, + "18011":{ + "inLabel":18011, + "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" + } + ] + }, + "18020":{ + "inLabel":18020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18021":{ + "inLabel":18021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18030":{ + "inLabel":18030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18031":{ + "inLabel":18031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "18040":{ + "inLabel":18040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18041":{ + "inLabel":18041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18050":{ + "inLabel":18050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18051":{ + "inLabel":18051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step6/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step6/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step6/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step7/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step7/show_ip_route.ref new file mode 100644 index 0000000000..b21e5db928 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step7/show_ip_route.ref @@ -0,0 +1,278 @@ +{ + "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 + }, + { + "fib":true, + "ip":"10.0.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true + } + ] + } + ], + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step7/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step7/show_ipv6_route.ref new file mode 100644 index 0000000000..dfbb1954b8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step7/show_ipv6_route.ref @@ -0,0 +1,115 @@ +{ + "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-rt5", + "active":true + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "active":true + } + ] + } + ], + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step7/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step7/show_mpls_table.ref new file mode 100644 index 0000000000..43d771bcbd --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step7/show_mpls_table.ref @@ -0,0 +1,98 @@ +{ + "18020":{ + "inLabel":18020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18021":{ + "inLabel":18021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18030":{ + "inLabel":18030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18031":{ + "inLabel":18031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "18040":{ + "inLabel":18040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18041":{ + "inLabel":18041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18050":{ + "inLabel":18050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18051":{ + "inLabel":18051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step7/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step7/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step7/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step8/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step8/show_ip_route.ref new file mode 100644 index 0000000000..e4df0d846e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step8/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step8/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step8/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step8/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step8/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step8/show_mpls_table.ref new file mode 100644 index 0000000000..a79406b300 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step8/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "18010":{ + "inLabel":18010, + "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" + } + ] + }, + "18011":{ + "inLabel":18011, + "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" + } + ] + }, + "18020":{ + "inLabel":18020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18021":{ + "inLabel":18021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18030":{ + "inLabel":18030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18031":{ + "inLabel":18031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "18040":{ + "inLabel":18040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18041":{ + "inLabel":18041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18050":{ + "inLabel":18050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18051":{ + "inLabel":18051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step8/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step8/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step8/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/step9/show_ip_route.ref b/tests/topotests/isis-sr-topo1/rt6/step9/show_ip_route.ref new file mode 100644 index 0000000000..e4df0d846e --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step9/show_ip_route.ref @@ -0,0 +1,284 @@ +{ + "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, + "labels":[ + 16020 + ] + } + ] + } + ], + "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, + "labels":[ + 16030 + ] + } + ] + } + ], + "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, + "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.8.5", + "afi":"ipv4", + "interfaceName":"eth-rt5", + "active":true, + "labels":[ + 16050 + ] + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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 + } + ] + } + ], + "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.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" + } + ] + } + ], + "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" + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step9/show_ipv6_route.ref b/tests/topotests/isis-sr-topo1/rt6/step9/show_ipv6_route.ref new file mode 100644 index 0000000000..eee9dea4d3 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step9/show_ipv6_route.ref @@ -0,0 +1,121 @@ +{ + "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-rt5", + "active":true, + "labels":[ + 16011 + ] + }, + { + "fib":true, + "afi":"ipv6", + "interfaceName":"eth-rt4", + "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, + "labels":[ + 16021 + ] + } + ] + } + ], + "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, + "labels":[ + 16031 + ] + } + ] + } + ], + "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, + "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", + "active":true, + "labels":[ + 16051 + ] + } + ] + } + ] +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step9/show_mpls_table.ref b/tests/topotests/isis-sr-topo1/rt6/step9/show_mpls_table.ref new file mode 100644 index 0000000000..a79406b300 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step9/show_mpls_table.ref @@ -0,0 +1,134 @@ +{ + "18010":{ + "inLabel":18010, + "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" + } + ] + }, + "18011":{ + "inLabel":18011, + "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" + } + ] + }, + "18020":{ + "inLabel":18020, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16020, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18021":{ + "inLabel":18021, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16021, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18030":{ + "inLabel":18030, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16030, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18031":{ + "inLabel":18031, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16031, + "installed":true, + "interface":"eth-rt5" + } + ] + }, + "18040":{ + "inLabel":18040, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16040, + "installed":true, + "nexthop":"10.0.7.4" + } + ] + }, + "18041":{ + "inLabel":18041, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16041, + "installed":true, + "interface":"eth-rt4" + } + ] + }, + "18050":{ + "inLabel":18050, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16050, + "installed":true, + "nexthop":"10.0.8.5" + } + ] + }, + "18051":{ + "inLabel":18051, + "installed":true, + "nexthops":[ + { + "type":"SR (IS-IS)", + "outLabel":16051, + "installed":true, + "interface":"eth-rt5" + } + ] + } +} diff --git a/tests/topotests/isis-sr-topo1/rt6/step9/show_yang_interface_isis_adjacencies.ref b/tests/topotests/isis-sr-topo1/rt6/step9/show_yang_interface_isis_adjacencies.ref new file mode 100644 index 0000000000..89ce0f65a8 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/rt6/step9/show_yang_interface_isis_adjacencies.ref @@ -0,0 +1,42 @@ +{ + "frr-interface:lib": { + "interface": [ + { + "name": "eth-rt4", + "vrf": "default", + "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", + "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-sr-topo1/rt6/zebra.conf b/tests/topotests/isis-sr-topo1/rt6/zebra.conf new file mode 100644 index 0000000000..6084010a93 --- /dev/null +++ b/tests/topotests/isis-sr-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-sr-topo1/test_isis_sr_topo1.py b/tests/topotests/isis-sr-topo1/test_isis_sr_topo1.py new file mode 100755 index 0000000000..72bc96e4d0 --- /dev/null +++ b/tests/topotests/isis-sr-topo1/test_isis_sr_topo1.py @@ -0,0 +1,915 @@ +#!/usr/bin/env python + +# +# test_isis_sr_topo1.py +# Part of NetDEF Topology Tests +# +# Copyright (c) 2019 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_sr_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 +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 + +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") + +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() + filename = '{}/{}/{}'.format(CWD, rname, reference) + expected = json.loads(open(filename).read()) + + # 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", + "step1/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", + "step1/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", + "step1/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", + "step1/show_mpls_table.ref") + +# +# Step 2 +# +# Action(s): +# -Disable IS-IS on the eth-rt5 interface on rt4 +# +# Expected changes: +# -rt4 should uninstall the Adj-SIDs pointing to rt5 +# -rt5 should uninstall the Adj-SIDs pointing to rt4 +# -rt2 should reinstall rt5's Prefix-SIDs (2 nexthops deleted) +# -rt3 should reinstall rt4's Prefix-SIDs (2 nexthops deleted) +# -rt4 should reinstall rt3's Prefix-SIDs (1 nexthop deleted) +# -rt4 should reinstall rt5's Prefix-SIDs (1 nexthop changed) +# -rt5 should reinstall rt2's Prefix-SIDs (1 nexthop deleted) +# -rt5 should reinstall rt4's Prefix-SIDs (1 nexthop changed) +# +def test_isis_adjacencies_step2(): + logger.info("Test (step 2): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Disabling IS-IS on the eth-rt5 interface on rt4') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "no ip router isis 1"') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "no ipv6 router isis 1"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step2/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step2/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", + "step2/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", + "step2/show_mpls_table.ref") + +# +# Step 3 +# +# Action(s): +# -Shut down the eth-rt4 interface on rt6 +# -Shut down the eth-rt5 interface on rt6 +# +# Expected changes: +# -All routers should uninstall rt6's Prefix-SIDs +# -rt4 and rt5 should uninstall the Adj-SIDs pointing to rt6 +# -rt4 should reconverge rt5's Prefix-SIDs through rt2 using ECMP +# -rt5 should reconverge rt4's Prefix-SIDs through rt3 using ECMP +# -rt6 should uninstall all its IS-IS routes, Prefix-SIDs and Adj-SIDs +# +def test_isis_adjacencies_step3(): + logger.info("Test (step 3): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Shutting down the eth-rt4 interface on rt6') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "interface eth-rt4" -c "shutdown"') + logger.info('Shutting down the eth-rt5 interface on rt6') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "shutdown"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step3/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step3/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", + "step3/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", + "step3/show_mpls_table.ref") + +# +# Step 4 +# +# Action(s): +# -Bring up the eth-rt4 interface on rt6 +# -Bring up the eth-rt5 interface on rt6 +# -Change rt6's SRGB +# +# Expected changes: +# -All routers should install rt6's Prefix-SIDs +# -rt4 and rt5 should install Adj-SIDs for rt6 +# -rt4 should reconverge rt5's Prefix-SIDs through rt6 using the new SRGB +# -rt5 should reconverge rt4's Prefix-SIDs through rt6 using the new SRGB +# -rt6 should reinstall all IS-IS routes and Prefix-SIDs from the network, and Adj-SIDs for rt4 and rt5 +# +def test_isis_adjacencies_step4(): + logger.info("Test (step 4): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Bringing up the eth-rt4 interface on rt6') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "interface eth-rt4" -c "no shutdown"') + logger.info('Bringing up the eth-rt5 interface on rt6') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "no shutdown"') + logger.info('Changing rt6\'s SRGB') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing global-block 18000 25999"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step4/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step4/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", + "step4/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", + "step4/show_mpls_table.ref") + +# +# Step 5 +# +# Action(s): +# -Disable SR on rt6 +# +# Expected changes: +# -All routers should uninstall rt6's Prefix-SIDs +# -rt4 should uninstall rt5's Prefix-SIDs since the nexthop router hasn't SR enabled anymore +# -rt5 should uninstall rt4's Prefix-SIDs since the nexthop router hasn't SR enabled anymore +# -rt6 should uninstall all Prefix-SIDs from the network, and the Adj-SIDs for rt4 and rt5 +# +def test_isis_adjacencies_step5(): + logger.info("Test (step 5): check IS-IS adjacencies") + 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 rt6') + tgen.net['rt6'].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 yang operational-data /frr-interface:lib isisd", + "step5/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step5/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", + "step5/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", + "step5/show_mpls_table.ref") + +# +# Step 6 +# +# Action(s): +# -Enable SR on rt6 +# +# Expected changes: +# -All routers should install rt6's Prefix-SIDs +# -rt4 should install rt5's Prefix-SIDs through rt6 +# -rt5 should install rt4's Prefix-SIDs through rt6 +# -rt6 should install all Prefix-SIDs from the network, and Adj-SIDs for rt4 and rt5 +# +def test_isis_adjacencies_step6(): + logger.info("Test (step 6): check IS-IS adjacencies") + 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 rt6') + tgen.net['rt6'].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 yang operational-data /frr-interface:lib isisd", + "step6/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step6/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", + "step6/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", + "step6/show_mpls_table.ref") + +# +# Step 7 +# +# Action(s): +# -Delete rt1's Prefix-SIDs +# +# Expected changes: +# -All routers should uninstall rt1's Prefix-SIDs +# +def test_isis_adjacencies_step7(): + logger.info("Test (step 7): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Deleting rt1\'s Prefix-SIDs') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no segment-routing prefix 1.1.1.1/32 index 10"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "no segment-routing prefix 2001:db8:1000::1/128 index 11"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step7/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step7/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", + "step7/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", + "step7/show_mpls_table.ref") + +# +# Step 8 +# +# Action(s): +# -Re-add rt1's Prefix-SIDs +# +# Expected changes: +# -All routers should install rt1's Prefix-SIDs +# +def test_isis_adjacencies_step8(): + logger.info("Test (step 8): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Re-adding rt1\'s Prefix-SIDs') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 1.1.1.1/32 index 10"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::1/128 index 11"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step8/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step8/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", + "step8/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", + "step8/show_mpls_table.ref") + +# +# Step 9 +# +# Action(s): +# -Change rt1's Prefix-SIDs to use the no-php option +# -Change rt6's Prefix-SIDs to stop using the explicit-null option +# +# Expected changes: +# -rt2 and rt3 should reinstall rt1's Prefix-SIDs accordingly +# -rt4 and rt5 should reinstall rt6's Prefix-SIDs accordingly +# +def test_isis_adjacencies_step9(): + logger.info("Test (step 9): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Changing rt1\'s Prefix-SIDs to use the no-php option') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 1.1.1.1/32 index 10 no-php-flag"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::1/128 index 11 no-php-flag"') + logger.info('Change rt6\'s Prefix-SIDs to stop using the explicit-null option') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 6.6.6.6/32 index 60"') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::6/128 index 61"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step9/show_yang_interface_isis_adjacencies.ref") + +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) + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show ip route isis json", + "step9/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", + "step9/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", + "step9/show_mpls_table.ref") + +# +# Step 10 +# +# Action(s): +# -Remove the IPv4 address from rt4's eth-rt2-1 interface +# +# Expected changes: +# -rt2 should uninstall the IPv4 Adj-SIDs attached to the eth-rt4-1 interface +# -rt2 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt4 (ECMP shouldn't be used anymore) +# -rt4 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt2 (ECMP shouldn't be used anymore) +# +def test_isis_adjacencies_step10(): + logger.info("Test (step 10): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Removing the IPv4 address from rt4\'s eth-rt2-1 interface') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "interface eth-rt2-1" -c "no ip address 10.0.2.4/24"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step10/show_yang_interface_isis_adjacencies.ref") + +def test_rib_ipv4_step10(): + logger.info("Test (step 10): 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", + "step10/show_ip_route.ref") + +def test_rib_ipv6_step10(): + logger.info("Test (step 10): 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", + "step10/show_ipv6_route.ref") + +def test_mpls_lib_step10(): + logger.info("Test (step 10): 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", + "step10/show_mpls_table.ref") + +# +# Step 11 +# +# Action(s): +# -Enter invalid SR configuration +# +# Expected changes: +# -All commands should be rejected +# +def test_isis_invalid_config_step11(): + logger.info("Test (step 11): check if invalid configuration is rejected") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Entering invalid Segment Routing configuration...') + ret = tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 1.1.1.1/32 index 10000"') + assert re.search("Configuration failed", ret) is not None, "Invalid SR configuration wasn't rejected" + ret = tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing global-block 16000 14999"') + assert re.search("Configuration failed", ret) is not None, "Invalid SR configuration wasn't rejected" + ret = tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing global-block 16000 16001"') + assert re.search("Configuration failed", ret) is not None, "Invalid SR configuration wasn't rejected" + +# +# Step 12 +# +# Action(s): +# -Restore the original network setup +# +# Expected changes: +# -All routes, Prefix-SIDs and Adj-SIDs should be the same as they were after the initial network convergence (step 1) +# +def test_isis_adjacencies_step12(): + logger.info("Test (step 12): check IS-IS adjacencies") + tgen = get_topogen() + + # Skip if previous fatal error condition is raised + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + logger.info('Restoring the original network setup') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "ip router isis 1"') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "interface eth-rt5" -c "ipv6 router isis 1"') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing global-block 16000 23999"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 1.1.1.1/32 index 10"') + tgen.net['rt1'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::1/128 index 11"') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 6.6.6.6/32 index 60 explicit-null"') + tgen.net['rt6'].cmd('vtysh -c "conf t" -c "router isis 1" -c "segment-routing prefix 2001:db8:1000::6/128 index 61 explicit-null"') + tgen.net['rt4'].cmd('vtysh -c "conf t" -c "interface eth-rt2-1" -c "ip address 10.0.2.4/24"') + + for rname in ['rt1', 'rt2', 'rt3', 'rt4', 'rt5', 'rt6']: + router_compare_json_output(rname, "show yang operational-data /frr-interface:lib isisd", + "step1/show_yang_interface_isis_adjacencies.ref") + +def test_rib_ipv4_step12(): + logger.info("Test (step 12): 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", + "step1/show_ip_route.ref") + +def test_rib_ipv6_step12(): + logger.info("Test (step 12): 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", + "step1/show_ipv6_route.ref") + +def test_mpls_lib_step12(): + logger.info("Test (step 12): 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", + "step1/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)) From e0e8a84fd8259d50b7a9bb287132b2ca715370c4 Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Tue, 3 Mar 2020 16:59:33 +0100 Subject: [PATCH 10/18] isisd: Update ISIS-SR with new ZAPI message Update label enforcement due to modification in zapi message: zapi_nexthop_label becomes zapi_nexthop as per PR #5813 Signed-off-by: Olivier Dugeon --- isisd/isis_sr.c | 8 ++++---- isisd/isis_zebra.c | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 54689ea48d..9bdb2c40e8 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -970,7 +970,7 @@ static void isis_sr_adj_sid_install_uninstall(bool install, const struct sr_adjacency *sra) { struct zapi_labels zl; - struct zapi_nexthop_label *znh; + struct zapi_nexthop *znh; int cmd; cmd = install ? ZEBRA_MPLS_LABELS_ADD : ZEBRA_MPLS_LABELS_DELETE; @@ -980,13 +980,13 @@ static void isis_sr_adj_sid_install_uninstall(bool install, zl.local_label = sra->nexthop.label; zl.nexthop_num = 1; znh = &zl.nexthops[0]; - znh->family = sra->nexthop.family; - znh->address = sra->nexthop.address; + znh->gate = sra->nexthop.address; znh->type = (sra->nexthop.family == AF_INET) ? NEXTHOP_TYPE_IPV4_IFINDEX : NEXTHOP_TYPE_IPV6_IFINDEX; znh->ifindex = sra->adj->circuit->interface->ifindex; - znh->label = MPLS_LABEL_IMPLICIT_NULL; + znh->label_num = 1; + znh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; (void)zebra_send_mpls_labels(zclient, cmd, &zl); } diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 3ce7562314..5a0f57d548 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -257,7 +257,7 @@ void isis_zebra_route_del_route(struct prefix *prefix, void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) { struct zapi_labels zl; - struct zapi_nexthop_label *znh; + struct zapi_nexthop *znh; struct listnode *node; struct isis_nexthop *nexthop; struct interface *ifp; @@ -280,7 +280,8 @@ void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) znh = &zl.nexthops[zl.nexthop_num++]; znh->type = NEXTHOP_TYPE_IFINDEX; znh->ifindex = ifp->ifindex; - znh->label = MPLS_LABEL_IMPLICIT_NULL; + znh->label_num = 1; + znh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; break; case ISIS_SR_PREFIX_REMOTE: /* Update route in the RIB too. */ @@ -301,10 +302,10 @@ void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) znh->type = (srp->prefix.family == AF_INET) ? NEXTHOP_TYPE_IPV4_IFINDEX : NEXTHOP_TYPE_IPV6_IFINDEX; - znh->family = nexthop->family; - znh->address = nexthop->ip; + znh->gate = nexthop->ip; znh->ifindex = nexthop->ifindex; - znh->label = nexthop->sr.label; + znh->label_num = 1; + znh->labels[0] = nexthop->sr.label; } break; } From 774e3570e9e47d2b259c0380377e078746cffeff Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Fri, 10 Apr 2020 17:12:48 +0200 Subject: [PATCH 11/18] isisd: Update IS-IS SR Label Manager This change modify the way IS-IS is connected to the Label Manager: - Add emission of Hello Message prior to the connection as per modification introduced by PR #5925 - Add 'session_id' as per modification introduced by PR #6224 - Add Doxygen documentation to Label Manager functions Signed-off-by: Olivier Dugeon --- isisd/isis_zebra.c | 75 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 5a0f57d548..d4b9d2a621 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -393,7 +393,16 @@ void isis_zebra_redistribute_unset(afi_t afi, int type) type, 0, VRF_DEFAULT); } -/* Label Manager Requests. */ +/* Label Manager Functions */ + +/** + * Request Label Range to the Label Manager. + * + * @param base base label of the label range to request + * @param chunk_size size of the label range to request + * + * @return 0 on success, -1 on failure + */ int isis_zebra_request_label_range(uint32_t base, uint32_t chunk_size) { int ret; @@ -412,6 +421,12 @@ int isis_zebra_request_label_range(uint32_t base, uint32_t chunk_size) return 0; } +/** + * Release Label Range to the Label Manager. + * + * @param start start of label range to release + * @param end end of label range to release + */ void isis_zebra_release_label_range(uint32_t start, uint32_t end) { int ret; @@ -424,6 +439,12 @@ void isis_zebra_release_label_range(uint32_t start, uint32_t end) zlog_warn("%s: error releasing label range!", __func__); } +/** + * Get a new Label Chunk from the Label Manager. The new Label Chunk is + * added to the Label Chunk list. + * + * @return 0 on success, -1 on failure + */ static int isis_zebra_get_label_chunk(void) { int ret; @@ -460,6 +481,11 @@ static int isis_zebra_get_label_chunk(void) return 0; } +/** + * Request a label from the Label Chunk list. + * + * @return valid label on success or MPLS_INVALID_LABEL on failure + */ mpls_label_t isis_zebra_request_dynamic_label(void) { struct label_chunk *label_chunk; @@ -499,11 +525,24 @@ end: return label; } +/** + * Delete a Label Chunk. + * + * @param val Pointer to the Label Chunk to free + */ static void isis_zebra_del_label_chunk(void *val) { free(val); } +/** + * Release a pre-allocated Label chunk to the Label Manager. + * + * @param start start of the label chunk to release + * @param end end of the label chunk to release + * + * @return 0 on success, -1 on failure + */ static int isis_zebra_release_label_chunk(uint32_t start, uint32_t end) { int ret; @@ -517,6 +556,11 @@ static int isis_zebra_release_label_chunk(uint32_t start, uint32_t end) return 0; } +/** + * Release a pre-attributes label to the Label Chunk list. + * + * @param label Label to be release + */ void isis_zebra_release_dynamic_label(mpls_label_t label) { struct listnode *node; @@ -549,24 +593,38 @@ void isis_zebra_release_dynamic_label(mpls_label_t label) } } +/** + * Connect to the Label Manager. + */ static void isis_zebra_label_manager_connect(void) { /* Connect to label manager. */ while (zclient_socket_connect(zclient_sync) < 0) { - zlog_warn("%s: error connecting synchronous zclient!", + zlog_warn("%s: re-attempt connecting synchronous zclient!", __func__); sleep(1); } + /* make socket non-blocking */ set_nonblocking(zclient_sync->sock); + + /* Send hello to notify zebra this is a synchronous client */ + while (zclient_send_hello(zclient_sync) < 0) { + zlog_warn( + "%s: re-attempt sending hello for synchronous zclient!", + __func__); + sleep(1); + } + + /* Connect to label manager */ while (lm_label_manager_connect(zclient_sync, 0) != 0) { - zlog_warn("%s: error connecting to label manager!", __func__); + zlog_warn("%s: re-attempt connecting to label manager!", __func__); sleep(1); } label_chunk_list = list_new(); label_chunk_list->del = isis_zebra_del_label_chunk; while (isis_zebra_get_label_chunk() != 0) { - zlog_warn("%s: error getting first label chunk!", __func__); + zlog_warn("%s: re-attempt getting first label chunk!", __func__); sleep(1); } } @@ -590,10 +648,17 @@ void isis_zebra_init(struct thread_master *master, int instance) zclient->redistribute_route_del = isis_zebra_read; /* Initialize special zclient for synchronous message exchanges. */ - zclient_sync = zclient_new(master, &zclient_options_default); + struct zclient_options options = zclient_options_default; + options.synchronous = true; + zclient_sync = zclient_new(master, &options); zclient_sync->sock = -1; zclient_sync->redist_default = ZEBRA_ROUTE_ISIS; zclient_sync->instance = instance; + /* + * session_id must be different from default value (0) to distinguish + * the asynchronous socket from the synchronous one + */ + zclient_sync->session_id = 1; zclient_sync->privs = &isisd_privs; } From cab10e86a4d966c64adf25dfd0f8ffaf8e6a11a4 Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Thu, 30 Apr 2020 11:23:15 +0200 Subject: [PATCH 12/18] isisd: IS-IS-SR preparation for master 1/5 * Rename RB-TREE variable from tree_sr_XXX to srdb_XXX * Replace parse_flags by an enum and rename it srdb_state which reflects more the role of this flag: determined the state of SR-Node and SR-Prefix stored in the SRDB: VALIDATED, NEW, MODIFIED, UNCHANGED Signed-off-by: Olivier Dugeon --- isisd/isis_sr.c | 119 +++++++++++++++++++++++++----------------------- isisd/isis_sr.h | 46 ++++++++++--------- 2 files changed, 85 insertions(+), 80 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 9bdb2c40e8..596e6ab1b6 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -61,9 +61,9 @@ static inline int sr_prefix_sid_compare(const struct sr_prefix *a, { return prefix_cmp(&a->prefix, &b->prefix); } -DECLARE_RBTREE_UNIQ(tree_sr_node_prefix, struct sr_prefix, node_entry, +DECLARE_RBTREE_UNIQ(srdb_node_prefix, struct sr_prefix, node_entry, sr_prefix_sid_compare) -DECLARE_RBTREE_UNIQ(tree_sr_area_prefix, struct sr_prefix, area_entry, +DECLARE_RBTREE_UNIQ(srdb_area_prefix, struct sr_prefix, area_entry, sr_prefix_sid_compare) static inline int sr_prefix_sid_cfg_compare(const struct sr_prefix_cfg *a, @@ -71,7 +71,7 @@ static inline int sr_prefix_sid_cfg_compare(const struct sr_prefix_cfg *a, { return prefix_cmp(&a->prefix, &b->prefix); } -DECLARE_RBTREE_UNIQ(tree_sr_prefix_cfg, struct sr_prefix_cfg, entry, +DECLARE_RBTREE_UNIQ(srdb_prefix_cfg, struct sr_prefix_cfg, entry, sr_prefix_sid_cfg_compare) static inline int sr_node_compare(const struct sr_node *a, @@ -79,7 +79,7 @@ static inline int sr_node_compare(const struct sr_node *a, { return memcmp(a->sysid, b->sysid, ISIS_SYS_ID_LEN); } -DECLARE_RBTREE_UNIQ(tree_sr_node, struct sr_node, entry, sr_node_compare) +DECLARE_RBTREE_UNIQ(srdb_node, struct sr_node, entry, sr_node_compare) /*----------------------------------------------------------------------------*/ @@ -116,7 +116,7 @@ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, /* Reinstall local Prefix-SIDs to update their input labels. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { - frr_each (tree_sr_area_prefix, + frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { isis_sr_prefix_reinstall(srp, false); } @@ -161,7 +161,7 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, pcfg->node_sid = true; /* Save prefix-sid configuration. */ - tree_sr_prefix_cfg_add(&area->srdb.config.prefix_sids, pcfg); + srdb_prefix_cfg_add(&area->srdb.config.prefix_sids, pcfg); return pcfg; } @@ -172,7 +172,7 @@ void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg) struct isis_area *area; area = pcfg->area; - tree_sr_prefix_cfg_del(&area->srdb.config.prefix_sids, pcfg); + srdb_prefix_cfg_del(&area->srdb.config.prefix_sids, pcfg); XFREE(MTYPE_ISIS_SR_INFO, pcfg); } @@ -183,7 +183,7 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_find(struct isis_area *area, struct sr_prefix_cfg pcfg = {}; prefix_copy(&pcfg.prefix, prefix.p); - return tree_sr_prefix_cfg_find(&area->srdb.config.prefix_sids, &pcfg); + return srdb_prefix_cfg_find(&area->srdb.config.prefix_sids, &pcfg); } /* Fill in Prefix-SID Sub-TLV according to the corresponding configuration. */ @@ -244,9 +244,9 @@ static struct sr_prefix *isis_sr_prefix_add(struct isis_area *area, srp->u.remote.rinfo = NULL; } srp->srn = srn; - tree_sr_node_prefix_add(&srn->prefix_sids, srp); + srdb_node_prefix_add(&srn->prefix_sids, srp); /* TODO: this might fail if we have Anycast SIDs in the IS-IS area. */ - tree_sr_area_prefix_add(&area->srdb.prefix_sids[srn->level - 1], srp); + srdb_area_prefix_add(&area->srdb.prefix_sids[srn->level - 1], srp); return srp; } @@ -255,8 +255,8 @@ static void isis_sr_prefix_del(struct isis_area *area, struct sr_node *srn, struct sr_prefix *srp) { isis_sr_prefix_uninstall(srp); - tree_sr_node_prefix_del(&srn->prefix_sids, srp); - tree_sr_area_prefix_del(&area->srdb.prefix_sids[srn->level - 1], srp); + srdb_node_prefix_del(&srn->prefix_sids, srp); + srdb_area_prefix_del(&area->srdb.prefix_sids[srn->level - 1], srp); XFREE(MTYPE_ISIS_SR_INFO, srp); } @@ -267,7 +267,7 @@ static struct sr_prefix *isis_sr_prefix_find_area(struct isis_area *area, struct sr_prefix srp = {}; prefix_copy(&srp.prefix, prefix.p); - return tree_sr_area_prefix_find(&area->srdb.prefix_sids[level - 1], + return srdb_area_prefix_find(&area->srdb.prefix_sids[level - 1], &srp); } @@ -277,7 +277,7 @@ static struct sr_prefix *isis_sr_prefix_find_node(struct sr_node *srn, struct sr_prefix srp = {}; prefix_copy(&srp.prefix, prefix.p); - return tree_sr_node_prefix_find(&srn->prefix_sids, &srp); + return srdb_node_prefix_find(&srn->prefix_sids, &srp); } static struct sr_node *isis_sr_node_add(struct isis_area *area, int level, @@ -291,8 +291,8 @@ static struct sr_node *isis_sr_node_add(struct isis_area *area, int level, memcpy(srn->sysid, sysid, ISIS_SYS_ID_LEN); srn->cap = *cap; srn->area = area; - tree_sr_node_prefix_init(&srn->prefix_sids); - tree_sr_node_add(&area->srdb.sr_nodes[level - 1], srn); + srdb_node_prefix_init(&srn->prefix_sids); + srdb_node_add(&area->srdb.sr_nodes[level - 1], srn); return srn; } @@ -301,14 +301,14 @@ static void isis_sr_node_del(struct isis_area *area, int level, struct sr_node *srn) { /* Remove and uninstall Prefix-SIDs. */ - while (tree_sr_node_prefix_count(&srn->prefix_sids) > 0) { + while (srdb_node_prefix_count(&srn->prefix_sids) > 0) { struct sr_prefix *srp; - srp = tree_sr_node_prefix_first(&srn->prefix_sids); + srp = srdb_node_prefix_first(&srn->prefix_sids); isis_sr_prefix_del(area, srn, srp); } - tree_sr_node_del(&area->srdb.sr_nodes[level - 1], srn); + srdb_node_del(&area->srdb.sr_nodes[level - 1], srn); XFREE(MTYPE_ISIS_SR_INFO, srn); } @@ -318,7 +318,7 @@ static struct sr_node *isis_sr_node_find(struct isis_area *area, int level, struct sr_node srn = {}; memcpy(srn.sysid, sysid, ISIS_SYS_ID_LEN); - return tree_sr_node_find(&area->srdb.sr_nodes[level - 1], &srn); + return srdb_node_find(&area->srdb.sr_nodes[level - 1], &srn); } static void isis_sr_adj_srgb_update(struct isis_area *area, uint8_t *sysid, @@ -326,7 +326,7 @@ static void isis_sr_adj_srgb_update(struct isis_area *area, uint8_t *sysid, { struct sr_prefix *srp; - frr_each (tree_sr_area_prefix, &area->srdb.prefix_sids[level - 1], + frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { struct listnode *node; struct isis_nexthop *nh; @@ -688,12 +688,12 @@ isis_sr_parse_router_cap_tlv(struct isis_area *area, int level, if (srn) { if (memcmp(&srn->cap, router_cap, sizeof(srn->cap)) != 0) { srn->cap = *router_cap; - SET_FLAG(srn->parse_flags, F_ISIS_SR_NODE_MODIFIED); + srn->state = SRDB_STATE_MODIFIED; } else - SET_FLAG(srn->parse_flags, F_ISIS_SR_NODE_UNCHANGED); + srn->state = SRDB_STATE_UNCHANGED; } else { srn = isis_sr_node_add(area, level, sysid, router_cap); - SET_FLAG(srn->parse_flags, F_ISIS_SR_NODE_NEW); + srn->state = SRDB_STATE_NEW; } return srn; @@ -721,15 +721,13 @@ static void isis_sr_parse_prefix_sid_subtlvs(struct sr_node *srn, || srp->sid.algorithm != psid->algorithm || srp->sid.value != psid->value) { srp->sid = *psid; - SET_FLAG(srp->parse_flags, - F_ISIS_SR_PREFIX_SID_MODIFIED); + srp->state = SRDB_STATE_MODIFIED; } else - SET_FLAG(srp->parse_flags, - F_ISIS_SR_PREFIX_SID_UNCHANGED); + srp->state = SRDB_STATE_UNCHANGED; } else { srp = isis_sr_prefix_add(area, srn, prefix, local, psid); - SET_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_NEW); + srp->state = SRDB_STATE_NEW; } /* * Stop the Prefix-SID iteration since we only support the SPF @@ -819,19 +817,17 @@ static void isis_sr_process_prefix_changes(struct sr_node *srn, /* Log any Prefix-SID change in the LSPDB. */ if (IS_DEBUG_ISIS(DEBUG_SR)) { - if (CHECK_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_NEW)) + if (srp->state == SRDB_STATE_NEW) zlog_debug( "ISIS-SR (%s) Prefix-SID created: %pFX (sysid %s)", area->area_tag, &srp->prefix, sysid_print(srn->sysid)); - else if (CHECK_FLAG(srp->parse_flags, - F_ISIS_SR_PREFIX_SID_MODIFIED)) + else if (srp->state == SRDB_STATE_MODIFIED) zlog_debug( "ISIS-SR (%s) Prefix-SID modified: %pFX (sysid %s)", area->area_tag, &srp->prefix, sysid_print(srn->sysid)); - else if (!CHECK_FLAG(srp->parse_flags, - F_ISIS_SR_PREFIX_SID_UNCHANGED)) + else if (srp->state != SRDB_STATE_UNCHANGED) zlog_debug( "ISIS-SR (%s) Prefix-SID removed: %pFX (sysid %s)", area->area_tag, &srp->prefix, @@ -839,17 +835,21 @@ static void isis_sr_process_prefix_changes(struct sr_node *srn, } /* Install/reinstall/uninstall Prefix-SID if necessary. */ - if (CHECK_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_NEW)) + switch (srp->state) { + case SRDB_STATE_NEW: isis_sr_prefix_install(srp); - else if (CHECK_FLAG(srp->parse_flags, F_ISIS_SR_PREFIX_SID_MODIFIED)) + break; + case SRDB_STATE_MODIFIED: isis_sr_prefix_reinstall(srp, false); - else if (!CHECK_FLAG(srp->parse_flags, - F_ISIS_SR_PREFIX_SID_UNCHANGED)) { + break; + case SRDB_STATE_UNCHANGED: + break; + default: isis_sr_prefix_del(area, srn, srp); return; } - srp->parse_flags = 0; + srp->state = SRDB_STATE_VALIDATED; } /* Process any new/deleted/modified SRGB in the LSPDB. */ @@ -864,14 +864,13 @@ static void isis_sr_process_node_changes(struct isis_area *area, int level, /* Log any SRGB change in the LSPDB. */ if (IS_DEBUG_ISIS(DEBUG_SR)) { - if (CHECK_FLAG(srn->parse_flags, F_ISIS_SR_NODE_NEW)) + if (srn->state == SRDB_STATE_NEW) zlog_debug("ISIS-SR (%s) SRGB created (sysid %s)", area->area_tag, sysid_print(sysid)); - else if (CHECK_FLAG(srn->parse_flags, F_ISIS_SR_NODE_MODIFIED)) + else if (srn->state == SRDB_STATE_MODIFIED) zlog_debug("ISIS-SR (%s) SRGB modified (sysid %s)", area->area_tag, sysid_print(sysid)); - else if (!CHECK_FLAG(srn->parse_flags, - F_ISIS_SR_NODE_UNCHANGED)) + else if (srn->state != SRDB_STATE_UNCHANGED) zlog_debug("ISIS-SR (%s) SRGB removed (sysid %s)", area->area_tag, sysid_print(sysid)); } @@ -881,11 +880,15 @@ static void isis_sr_process_node_changes(struct isis_area *area, int level, * all Prefix-SIDs from all nodes. */ adjacent = isis_adj_exists(area, level, sysid); - if (CHECK_FLAG(srn->parse_flags, - F_ISIS_SR_NODE_NEW | F_ISIS_SR_NODE_MODIFIED)) { + switch (srn->state) { + case SRDB_STATE_NEW: + case SRDB_STATE_MODIFIED: if (adjacent) isis_sr_adj_srgb_update(area, sysid, level); - } else if (!CHECK_FLAG(srn->parse_flags, F_ISIS_SR_NODE_UNCHANGED)) { + break; + case SRDB_STATE_UNCHANGED: + break; + default: isis_sr_node_del(area, level, srn); if (adjacent) @@ -893,9 +896,9 @@ static void isis_sr_process_node_changes(struct isis_area *area, int level, return; } - srn->parse_flags = 0; + srn->state = SRDB_STATE_VALIDATED; - frr_each_safe (tree_sr_node_prefix, &srn->prefix_sids, srp) + frr_each_safe (srdb_node_prefix, &srn->prefix_sids, srp) isis_sr_process_prefix_changes(srn, srp); } @@ -912,7 +915,7 @@ void isis_area_verify_sr(struct isis_area *area) /* Process possible SR-related changes in the LDPSB. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { - frr_each_safe (tree_sr_node, &area->srdb.sr_nodes[level - 1], + frr_each_safe (srdb_node, &area->srdb.sr_nodes[level - 1], srn) isis_sr_process_node_changes(area, level, srn); } @@ -1305,7 +1308,7 @@ static void isis_sr_show_prefix_sids(struct vty *vty, struct isis_area *area, struct sr_prefix *srp; struct ttable *tt; - if (tree_sr_area_prefix_count(&area->srdb.prefix_sids[level - 1]) == 0) + if (srdb_area_prefix_count(&area->srdb.prefix_sids[level - 1]) == 0) return; vty_out(vty, " IS-IS %s Prefix-SIDs:\n\n", circuit_t2string(level)); @@ -1318,7 +1321,7 @@ static void isis_sr_show_prefix_sids(struct vty *vty, struct isis_area *area, ttable_restyle(tt); ttable_rowseps(tt, 0, BOTTOM, true, '-'); - frr_each (tree_sr_area_prefix, &area->srdb.prefix_sids[level - 1], + frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { switch (srp->type) { case ISIS_SR_PREFIX_LOCAL: @@ -1440,10 +1443,10 @@ void isis_sr_stop(struct isis_area *area) /* Uninstall Prefix-SIDs. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { - while (tree_sr_node_count(&srdb->sr_nodes[level - 1]) > 0) { + while (srdb_node_count(&srdb->sr_nodes[level - 1]) > 0) { struct sr_node *srn; - srn = tree_sr_node_first(&srdb->sr_nodes[level - 1]); + srn = srdb_node_first(&srdb->sr_nodes[level - 1]); isis_sr_node_del(area, level, srn); } } @@ -1465,8 +1468,8 @@ void isis_sr_area_init(struct isis_area *area) srdb->adj_sids = list_new(); for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { - tree_sr_node_init(&srdb->sr_nodes[level - 1]); - tree_sr_area_prefix_init(&srdb->prefix_sids[level - 1]); + srdb_node_init(&srdb->sr_nodes[level - 1]); + srdb_area_prefix_init(&srdb->prefix_sids[level - 1]); } /* Pull defaults from the YANG module. */ @@ -1482,7 +1485,7 @@ void isis_sr_area_init(struct isis_area *area) srdb->config.srgb_upper_bound = SRGB_UPPER_BOUND; #endif srdb->config.msd = 0; - tree_sr_prefix_cfg_init(&srdb->config.prefix_sids); + srdb_prefix_cfg_init(&srdb->config.prefix_sids); } void isis_sr_area_term(struct isis_area *area) @@ -1494,10 +1497,10 @@ void isis_sr_area_term(struct isis_area *area) isis_sr_stop(area); /* Clear Prefix-SID configuration. */ - while (tree_sr_prefix_cfg_count(&srdb->config.prefix_sids) > 0) { + while (srdb_prefix_cfg_count(&srdb->config.prefix_sids) > 0) { struct sr_prefix_cfg *pcfg; - pcfg = tree_sr_prefix_cfg_first(&srdb->config.prefix_sids); + pcfg = srdb_prefix_cfg_first(&srdb->config.prefix_sids); isis_sr_cfg_prefix_del(pcfg); } } diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index 286ebeb953..a7d52aafe1 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -55,10 +55,10 @@ #define SRGB_LOWER_BOUND 16000 #define SRGB_UPPER_BOUND 23999 -PREDECL_RBTREE_UNIQ(tree_sr_node) -PREDECL_RBTREE_UNIQ(tree_sr_node_prefix) -PREDECL_RBTREE_UNIQ(tree_sr_area_prefix) -PREDECL_RBTREE_UNIQ(tree_sr_prefix_cfg) +PREDECL_RBTREE_UNIQ(srdb_node) +PREDECL_RBTREE_UNIQ(srdb_node_prefix) +PREDECL_RBTREE_UNIQ(srdb_area_prefix) +PREDECL_RBTREE_UNIQ(srdb_prefix_cfg) /* SR Adj-SID type. */ enum sr_adj_type { @@ -100,11 +100,19 @@ struct sr_nexthop_info { time_t uptime; }; +/* State of Object (SR-Node and SR-Prefix) stored in SRDB */ +enum srdb_state { + SRDB_STATE_VALIDATED = 0, + SRDB_STATE_NEW, + SRDB_STATE_MODIFIED, + SRDB_STATE_UNCHANGED +}; + /* SR Prefix-SID. */ struct sr_prefix { /* RB-tree entries. */ - struct tree_sr_node_prefix_item node_entry; - struct tree_sr_area_prefix_item area_entry; + struct srdb_node_prefix_item node_entry; + struct srdb_area_prefix_item area_entry; /* IP prefix. */ struct prefix prefix; @@ -131,17 +139,14 @@ struct sr_prefix { /* Backpointer to SR node. */ struct sr_node *srn; - /* Flags used while the LSPDB is being parsed. */ - uint8_t parse_flags; -#define F_ISIS_SR_PREFIX_SID_NEW 0x01 -#define F_ISIS_SR_PREFIX_SID_MODIFIED 0x02 -#define F_ISIS_SR_PREFIX_SID_UNCHANGED 0x04 + /* SR-Prefix State used while the LSPDB is being parsed. */ + enum srdb_state state; }; /* SR node. */ struct sr_node { /* RB-tree entry. */ - struct tree_sr_node_item entry; + struct srdb_node_item entry; /* IS-IS level: ISIS_LEVEL1 or ISIS_LEVEL2. */ int level; @@ -153,16 +158,13 @@ struct sr_node { struct isis_router_cap cap; /* List of Prefix-SIDs advertised by this node. */ - struct tree_sr_node_prefix_head prefix_sids; + struct srdb_node_prefix_head prefix_sids; /* Backpointer to IS-IS area. */ struct isis_area *area; - /* Flags used while the LSPDB is being parsed. */ - uint8_t parse_flags; -#define F_ISIS_SR_NODE_NEW 0x01 -#define F_ISIS_SR_NODE_MODIFIED 0x02 -#define F_ISIS_SR_NODE_UNCHANGED 0x04 + /* SR-Node State used while the LSPDB is being parsed. */ + enum srdb_state state; }; /* NOTE: these values must be in sync with the YANG module. */ @@ -181,7 +183,7 @@ enum sr_last_hop_behavior { /* SR Prefix-SID configuration. */ struct sr_prefix_cfg { /* RB-tree entry. */ - struct tree_sr_prefix_cfg_item entry; + struct srdb_prefix_cfg_item entry; /* IP prefix. */ struct prefix prefix; @@ -211,10 +213,10 @@ struct isis_sr_db { struct list *adj_sids; /* SR information from all nodes. */ - struct tree_sr_node_head sr_nodes[ISIS_LEVELS]; + struct srdb_node_head sr_nodes[ISIS_LEVELS]; /* Prefix-SIDs. */ - struct tree_sr_area_prefix_head prefix_sids[ISIS_LEVELS]; + struct srdb_area_prefix_head prefix_sids[ISIS_LEVELS]; /* Area SR configuration. */ struct { @@ -229,7 +231,7 @@ struct isis_sr_db { uint8_t msd; /* Prefix-SID mappings. */ - struct tree_sr_prefix_cfg_head prefix_sids; + struct srdb_prefix_cfg_head prefix_sids; } config; }; From b1d80d434cc56dcf19cf24cdc35b635de3dd0e7c Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Sun, 3 May 2020 20:01:20 +0200 Subject: [PATCH 13/18] isisd: IS-IS-SR preparation for master 2/5 * Rename functions following rules: isis_sr_XXX is kept for external functions and isis_sr prefix remove for static ones * Rename local_label & remote_label variables by input_label & output_label * Change parameter order (to follow other functions) in sr_node_srgb_update() Signed-off-by: Olivier Dugeon --- isisd/isis_sr.c | 343 ++++++++++++++++++++++----------------------- isisd/isis_sr.h | 4 +- isisd/isis_zebra.c | 4 +- 3 files changed, 168 insertions(+), 183 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 596e6ab1b6..63e26bfa67 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -50,8 +50,8 @@ DEFINE_MTYPE_STATIC(ISISD, ISIS_SR_INFO, "ISIS segment routing information") -static void isis_sr_prefix_uninstall(struct sr_prefix *srp); -static void isis_sr_prefix_reinstall(struct sr_prefix *srp, +static void sr_prefix_uninstall(struct sr_prefix *srp); +static void sr_prefix_reinstall(struct sr_prefix *srp, bool replace_semantics); /*----------------------------------------------------------------------------*/ @@ -84,8 +84,8 @@ DECLARE_RBTREE_UNIQ(srdb_node, struct sr_node, entry, sr_node_compare) /*----------------------------------------------------------------------------*/ /* Returns true if the interface/address pair corresponds to a Node-SID. */ -static bool isis_sr_prefix_is_node_sid(const struct interface *ifp, - const struct prefix *prefix) +static bool sr_prefix_is_node_sid(const struct interface *ifp, + const struct prefix *prefix) { return (if_is_loopback(ifp) && is_host_route(prefix)); } @@ -118,7 +118,7 @@ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { - isis_sr_prefix_reinstall(srp, false); + sr_prefix_reinstall(srp, false); } } @@ -157,7 +157,7 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, /* Set the N-flag when appropriate. */ ifp = if_lookup_prefix(prefix, VRF_DEFAULT); - if (ifp && isis_sr_prefix_is_node_sid(ifp, prefix)) + if (ifp && sr_prefix_is_node_sid(ifp, prefix)) pcfg->node_sid = true; /* Save prefix-sid configuration. */ @@ -224,18 +224,17 @@ void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, bool external, /*----------------------------------------------------------------------------*/ -static struct sr_prefix *isis_sr_prefix_add(struct isis_area *area, - struct sr_node *srn, - union prefixconstptr prefix, - bool local, - const struct isis_prefix_sid *psid) +static struct sr_prefix *sr_prefix_add(struct isis_area *area, + struct sr_node *srn, + union prefixconstptr prefix, bool local, + const struct isis_prefix_sid *psid) { struct sr_prefix *srp; srp = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*srp)); prefix_copy(&srp->prefix, prefix.p); srp->sid = *psid; - srp->local_label = MPLS_INVALID_LABEL; + srp->input_label = MPLS_INVALID_LABEL; if (local) { srp->type = ISIS_SR_PREFIX_LOCAL; isis_sr_nexthop_reset(&srp->u.local.info); @@ -251,18 +250,18 @@ static struct sr_prefix *isis_sr_prefix_add(struct isis_area *area, return srp; } -static void isis_sr_prefix_del(struct isis_area *area, struct sr_node *srn, - struct sr_prefix *srp) +static void sr_prefix_del(struct isis_area *area, struct sr_node *srn, + struct sr_prefix *srp) { - isis_sr_prefix_uninstall(srp); + sr_prefix_uninstall(srp); srdb_node_prefix_del(&srn->prefix_sids, srp); srdb_area_prefix_del(&area->srdb.prefix_sids[srn->level - 1], srp); XFREE(MTYPE_ISIS_SR_INFO, srp); } -static struct sr_prefix *isis_sr_prefix_find_area(struct isis_area *area, - int level, - union prefixconstptr prefix) +static struct sr_prefix *sr_prefix_find_by_area(struct isis_area *area, + int level, + union prefixconstptr prefix) { struct sr_prefix srp = {}; @@ -271,8 +270,8 @@ static struct sr_prefix *isis_sr_prefix_find_area(struct isis_area *area, &srp); } -static struct sr_prefix *isis_sr_prefix_find_node(struct sr_node *srn, - union prefixconstptr prefix) +static struct sr_prefix *sr_prefix_find_by_node(struct sr_node *srn, + union prefixconstptr prefix) { struct sr_prefix srp = {}; @@ -280,9 +279,9 @@ static struct sr_prefix *isis_sr_prefix_find_node(struct sr_node *srn, return srdb_node_prefix_find(&srn->prefix_sids, &srp); } -static struct sr_node *isis_sr_node_add(struct isis_area *area, int level, - const uint8_t *sysid, - const struct isis_router_cap *cap) +static struct sr_node *sr_node_add(struct isis_area *area, int level, + const uint8_t *sysid, + const struct isis_router_cap *cap) { struct sr_node *srn; @@ -297,23 +296,22 @@ static struct sr_node *isis_sr_node_add(struct isis_area *area, int level, return srn; } -static void isis_sr_node_del(struct isis_area *area, int level, - struct sr_node *srn) +static void sr_node_del(struct isis_area *area, int level, struct sr_node *srn) { /* Remove and uninstall Prefix-SIDs. */ while (srdb_node_prefix_count(&srn->prefix_sids) > 0) { struct sr_prefix *srp; srp = srdb_node_prefix_first(&srn->prefix_sids); - isis_sr_prefix_del(area, srn, srp); + sr_prefix_del(area, srn, srp); } srdb_node_del(&area->srdb.sr_nodes[level - 1], srn); XFREE(MTYPE_ISIS_SR_INFO, srn); } -static struct sr_node *isis_sr_node_find(struct isis_area *area, int level, - const uint8_t *sysid) +static struct sr_node *sr_node_find(struct isis_area *area, int level, + const uint8_t *sysid) { struct sr_node srn = {}; @@ -321,13 +319,12 @@ static struct sr_node *isis_sr_node_find(struct isis_area *area, int level, return srdb_node_find(&area->srdb.sr_nodes[level - 1], &srn); } -static void isis_sr_adj_srgb_update(struct isis_area *area, uint8_t *sysid, - int level) +static void sr_node_srgb_update(struct isis_area *area, int level, + uint8_t *sysid) { struct sr_prefix *srp; - frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], - srp) { + frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { struct listnode *node; struct isis_nexthop *nh; @@ -346,7 +343,7 @@ static void isis_sr_adj_srgb_update(struct isis_area *area, uint8_t *sysid, * Reinstall all Prefix-SID nexthops using route replace * semantics. */ - isis_sr_prefix_reinstall(srp, true); + sr_prefix_reinstall(srp, true); break; } } @@ -368,9 +365,9 @@ void isis_sr_nexthop_reset(struct sr_nexthop_info *srnh) /*----------------------------------------------------------------------------*/ /* Lookup IS-IS route in the SPT. */ -static struct isis_route_info * -isis_sr_prefix_lookup_route(struct isis_area *area, enum spf_tree_id tree_id, - struct sr_prefix *srp) +static struct isis_route_info *sr_prefix_lookup_route(struct isis_area *area, + enum spf_tree_id tree_id, + struct sr_prefix *srp) { struct route_node *rn; int level = srp->srn->level; @@ -387,7 +384,7 @@ isis_sr_prefix_lookup_route(struct isis_area *area, enum spf_tree_id tree_id, } /* Calculate Prefix-SID input label. */ -static mpls_label_t isis_sr_prefix_in_label(const struct sr_prefix *srp) +static mpls_label_t sr_prefix_in_label(const struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; struct isis_area *area = srn->area; @@ -410,9 +407,9 @@ static mpls_label_t isis_sr_prefix_in_label(const struct sr_prefix *srp) } /* Calculate Prefix-SID output label. */ -static mpls_label_t isis_sr_prefix_out_label(const struct sr_prefix *srp, - const struct sr_node *srn_nexthop, - const uint8_t *sysid) +static mpls_label_t sr_prefix_out_label(const struct sr_prefix *srp, + const struct sr_node *srn_nexthop, + const uint8_t *sysid) { const struct sr_node *srn = srp->srn; @@ -454,11 +451,11 @@ static mpls_label_t isis_sr_prefix_out_label(const struct sr_prefix *srp, } /* Process local Prefix-SID and install it if possible. */ -static int isis_sr_prefix_install_local(struct sr_prefix *srp) +static int sr_prefix_install_local(struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; struct isis_area *area = srn->area; - mpls_label_t local_label; + mpls_label_t input_label; /* * No need to install LSP to local Prefix-SID unless the @@ -479,12 +476,12 @@ static int isis_sr_prefix_install_local(struct sr_prefix *srp) } /* Calculate local label. */ - local_label = isis_sr_prefix_in_label(srp); - if (local_label == MPLS_INVALID_LABEL) + input_label = sr_prefix_in_label(srp); + if (input_label == MPLS_INVALID_LABEL) return -1; /* Update internal state. */ - srp->local_label = local_label; + srp->input_label = input_label; isis_sr_nexthop_update(&srp->u.local.info, MPLS_LABEL_IMPLICIT_NULL); /* Install Prefix-SID in the forwarding plane. */ @@ -494,19 +491,19 @@ static int isis_sr_prefix_install_local(struct sr_prefix *srp) } /* Process remote Prefix-SID and install it if possible. */ -static int isis_sr_prefix_install_remote(struct sr_prefix *srp) +static int sr_prefix_install_remote(struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; struct isis_area *area = srn->area; enum spf_tree_id tree_id; struct listnode *node; struct isis_nexthop *nexthop; - mpls_label_t local_label; + mpls_label_t input_label; size_t nexthop_num = 0; /* Lookup associated IS-IS route. */ tree_id = (srp->prefix.family == AF_INET) ? SPFTREE_IPV4 : SPFTREE_IPV6; - srp->u.remote.rinfo = isis_sr_prefix_lookup_route(area, tree_id, srp); + srp->u.remote.rinfo = sr_prefix_lookup_route(area, tree_id, srp); if (!srp->u.remote.rinfo) /* SPF hasn't converged for this route yet. */ return -1; @@ -520,18 +517,17 @@ static int isis_sr_prefix_install_remote(struct sr_prefix *srp) srp->sid.value, circuit_t2string(srn->level)); /* Calculate local label. */ - local_label = isis_sr_prefix_in_label(srp); - if (local_label == MPLS_INVALID_LABEL) + input_label = sr_prefix_in_label(srp); + if (input_label == MPLS_INVALID_LABEL) return -1; for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, nexthop)) { struct sr_node *srn_nexthop; - mpls_label_t remote_label; + mpls_label_t output_label; /* Check if the nexthop advertised a SRGB. */ - srn_nexthop = - isis_sr_node_find(area, srn->level, nexthop->sysid); + srn_nexthop = sr_node_find(area, srn->level, nexthop->sysid); if (!srn_nexthop) goto next; @@ -545,9 +541,9 @@ static int isis_sr_prefix_install_remote(struct sr_prefix *srp) && !IS_SR_IPV6(srn_nexthop->cap.srgb))) goto next; - remote_label = isis_sr_prefix_out_label(srp, srn_nexthop, + output_label = sr_prefix_out_label(srp, srn_nexthop, nexthop->sysid); - if (remote_label == MPLS_INVALID_LABEL) + if (output_label == MPLS_INVALID_LABEL) goto next; if (IS_DEBUG_ISIS(DEBUG_SR)) { @@ -555,10 +551,10 @@ static int isis_sr_prefix_install_remote(struct sr_prefix *srp) inet_ntop(nexthop->family, &nexthop->ip, buf, sizeof(buf)); - zlog_debug(" nexthop %s label %u", buf, remote_label); + zlog_debug(" nexthop %s label %u", buf, output_label); } - isis_sr_nexthop_update(&nexthop->sr, remote_label); + isis_sr_nexthop_update(&nexthop->sr, output_label); nexthop_num++; continue; next: @@ -571,7 +567,7 @@ static int isis_sr_prefix_install_remote(struct sr_prefix *srp) } /* Update internal state. */ - srp->local_label = local_label; + srp->input_label = input_label; /* Install Prefix-SID in the forwarding plane. */ isis_zebra_install_prefix_sid(srp); @@ -580,7 +576,7 @@ static int isis_sr_prefix_install_remote(struct sr_prefix *srp) } /* Process local or remote Prefix-SID and install it if possible. */ -static void isis_sr_prefix_install(struct sr_prefix *srp) +static void sr_prefix_install(struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; struct isis_area *area = srn->area; @@ -592,14 +588,14 @@ static void isis_sr_prefix_install(struct sr_prefix *srp) switch (srn->level) { case ISIS_LEVEL1: - srp_l2 = isis_sr_prefix_find_area(area, ISIS_LEVEL2, - &srp->prefix); + srp_l2 = sr_prefix_find_by_area(area, ISIS_LEVEL2, + &srp->prefix); if (srp_l2) - isis_sr_prefix_uninstall(srp_l2); + sr_prefix_uninstall(srp_l2); break; case ISIS_LEVEL2: - srp_l1 = isis_sr_prefix_find_area(area, ISIS_LEVEL1, - &srp->prefix); + srp_l1 = sr_prefix_find_by_area(area, ISIS_LEVEL1, + &srp->prefix); if (srp_l1) return; break; @@ -609,21 +605,21 @@ static void isis_sr_prefix_install(struct sr_prefix *srp) } if (srp->type == ISIS_SR_PREFIX_LOCAL) - ret = isis_sr_prefix_install_local(srp); + ret = sr_prefix_install_local(srp); else - ret = isis_sr_prefix_install_remote(srp); + ret = sr_prefix_install_remote(srp); if (ret != 0) - isis_sr_prefix_uninstall(srp); + sr_prefix_uninstall(srp); } /* Uninstall local or remote Prefix-SID. */ -static void isis_sr_prefix_uninstall(struct sr_prefix *srp) +static void sr_prefix_uninstall(struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; struct listnode *node; struct isis_nexthop *nexthop; - if (srp->local_label == MPLS_INVALID_LABEL) + if (srp->input_label == MPLS_INVALID_LABEL) return; if (IS_DEBUG_ISIS(DEBUG_SR)) @@ -640,7 +636,7 @@ static void isis_sr_prefix_uninstall(struct sr_prefix *srp) isis_zebra_uninstall_prefix_sid(srp); /* Reset internal state. */ - srp->local_label = MPLS_INVALID_LABEL; + srp->input_label = MPLS_INVALID_LABEL; switch (srp->type) { case ISIS_SR_PREFIX_LOCAL: isis_sr_nexthop_reset(&srp->u.local.info); @@ -656,8 +652,7 @@ static void isis_sr_prefix_uninstall(struct sr_prefix *srp) } /* Reinstall local or remote Prefix-SID. */ -static void isis_sr_prefix_reinstall(struct sr_prefix *srp, - bool replace_semantics) +static void sr_prefix_reinstall(struct sr_prefix *srp, bool replace_semantics) { /* * Route replace semantics can be used only when we know for sure that @@ -666,25 +661,24 @@ static void isis_sr_prefix_reinstall(struct sr_prefix *srp, * reinstalling it. */ if (!replace_semantics) - isis_sr_prefix_uninstall(srp); + sr_prefix_uninstall(srp); - isis_sr_prefix_install(srp); + sr_prefix_install(srp); } /*----------------------------------------------------------------------------*/ /* Parse all SR-related information from the given Router Capabilities TLV. */ static struct sr_node * -isis_sr_parse_router_cap_tlv(struct isis_area *area, int level, - const uint8_t *sysid, - const struct isis_router_cap *router_cap) +parse_router_cap_tlv(struct isis_area *area, int level, const uint8_t *sysid, + const struct isis_router_cap *router_cap) { struct sr_node *srn; if (!router_cap || router_cap->srgb.range_size == 0) return NULL; - srn = isis_sr_node_find(area, level, sysid); + srn = sr_node_find(area, level, sysid); if (srn) { if (memcmp(&srn->cap, router_cap, sizeof(srn->cap)) != 0) { srn->cap = *router_cap; @@ -692,7 +686,7 @@ isis_sr_parse_router_cap_tlv(struct isis_area *area, int level, } else srn->state = SRDB_STATE_UNCHANGED; } else { - srn = isis_sr_node_add(area, level, sysid, router_cap); + srn = sr_node_add(area, level, sysid, router_cap); srn->state = SRDB_STATE_NEW; } @@ -700,10 +694,9 @@ isis_sr_parse_router_cap_tlv(struct isis_area *area, int level, } /* Parse list of Prefix-SID Sub-TLVs. */ -static void isis_sr_parse_prefix_sid_subtlvs(struct sr_node *srn, - union prefixconstptr prefix, - bool local, - struct isis_item_list *prefix_sids) +static void parse_prefix_sid_subtlvs(struct sr_node *srn, + union prefixconstptr prefix, bool local, + struct isis_item_list *prefix_sids) { struct isis_area *area = srn->area; struct isis_item *i; @@ -715,7 +708,7 @@ static void isis_sr_parse_prefix_sid_subtlvs(struct sr_node *srn, if (psid->algorithm != SR_ALGORITHM_SPF) continue; - srp = isis_sr_prefix_find_node(srn, prefix); + srp = sr_prefix_find_by_node(srn, prefix); if (srp) { if (srp->sid.flags != psid->flags || srp->sid.algorithm != psid->algorithm @@ -725,8 +718,7 @@ static void isis_sr_parse_prefix_sid_subtlvs(struct sr_node *srn, } else srp->state = SRDB_STATE_UNCHANGED; } else { - srp = isis_sr_prefix_add(area, srn, prefix, local, - psid); + srp = sr_prefix_add(area, srn, prefix, local, psid); srp->state = SRDB_STATE_NEW; } /* @@ -738,8 +730,8 @@ static void isis_sr_parse_prefix_sid_subtlvs(struct sr_node *srn, } /* Parse all SR-related information from the given LSP. */ -static void isis_sr_parse_lsp(struct isis_area *area, int level, - struct sr_node **srn, struct isis_lsp *lsp) +static void parse_lsp(struct isis_area *area, int level, struct sr_node **srn, + struct isis_lsp *lsp) { struct isis_item_list *items; struct isis_item *i; @@ -752,7 +744,7 @@ static void isis_sr_parse_lsp(struct isis_area *area, int level, /* Parse the Router Capability TLV. */ if (*srn == NULL) { - *srn = isis_sr_parse_router_cap_tlv( + *srn = parse_router_cap_tlv( area, level, lsp->hdr.lsp_id, lsp->tlvs->router_cap); if (!*srn) return; @@ -767,8 +759,8 @@ static void isis_sr_parse_lsp(struct isis_area *area, int level, if (!ir->subtlvs) continue; - isis_sr_parse_prefix_sid_subtlvs(*srn, &ir->prefix, local, - &ir->subtlvs->prefix_sids); + parse_prefix_sid_subtlvs(*srn, &ir->prefix, local, + &ir->subtlvs->prefix_sids); } /* Parse Multi Topology Reachable IPv6 Prefixes TLV. */ @@ -781,13 +773,13 @@ static void isis_sr_parse_lsp(struct isis_area *area, int level, if (!ir->subtlvs) continue; - isis_sr_parse_prefix_sid_subtlvs(*srn, &ir->prefix, local, - &ir->subtlvs->prefix_sids); + parse_prefix_sid_subtlvs(*srn, &ir->prefix, local, + &ir->subtlvs->prefix_sids); } } /* Parse all SR-related information from the entire LSPDB. */ -static void isis_sr_parse_lspdb(struct isis_area *area) +static void parse_lspdb(struct isis_area *area) { struct isis_lsp *lsp; @@ -802,16 +794,15 @@ static void isis_sr_parse_lspdb(struct isis_area *area) if (!lsp->tlvs) continue; - isis_sr_parse_lsp(area, level, &srn, lsp); + parse_lsp(area, level, &srn, lsp); for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) - isis_sr_parse_lsp(area, level, &srn, frag); + parse_lsp(area, level, &srn, frag); } } } /* Process any new/deleted/modified Prefix-SID in the LSPDB. */ -static void isis_sr_process_prefix_changes(struct sr_node *srn, - struct sr_prefix *srp) +static void process_prefix_changes(struct sr_node *srn, struct sr_prefix *srp) { struct isis_area *area = srn->area; @@ -837,15 +828,15 @@ static void isis_sr_process_prefix_changes(struct sr_node *srn, /* Install/reinstall/uninstall Prefix-SID if necessary. */ switch (srp->state) { case SRDB_STATE_NEW: - isis_sr_prefix_install(srp); + sr_prefix_install(srp); break; case SRDB_STATE_MODIFIED: - isis_sr_prefix_reinstall(srp, false); + sr_prefix_reinstall(srp, false); break; case SRDB_STATE_UNCHANGED: break; default: - isis_sr_prefix_del(area, srn, srp); + sr_prefix_del(area, srn, srp); return; } @@ -853,8 +844,8 @@ static void isis_sr_process_prefix_changes(struct sr_node *srn, } /* Process any new/deleted/modified SRGB in the LSPDB. */ -static void isis_sr_process_node_changes(struct isis_area *area, int level, - struct sr_node *srn) +static void process_node_changes(struct isis_area *area, int level, + struct sr_node *srn) { struct sr_prefix *srp; uint8_t sysid[ISIS_SYS_ID_LEN]; @@ -884,22 +875,22 @@ static void isis_sr_process_node_changes(struct isis_area *area, int level, case SRDB_STATE_NEW: case SRDB_STATE_MODIFIED: if (adjacent) - isis_sr_adj_srgb_update(area, sysid, level); + sr_node_srgb_update(area, sysid, level); break; case SRDB_STATE_UNCHANGED: break; default: - isis_sr_node_del(area, level, srn); + sr_node_del(area, level, srn); if (adjacent) - isis_sr_adj_srgb_update(area, sysid, level); + sr_node_srgb_update(area, level, sysid); return; } srn->state = SRDB_STATE_VALIDATED; frr_each_safe (srdb_node_prefix, &srn->prefix_sids, srp) - isis_sr_process_prefix_changes(srn, srp); + process_prefix_changes(srn, srp); } /* Parse and process all SR-related Sub-TLVs after running the SPF algorithm. */ @@ -911,13 +902,12 @@ void isis_area_verify_sr(struct isis_area *area) return; /* Parse LSPDB to detect new/deleted/modified SR (sub-)TLVs. */ - isis_sr_parse_lspdb(area); + parse_lspdb(area); /* Process possible SR-related changes in the LDPSB. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { - frr_each_safe (srdb_node, &area->srdb.sr_nodes[level - 1], - srn) - isis_sr_process_node_changes(area, level, srn); + frr_each_safe (srdb_node, &area->srdb.sr_nodes[level - 1], srn) + process_node_changes(area, level, srn); } } @@ -925,8 +915,8 @@ void isis_area_verify_sr(struct isis_area *area) * Once a route is updated in the SPT, reinstall or uninstall its corresponding * Prefix-SID (if any). */ -static int isis_sr_route_update(struct isis_area *area, struct prefix *prefix, - struct isis_route_info *route_info) +static int sr_route_update(struct isis_area *area, struct prefix *prefix, + struct isis_route_info *route_info) { struct sr_prefix *srp; @@ -935,16 +925,15 @@ static int isis_sr_route_update(struct isis_area *area, struct prefix *prefix, switch (area->is_type) { case IS_LEVEL_1: - srp = isis_sr_prefix_find_area(area, ISIS_LEVEL1, prefix); + srp = sr_prefix_find_by_area(area, ISIS_LEVEL1, prefix); break; case IS_LEVEL_2: - srp = isis_sr_prefix_find_area(area, ISIS_LEVEL2, prefix); + srp = sr_prefix_find_by_area(area, ISIS_LEVEL2, prefix); break; case IS_LEVEL_1_AND_2: - srp = isis_sr_prefix_find_area(area, ISIS_LEVEL1, prefix); + srp = sr_prefix_find_by_area(area, ISIS_LEVEL1, prefix); if (!srp) - srp = isis_sr_prefix_find_area(area, ISIS_LEVEL2, - prefix); + srp = sr_prefix_find_by_area(area, ISIS_LEVEL2, prefix); break; default: flog_err(EC_LIB_DEVELOPMENT, "%s: unknown area level", @@ -956,10 +945,10 @@ static int isis_sr_route_update(struct isis_area *area, struct prefix *prefix, return 0; if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) { - isis_sr_prefix_reinstall(srp, true); + sr_prefix_reinstall(srp, true); srp->u.remote.rinfo = route_info; } else { - isis_sr_prefix_uninstall(srp); + sr_prefix_uninstall(srp); srp->u.remote.rinfo = NULL; } @@ -969,8 +958,8 @@ static int isis_sr_route_update(struct isis_area *area, struct prefix *prefix, /*----------------------------------------------------------------------------*/ /* Install or uninstall (LAN)-Adj-SID. */ -static void isis_sr_adj_sid_install_uninstall(bool install, - const struct sr_adjacency *sra) +static void sr_adj_sid_install_uninstall(bool install, + const struct sr_adjacency *sra) { struct zapi_labels zl; struct zapi_nexthop *znh; @@ -995,8 +984,8 @@ static void isis_sr_adj_sid_install_uninstall(bool install, } /* Add new local Adj-SID. */ -static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, - bool backup) +static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, + bool backup) { struct isis_circuit *circuit = adj->circuit; struct isis_area *area = circuit->area; @@ -1005,7 +994,7 @@ static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, struct isis_lan_adj_sid *ladj_sid; union g_addr nexthop = {}; uint8_t flags; - mpls_label_t local_label; + mpls_label_t input_label; switch (family) { case AF_INET: @@ -1032,7 +1021,7 @@ static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, if (backup) SET_FLAG(flags, EXT_SUBTLV_LINK_ADJ_SID_BFLG); - local_label = isis_zebra_request_dynamic_label(); + input_label = isis_zebra_request_dynamic_label(); if (circuit->ext == NULL) circuit->ext = isis_alloc_ext_subtlvs(); @@ -1042,14 +1031,14 @@ static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, inet_ntop(family, &nexthop, buf, sizeof(buf)); zlog_debug("ISIS-SR (%s) installing Adj-SID %s%%%s label %u", area->area_tag, buf, circuit->interface->name, - local_label); + input_label); } sra = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*sra)); sra->type = backup ? ISIS_SR_LAN_BACKUP : ISIS_SR_ADJ_NORMAL; sra->nexthop.family = family; sra->nexthop.address = nexthop; - sra->nexthop.label = local_label; + sra->nexthop.label = input_label; switch (circuit->circ_type) { case CIRCUIT_T_BROADCAST: ladj_sid = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*ladj_sid)); @@ -1058,7 +1047,7 @@ static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, ladj_sid->weight = 0; memcpy(ladj_sid->neighbor_id, adj->sysid, sizeof(ladj_sid->neighbor_id)); - ladj_sid->sid = local_label; + ladj_sid->sid = input_label; isis_tlvs_add_lan_adj_sid(circuit->ext, ladj_sid); sra->u.ladj_sid = ladj_sid; break; @@ -1067,7 +1056,7 @@ static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, adj_sid->family = family; adj_sid->flags = flags; adj_sid->weight = 0; - adj_sid->sid = local_label; + adj_sid->sid = input_label; isis_tlvs_add_adj_sid(circuit->ext, adj_sid); sra->u.adj_sid = adj_sid; break; @@ -1080,17 +1069,17 @@ static void isis_sr_adj_sid_add_single(struct isis_adjacency *adj, int family, listnode_add(area->srdb.adj_sids, sra); listnode_add(adj->adj_sids, sra); - isis_sr_adj_sid_install_uninstall(true, sra); + sr_adj_sid_install_uninstall(true, sra); } -static void isis_sr_adj_sid_add(struct isis_adjacency *adj, int family) +static void sr_adj_sid_add(struct isis_adjacency *adj, int family) { - isis_sr_adj_sid_add_single(adj, family, false); - isis_sr_adj_sid_add_single(adj, family, true); + sr_adj_sid_add_single(adj, family, false); + sr_adj_sid_add_single(adj, family, true); } /* Delete local Adj-SID. */ -static void isis_sr_adj_sid_del(struct sr_adjacency *sra) +static void sr_adj_sid_del(struct sr_adjacency *sra) { struct isis_circuit *circuit = sra->adj->circuit; struct isis_area *area = circuit->area; @@ -1104,7 +1093,7 @@ static void isis_sr_adj_sid_del(struct sr_adjacency *sra) area->area_tag, buf, circuit->interface->name); } - isis_sr_adj_sid_install_uninstall(false, sra); + sr_adj_sid_install_uninstall(false, sra); switch (circuit->circ_type) { case CIRCUIT_T_BROADCAST: @@ -1127,7 +1116,7 @@ static void isis_sr_adj_sid_del(struct sr_adjacency *sra) } /* Remove all Adj-SIDs associated to an adjacency that is going down. */ -static int isis_sr_adj_state_change(struct isis_adjacency *adj) +static int sr_adj_state_change(struct isis_adjacency *adj) { struct sr_adjacency *sra; struct listnode *node, *nnode; @@ -1139,7 +1128,7 @@ static int isis_sr_adj_state_change(struct isis_adjacency *adj) return 0; for (ALL_LIST_ELEMENTS(adj->adj_sids, node, nnode, sra)) - isis_sr_adj_sid_del(sra); + sr_adj_sid_del(sra); return 0; } @@ -1148,12 +1137,12 @@ static int isis_sr_adj_state_change(struct isis_adjacency *adj) * Adjacency now has one or more IPv4/IPv6 addresses. Add new IPv4 or IPv6 * Adj-SID accordingly. */ -static int isis_sr_adj_ip_enabled(struct isis_adjacency *adj, int family) +static int sr_adj_ip_enabled(struct isis_adjacency *adj, int family) { if (!adj->circuit->area->srdb.enabled) return 0; - isis_sr_adj_sid_add(adj, family); + sr_adj_sid_add(adj, family); return 0; } @@ -1162,7 +1151,7 @@ static int isis_sr_adj_ip_enabled(struct isis_adjacency *adj, int family) * Adjacency doesn't have any IPv4 or IPv6 addresses anymore. Delete the * corresponding Adj-SID(s) accordingly. */ -static int isis_sr_adj_ip_disabled(struct isis_adjacency *adj, int family) +static int sr_adj_ip_disabled(struct isis_adjacency *adj, int family) { struct sr_adjacency *sra; struct listnode *node, *nnode; @@ -1172,12 +1161,12 @@ static int isis_sr_adj_ip_disabled(struct isis_adjacency *adj, int family) for (ALL_LIST_ELEMENTS(adj->adj_sids, node, nnode, sra)) if (sra->nexthop.family == family) - isis_sr_adj_sid_del(sra); + sr_adj_sid_del(sra); return 0; } -static int isis_sr_if_new_hook(struct interface *ifp) +static int sr_if_new_hook(struct interface *ifp) { struct isis_circuit *circuit; struct isis_area *area; @@ -1204,7 +1193,7 @@ static int isis_sr_if_new_hook(struct interface *ifp) if (!pcfg) continue; - if (isis_sr_prefix_is_node_sid(ifp, &pcfg->prefix) + if (sr_prefix_is_node_sid(ifp, &pcfg->prefix) && !pcfg->node_sid) { pcfg->node_sid = true; lsp_regenerate_schedule(area, area->is_type, 0); @@ -1216,9 +1205,9 @@ static int isis_sr_if_new_hook(struct interface *ifp) /*----------------------------------------------------------------------------*/ -static void isis_sr_show_prefix_sid_local(struct vty *vty, struct ttable *tt, - const struct isis_area *area, - const struct sr_prefix *srp) +static void show_prefix_sid_local(struct vty *vty, struct ttable *tt, + const struct isis_area *area, + const struct sr_prefix *srp) { const struct sr_nexthop_info *srnh = &srp->u.local.info; char buf_prefix[BUFSIZ]; @@ -1226,8 +1215,8 @@ static void isis_sr_show_prefix_sid_local(struct vty *vty, struct ttable *tt, char buf_rlabel[BUFSIZ]; char buf_uptime[BUFSIZ]; - if (srp->local_label != MPLS_INVALID_LABEL) - label2str(srp->local_label, buf_llabel, sizeof(buf_llabel)); + if (srp->input_label != MPLS_INVALID_LABEL) + label2str(srp->input_label, buf_llabel, sizeof(buf_llabel)); else snprintf(buf_llabel, sizeof(buf_llabel), "-"); if (srnh->label != MPLS_INVALID_LABEL) { @@ -1243,9 +1232,9 @@ static void isis_sr_show_prefix_sid_local(struct vty *vty, struct ttable *tt, srp->sid.value, buf_llabel, buf_rlabel, buf_uptime); } -static void isis_sr_show_prefix_sid_remote(struct vty *vty, struct ttable *tt, - const struct isis_area *area, - const struct sr_prefix *srp) +static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, + const struct isis_area *area, + const struct sr_prefix *srp) { struct isis_nexthop *nexthop; struct listnode *node; @@ -1258,8 +1247,8 @@ static void isis_sr_show_prefix_sid_remote(struct vty *vty, struct ttable *tt, bool first = true; (void)prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)); - if (srp->local_label != MPLS_INVALID_LABEL) - label2str(srp->local_label, buf_llabel, sizeof(buf_llabel)); + if (srp->input_label != MPLS_INVALID_LABEL) + label2str(srp->input_label, buf_llabel, sizeof(buf_llabel)); else snprintf(buf_llabel, sizeof(buf_llabel), "-"); @@ -1302,8 +1291,7 @@ static void isis_sr_show_prefix_sid_remote(struct vty *vty, struct ttable *tt, } } -static void isis_sr_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) { struct sr_prefix *srp; struct ttable *tt; @@ -1321,14 +1309,13 @@ static void isis_sr_show_prefix_sids(struct vty *vty, struct isis_area *area, ttable_restyle(tt); ttable_rowseps(tt, 0, BOTTOM, true, '-'); - frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], - srp) { + frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { switch (srp->type) { case ISIS_SR_PREFIX_LOCAL: - isis_sr_show_prefix_sid_local(vty, tt, area, srp); + show_prefix_sid_local(vty, tt, area, srp); break; case ISIS_SR_PREFIX_REMOTE: - isis_sr_show_prefix_sid_remote(vty, tt, area, srp); + show_prefix_sid_remote(vty, tt, area, srp); break; } } @@ -1358,7 +1345,7 @@ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, area->area_tag ? area->area_tag : "null"); for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) - isis_sr_show_prefix_sids(vty, area, level); + show_prefix_sids(vty, area, level); } return CMD_SUCCESS; @@ -1400,20 +1387,18 @@ int isis_sr_start(struct isis_area *area) circuit->u.bc.adjdb[level - 1], anode, adj)) { if (adj->ipv4_address_count > 0) - isis_sr_adj_sid_add(adj, - AF_INET); + sr_adj_sid_add(adj, AF_INET); if (adj->ipv6_address_count > 0) - isis_sr_adj_sid_add(adj, - AF_INET6); + sr_adj_sid_add(adj, AF_INET6); } } break; case CIRCUIT_T_P2P: adj = circuit->u.p2p.neighbor; if (adj && adj->ipv4_address_count > 0) - isis_sr_adj_sid_add(adj, AF_INET); + sr_adj_sid_add(adj, AF_INET); if (adj && adj->ipv6_address_count > 0) - isis_sr_adj_sid_add(adj, AF_INET6); + sr_adj_sid_add(adj, AF_INET6); break; default: break; @@ -1439,7 +1424,7 @@ void isis_sr_stop(struct isis_area *area) /* Uninstall Adj-SIDs. */ for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra)) - isis_sr_adj_sid_del(sra); + sr_adj_sid_del(sra); /* Uninstall Prefix-SIDs. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { @@ -1447,7 +1432,7 @@ void isis_sr_stop(struct isis_area *area) struct sr_node *srn; srn = srdb_node_first(&srdb->sr_nodes[level - 1]); - isis_sr_node_del(area, level, srn); + sr_node_del(area, level, srn); } } @@ -1510,19 +1495,19 @@ void isis_sr_init(void) install_element(VIEW_NODE, &show_sr_prefix_sids_cmd); /* Register hooks. */ - hook_register(isis_adj_state_change_hook, isis_sr_adj_state_change); - hook_register(isis_adj_ip_enabled_hook, isis_sr_adj_ip_enabled); - hook_register(isis_adj_ip_disabled_hook, isis_sr_adj_ip_disabled); - hook_register(isis_route_update_hook, isis_sr_route_update); - hook_register(isis_if_new_hook, isis_sr_if_new_hook); + hook_register(isis_adj_state_change_hook, sr_adj_state_change); + hook_register(isis_adj_ip_enabled_hook, sr_adj_ip_enabled); + hook_register(isis_adj_ip_disabled_hook, sr_adj_ip_disabled); + hook_register(isis_route_update_hook, sr_route_update); + hook_register(isis_if_new_hook, sr_if_new_hook); } void isis_sr_term(void) { /* Unregister hooks. */ - hook_unregister(isis_adj_state_change_hook, isis_sr_adj_state_change); - hook_unregister(isis_adj_ip_enabled_hook, isis_sr_adj_ip_enabled); - hook_unregister(isis_adj_ip_disabled_hook, isis_sr_adj_ip_disabled); - hook_unregister(isis_route_update_hook, isis_sr_route_update); - hook_unregister(isis_if_new_hook, isis_sr_if_new_hook); + hook_unregister(isis_adj_state_change_hook, sr_adj_state_change); + hook_unregister(isis_adj_ip_enabled_hook, sr_adj_ip_enabled); + hook_unregister(isis_adj_ip_disabled_hook, sr_adj_ip_disabled); + hook_unregister(isis_route_update_hook, sr_route_update); + hook_unregister(isis_if_new_hook, sr_if_new_hook); } diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index a7d52aafe1..2759e860f8 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -120,8 +120,8 @@ struct sr_prefix { /* SID value, algorithm and flags. */ struct isis_prefix_sid sid; - /* Local label value. */ - mpls_label_t local_label; + /* Input label value. */ + mpls_label_t input_label; /* Prefix-SID type. */ enum sr_prefix_type type; diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index d4b9d2a621..94ad0ae488 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -265,7 +265,7 @@ void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) /* Prepare message. */ memset(&zl, 0, sizeof(zl)); zl.type = ZEBRA_LSP_ISIS_SR; - zl.local_label = srp->local_label; + zl.local_label = srp->input_label; switch (srp->type) { case ISIS_SR_PREFIX_LOCAL: @@ -322,7 +322,7 @@ void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) /* Prepare message. */ memset(&zl, 0, sizeof(zl)); zl.type = ZEBRA_LSP_ISIS_SR; - zl.local_label = srp->local_label; + zl.local_label = srp->input_label; if (srp->type == ISIS_SR_PREFIX_REMOTE) { /* Update route in the RIB too. */ From b407c77a4aa371e2b87a7e1613ec36e14e900064 Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Mon, 4 May 2020 09:40:36 +0200 Subject: [PATCH 14/18] isisd: IS-IS-SR preparation for master 3/5 Add debug macro and debug messages Signed-off-by: Olivier Dugeon --- isisd/isis_sr.c | 195 +++++++++++++++++++++++++----------------------- isisd/isis_sr.h | 2 + isisd/isisd.h | 6 ++ 3 files changed, 109 insertions(+), 94 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 63e26bfa67..948b8e39c8 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -96,6 +96,8 @@ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, { struct isis_sr_db *srdb = &area->srdb; + sr_debug("ISIS-Sr (%s): Update SRGB", area->area_tag); + /* First release the old SRGB. */ if (srdb->config.enabled) isis_zebra_release_label_range(srdb->config.srgb_lower_bound, @@ -114,6 +116,10 @@ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, - srdb->config.srgb_lower_bound + 1)) return -1; + sr_debug(" |- Got new SRGB %u/%u", + srdb->config.srgb_lower_bound, + srdb->config.srgb_upper_bound); + /* Reinstall local Prefix-SIDs to update their input labels. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { frr_each (srdb_area_prefix, @@ -145,6 +151,8 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, struct sr_prefix_cfg *pcfg; struct interface *ifp; + sr_debug("ISIS-Sr (%s): Add local prefix %pFX", area->area_tag, prefix); + pcfg = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*pcfg)); pcfg->prefix = *prefix; pcfg->area = area; @@ -169,9 +177,13 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, /* Handle removal of locally configured Prefix-SID. */ void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg) { - struct isis_area *area; + struct isis_area *area = pcfg->area; + + sr_debug("ISIS-Sr (%s): Delete local Prefix-SID %pFX %s %u", + area->area_tag, &pcfg->prefix, + pcfg->sid_type == SR_SID_VALUE_TYPE_INDEX ? "index" : "label", + pcfg->sid); - area = pcfg->area; srdb_prefix_cfg_del(&area->srdb.config.prefix_sids, pcfg); XFREE(MTYPE_ISIS_SR_INFO, pcfg); } @@ -247,12 +259,20 @@ static struct sr_prefix *sr_prefix_add(struct isis_area *area, /* TODO: this might fail if we have Anycast SIDs in the IS-IS area. */ srdb_area_prefix_add(&area->srdb.prefix_sids[srn->level - 1], srp); + sr_debug(" |- Added new SR Prefix-SID %pFX %s %u to SR Node %s", + &srp->prefix, IS_SID_VALUE(srp->sid.flags) ? "label" : "index", + srp->sid.value, sysid_print(srn->sysid)); + return srp; } static void sr_prefix_del(struct isis_area *area, struct sr_node *srn, struct sr_prefix *srp) { + sr_debug(" |- Delete SR Prefix-SID %pFX %s %u to SR Node %s", + &srp->prefix, IS_SID_VALUE(srp->sid.flags) ? "label" : "index", + srp->sid.value, sysid_print(srn->sysid)); + sr_prefix_uninstall(srp); srdb_node_prefix_del(&srn->prefix_sids, srp); srdb_area_prefix_del(&area->srdb.prefix_sids[srn->level - 1], srp); @@ -293,11 +313,16 @@ static struct sr_node *sr_node_add(struct isis_area *area, int level, srdb_node_prefix_init(&srn->prefix_sids); srdb_node_add(&area->srdb.sr_nodes[level - 1], srn); + sr_debug(" |- Added new SR Node %s", sysid_print(srn->sysid)); + return srn; } static void sr_node_del(struct isis_area *area, int level, struct sr_node *srn) { + + sr_debug(" |- Delete SR Node %s", sysid_print(srn->sysid)); + /* Remove and uninstall Prefix-SIDs. */ while (srdb_node_prefix_count(&srn->prefix_sids) > 0) { struct sr_prefix *srp; @@ -324,6 +349,9 @@ static void sr_node_srgb_update(struct isis_area *area, int level, { struct sr_prefix *srp; + sr_debug("ISIS-Sr (%s): Update neighbors SR Node with new SRGB", + area->area_tag); + frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { struct listnode *node; struct isis_nexthop *nh; @@ -453,9 +481,8 @@ static mpls_label_t sr_prefix_out_label(const struct sr_prefix *srp, /* Process local Prefix-SID and install it if possible. */ static int sr_prefix_install_local(struct sr_prefix *srp) { - const struct sr_node *srn = srp->srn; - struct isis_area *area = srn->area; mpls_label_t input_label; + const struct sr_node *srn = srp->srn; /* * No need to install LSP to local Prefix-SID unless the @@ -465,15 +492,9 @@ static int sr_prefix_install_local(struct sr_prefix *srp) || CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_EXPLICIT_NULL)) return -1; - if (IS_DEBUG_ISIS(DEBUG_SR)) { - zlog_debug("ISIS-SR (%s) installing Prefix-SID %pFX %s %u (%s)", - area->area_tag, &srp->prefix, - CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE) - ? "label" - : "index", - srp->sid.value, circuit_t2string(srn->level)); - zlog_debug(" nexthop self"); - } + sr_debug(" |- Installing Prefix-SID %pFX %s %u (%s) with nexthop self", + &srp->prefix, IS_SID_VALUE(srp->sid.flags) ? "label" : "index", + srp->sid.value, circuit_t2string(srn->level)); /* Calculate local label. */ input_label = sr_prefix_in_label(srp); @@ -508,19 +529,15 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) /* SPF hasn't converged for this route yet. */ return -1; - if (IS_DEBUG_ISIS(DEBUG_SR)) - zlog_debug("ISIS-SR (%s) installing Prefix-SID %pFX %s %u (%s)", - area->area_tag, &srp->prefix, - CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE) - ? "label" - : "index", - srp->sid.value, circuit_t2string(srn->level)); - /* Calculate local label. */ input_label = sr_prefix_in_label(srp); if (input_label == MPLS_INVALID_LABEL) return -1; + sr_debug(" |- Installing Prefix-SID %pFX %s %u (%s)", &srp->prefix, + IS_SID_VALUE(srp->sid.flags) ? "label" : "index", + srp->sid.value, circuit_t2string(srn->level)); + for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, nexthop)) { struct sr_node *srn_nexthop; @@ -541,8 +558,8 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) && !IS_SR_IPV6(srn_nexthop->cap.srgb))) goto next; - output_label = sr_prefix_out_label(srp, srn_nexthop, - nexthop->sysid); + output_label = + sr_prefix_out_label(srp, srn_nexthop, nexthop->sysid); if (output_label == MPLS_INVALID_LABEL) goto next; @@ -551,7 +568,8 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) inet_ntop(nexthop->family, &nexthop->ip, buf, sizeof(buf)); - zlog_debug(" nexthop %s label %u", buf, output_label); + zlog_debug(" |- nexthop %s label %u", buf, + output_label); } isis_sr_nexthop_update(&nexthop->sr, output_label); @@ -561,8 +579,7 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) isis_sr_nexthop_reset(&nexthop->sr); } if (nexthop_num == 0) { - if (IS_DEBUG_ISIS(DEBUG_SR)) - zlog_debug(" no valid nexthops"); + sr_debug(" |- no valid nexthops"); return -1; } @@ -582,6 +599,10 @@ static void sr_prefix_install(struct sr_prefix *srp) struct isis_area *area = srn->area; int ret; + sr_debug("ISIS-Sr (%s): Install Prefix-SID %pFX %s %u", area->area_tag, + &srp->prefix, IS_SID_VALUE(srp->sid.flags) ? "label" : "index", + srp->sid.value); + /* L1 routes are preferred over the L2 ones. */ if (area->is_type == IS_LEVEL_1_AND_2) { struct sr_prefix *srp_l1, *srp_l2; @@ -615,22 +636,15 @@ static void sr_prefix_install(struct sr_prefix *srp) /* Uninstall local or remote Prefix-SID. */ static void sr_prefix_uninstall(struct sr_prefix *srp) { - const struct sr_node *srn = srp->srn; struct listnode *node; struct isis_nexthop *nexthop; if (srp->input_label == MPLS_INVALID_LABEL) return; - if (IS_DEBUG_ISIS(DEBUG_SR)) - zlog_debug( - "ISIS-SR (%s) uninstalling Prefix-SID %pFX %s %u (%s)", - srn->area->area_tag, &srp->prefix, - CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE) - ? "label" - : "index", - srp->sid.value, circuit_t2string(srn->level)); - + sr_debug("ISIS-Sr: Un-install Prefix-SID %pFX %s %u", &srp->prefix, + IS_SID_VALUE(srp->sid.flags) ? "label" : "index", + srp->sid.value); /* Uninstall Prefix-SID from the forwarding plane. */ isis_zebra_uninstall_prefix_sid(srp); @@ -678,6 +692,8 @@ parse_router_cap_tlv(struct isis_area *area, int level, const uint8_t *sysid, if (!router_cap || router_cap->srgb.range_size == 0) return NULL; + sr_debug("ISIS-Sr (%s): Parse Router Capability TLV", area->area_tag); + srn = sr_node_find(area, level, sysid); if (srn) { if (memcmp(&srn->cap, router_cap, sizeof(srn->cap)) != 0) { @@ -685,6 +701,10 @@ parse_router_cap_tlv(struct isis_area *area, int level, const uint8_t *sysid, srn->state = SRDB_STATE_MODIFIED; } else srn->state = SRDB_STATE_UNCHANGED; + sr_debug(" |- Found %s SR Node %s", + srn->state == SRDB_STATE_MODIFIED ? "Modified" + : "Unchanged", + sysid_print(srn->sysid)); } else { srn = sr_node_add(area, level, sysid, router_cap); srn->state = SRDB_STATE_NEW; @@ -701,6 +721,8 @@ static void parse_prefix_sid_subtlvs(struct sr_node *srn, struct isis_area *area = srn->area; struct isis_item *i; + sr_debug("ISIS-Sr (%s): Parse Prefix SID TLV", area->area_tag); + for (i = prefix_sids->head; i; i = i->next) { struct isis_prefix_sid *psid = (struct isis_prefix_sid *)i; struct sr_prefix *srp; @@ -717,6 +739,12 @@ static void parse_prefix_sid_subtlvs(struct sr_node *srn, srp->state = SRDB_STATE_MODIFIED; } else srp->state = SRDB_STATE_UNCHANGED; + sr_debug(" |- Found %s Prefix-SID %pFX", + srp->state == SRDB_STATE_MODIFIED + ? "Modified" + : "Unchanged", + &srp->prefix); + } else { srp = sr_prefix_add(area, srn, prefix, local, psid); srp->state = SRDB_STATE_NEW; @@ -742,10 +770,13 @@ static void parse_lsp(struct isis_area *area, int level, struct sr_node **srn, return; } + sr_debug("ISIS-Sr (%s): Parse LSP from node %s", area->area_tag, + sysid_print(lsp->hdr.lsp_id)); + /* Parse the Router Capability TLV. */ if (*srn == NULL) { - *srn = parse_router_cap_tlv( - area, level, lsp->hdr.lsp_id, lsp->tlvs->router_cap); + *srn = parse_router_cap_tlv(area, level, lsp->hdr.lsp_id, + lsp->tlvs->router_cap); if (!*srn) return; } @@ -783,6 +814,8 @@ static void parse_lspdb(struct isis_area *area) { struct isis_lsp *lsp; + sr_debug("ISIS-Sr (%s): Parse LSP Data Base", area->area_tag); + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { frr_each (lspdb, &area->lspdb[level - 1], lsp) { struct isis_lsp *frag; @@ -806,36 +839,24 @@ static void process_prefix_changes(struct sr_node *srn, struct sr_prefix *srp) { struct isis_area *area = srn->area; - /* Log any Prefix-SID change in the LSPDB. */ - if (IS_DEBUG_ISIS(DEBUG_SR)) { - if (srp->state == SRDB_STATE_NEW) - zlog_debug( - "ISIS-SR (%s) Prefix-SID created: %pFX (sysid %s)", - area->area_tag, &srp->prefix, - sysid_print(srn->sysid)); - else if (srp->state == SRDB_STATE_MODIFIED) - zlog_debug( - "ISIS-SR (%s) Prefix-SID modified: %pFX (sysid %s)", - area->area_tag, &srp->prefix, - sysid_print(srn->sysid)); - else if (srp->state != SRDB_STATE_UNCHANGED) - zlog_debug( - "ISIS-SR (%s) Prefix-SID removed: %pFX (sysid %s)", - area->area_tag, &srp->prefix, - sysid_print(srn->sysid)); - } - /* Install/reinstall/uninstall Prefix-SID if necessary. */ switch (srp->state) { case SRDB_STATE_NEW: + sr_debug("ISIS-Sr (%s): Created Prefix-SID %pFX for SR node %s", + area->area_tag, &srp->prefix, sysid_print(srn->sysid)); sr_prefix_install(srp); break; case SRDB_STATE_MODIFIED: + sr_debug( + "ISIS-Sr (%s): Modified Prefix-SID %pFX for SR node %s", + area->area_tag, &srp->prefix, sysid_print(srn->sysid)); sr_prefix_reinstall(srp, false); break; case SRDB_STATE_UNCHANGED: break; default: + sr_debug("ISIS-Sr (%s): Removed Prefix-SID %pFX for SR node %s", + area->area_tag, &srp->prefix, sysid_print(srn->sysid)); sr_prefix_del(area, srn, srp); return; } @@ -853,19 +874,6 @@ static void process_node_changes(struct isis_area *area, int level, memcpy(sysid, srn->sysid, sizeof(sysid)); - /* Log any SRGB change in the LSPDB. */ - if (IS_DEBUG_ISIS(DEBUG_SR)) { - if (srn->state == SRDB_STATE_NEW) - zlog_debug("ISIS-SR (%s) SRGB created (sysid %s)", - area->area_tag, sysid_print(sysid)); - else if (srn->state == SRDB_STATE_MODIFIED) - zlog_debug("ISIS-SR (%s) SRGB modified (sysid %s)", - area->area_tag, sysid_print(sysid)); - else if (srn->state != SRDB_STATE_UNCHANGED) - zlog_debug("ISIS-SR (%s) SRGB removed (sysid %s)", - area->area_tag, sysid_print(sysid)); - } - /* * If an adjacent router's SRGB was changed or created, then reinstall * all Prefix-SIDs from all nodes. @@ -874,12 +882,16 @@ static void process_node_changes(struct isis_area *area, int level, switch (srn->state) { case SRDB_STATE_NEW: case SRDB_STATE_MODIFIED: + sr_debug("ISIS-Sr (%s): Create/Update SR node %s", + area->area_tag, sysid_print(srn->sysid)); if (adjacent) - sr_node_srgb_update(area, sysid, level); + sr_node_srgb_update(area, level, sysid); break; case SRDB_STATE_UNCHANGED: break; default: + sr_debug("ISIS-Sr (%s): Remove SR node %s", area->area_tag, + sysid_print(srn->sysid)); sr_node_del(area, level, srn); if (adjacent) @@ -923,6 +935,9 @@ static int sr_route_update(struct isis_area *area, struct prefix *prefix, if (!area->srdb.enabled) return 0; + sr_debug("ISIS-Sr (%s): Update route for prefix %pFX", area->area_tag, + prefix); + switch (area->is_type) { case IS_LEVEL_1: srp = sr_prefix_find_by_area(area, ISIS_LEVEL1, prefix); @@ -967,6 +982,10 @@ static void sr_adj_sid_install_uninstall(bool install, cmd = install ? ZEBRA_MPLS_LABELS_ADD : ZEBRA_MPLS_LABELS_DELETE; + sr_debug(" |- %s label %u for interface %s", + install ? "Add" : "Delete", sra->nexthop.label, + sra->adj->circuit->interface->name); + memset(&zl, 0, sizeof(zl)); zl.type = ZEBRA_LSP_ISIS_SR; zl.local_label = sra->nexthop.label; @@ -996,6 +1015,9 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, uint8_t flags; mpls_label_t input_label; + sr_debug("ISIS-Sr (%s): Add %s Adjacency SID", area->area_tag, + backup ? "Backup" : "Primary"); + switch (family) { case AF_INET: if (!circuit->ip_router) @@ -1025,15 +1047,6 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, if (circuit->ext == NULL) circuit->ext = isis_alloc_ext_subtlvs(); - if (IS_DEBUG_ISIS(DEBUG_SR)) { - char buf[INET6_ADDRSTRLEN]; - - inet_ntop(family, &nexthop, buf, sizeof(buf)); - zlog_debug("ISIS-SR (%s) installing Adj-SID %s%%%s label %u", - area->area_tag, buf, circuit->interface->name, - input_label); - } - sra = XCALLOC(MTYPE_ISIS_SR_INFO, sizeof(*sra)); sra->type = backup ? ISIS_SR_LAN_BACKUP : ISIS_SR_ADJ_NORMAL; sra->nexthop.family = family; @@ -1084,14 +1097,7 @@ static void sr_adj_sid_del(struct sr_adjacency *sra) struct isis_circuit *circuit = sra->adj->circuit; struct isis_area *area = circuit->area; - if (IS_DEBUG_ISIS(DEBUG_SR)) { - char buf[INET6_ADDRSTRLEN]; - - inet_ntop(sra->nexthop.family, &sra->nexthop.address, buf, - sizeof(buf)); - zlog_debug("ISIS-SR (%s) uninstalling Adj-SID %s%%%s", - area->area_tag, buf, circuit->interface->name); - } + sr_debug("ISIS-Sr (%s): Delete Adjacency SID", area->area_tag); sr_adj_sid_install_uninstall(false, sra); @@ -1370,9 +1376,8 @@ int isis_sr_start(struct isis_area *area) - srdb->config.srgb_lower_bound + 1)) return -1; - if (IS_DEBUG_ISIS(DEBUG_SR)) - zlog_debug("ISIS-SR (%s) Starting Segment Routing", - area->area_tag); + sr_debug("ISIS-Sr: Starting Segment Routing for area %s", + area->area_tag); /* Create Adj-SIDs for existing adjacencies. */ for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { @@ -1418,9 +1423,8 @@ void isis_sr_stop(struct isis_area *area) struct sr_adjacency *sra; struct listnode *node, *nnode; - if (IS_DEBUG_ISIS(DEBUG_SR)) - zlog_debug("ISIS-SR (%s) Stopping Segment Routing", - area->area_tag); + sr_debug("ISIS-Sr: Stopping Segment Routing for area %s", + area->area_tag); /* Uninstall Adj-SIDs. */ for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra)) @@ -1448,6 +1452,9 @@ void isis_sr_area_init(struct isis_area *area) { struct isis_sr_db *srdb = &area->srdb; + sr_debug("ISIS-Sr (%s): Initialize Segment Routing SRDB", + area->area_tag); + memset(srdb, 0, sizeof(*srdb)); srdb->enabled = false; srdb->adj_sids = list_new(); diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index 2759e860f8..0b84db90ff 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -173,6 +173,8 @@ enum sr_sid_value_type { SR_SID_VALUE_TYPE_ABSOLUTE = 1, }; +#define IS_SID_VALUE(flag) CHECK_FLAG(flag, ISIS_PREFIX_SID_VALUE) + /* NOTE: these values must be in sync with the YANG module. */ enum sr_last_hop_behavior { SR_LAST_HOP_BEHAVIOR_EXP_NULL = 0, diff --git a/isisd/isisd.h b/isisd/isisd.h index 56ea0993fd..439428d797 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -254,6 +254,12 @@ extern struct thread_master *master; zlog_debug(__VA_ARGS__); \ } while (0) +#define sr_debug(...) \ + do { \ + if (IS_DEBUG_ISIS(DEBUG_SR)) \ + zlog_debug(__VA_ARGS__); \ + } while (0) + #define DEBUG_TE DEBUG_LSP_GEN #define IS_DEBUG_ISIS(x) (isis->debugs & x) From c3f7b406b1196374abbc19658fc295ae6dc3fcfb Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Mon, 4 May 2020 18:26:21 +0200 Subject: [PATCH 15/18] isisd: IS-IS-SR preparation for master 4/5 * Regroup fonctions to install label for Prefix and Adjacency SID * Change 'replace_semantics' variable name by 'make_before_break' in sr_prefix_reinstall() function and adjust comments * Call directly lsp_regenerate_schedule() from isis_nb_config.c when MSD is updated Signed-off-by: Olivier Dugeon --- isisd/isis_nb_config.c | 8 +++-- isisd/isis_sr.c | 67 ++++++++++++------------------------------ isisd/isis_sr.h | 1 - isisd/isis_zebra.c | 57 +++++++++++++++++++++++++++++++++-- isisd/isis_zebra.h | 5 ++-- 5 files changed, 83 insertions(+), 55 deletions(-) diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index ec3b7baa31..a649e896fa 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -1521,7 +1521,9 @@ int isis_instance_segment_routing_msd_node_msd_modify( area = nb_running_get_entry(args->dnode, NULL, true); area->srdb.config.msd = yang_dnode_get_uint8(args->dnode, NULL); - isis_sr_cfg_msd_update(area); + + /* Update and regenerate LSP */ + lsp_regenerate_schedule(area, area->is_type, 0); return NB_OK; } @@ -1536,7 +1538,9 @@ int isis_instance_segment_routing_msd_node_msd_destroy( area = nb_running_get_entry(args->dnode, NULL, true); area->srdb.config.msd = 0; - isis_sr_cfg_msd_update(area); + + /* Update and regenerate LSP */ + lsp_regenerate_schedule(area, area->is_type, 0); return NB_OK; } diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 948b8e39c8..fc97c0fc98 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -51,8 +51,7 @@ DEFINE_MTYPE_STATIC(ISISD, ISIS_SR_INFO, "ISIS segment routing information") static void sr_prefix_uninstall(struct sr_prefix *srp); -static void sr_prefix_reinstall(struct sr_prefix *srp, - bool replace_semantics); +static void sr_prefix_reinstall(struct sr_prefix *srp, bool make_before_break); /*----------------------------------------------------------------------------*/ @@ -138,12 +137,6 @@ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, return 0; } -/* Handle changes in the local MSD configuration. */ -void isis_sr_cfg_msd_update(struct isis_area *area) -{ - lsp_regenerate_schedule(area, area->is_type, 0); -} - /* Handle new Prefix-SID configuration. */ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, const struct prefix *prefix) @@ -368,8 +361,10 @@ static void sr_node_srgb_update(struct isis_area *area, int level, continue; /* - * Reinstall all Prefix-SID nexthops using route replace - * semantics. + * The Prefix-SID input label hasn't changed. We could + * re-install all Prefix-SID with "Make Before Break" + * option. Zebra layer will update output label(s) by + * adding new entry before removing the old one(s). */ sr_prefix_reinstall(srp, true); break; @@ -506,7 +501,7 @@ static int sr_prefix_install_local(struct sr_prefix *srp) isis_sr_nexthop_update(&srp->u.local.info, MPLS_LABEL_IMPLICIT_NULL); /* Install Prefix-SID in the forwarding plane. */ - isis_zebra_install_prefix_sid(srp); + isis_zebra_send_prefix_sid(ZEBRA_MPLS_LABELS_REPLACE, srp); return 0; } @@ -587,7 +582,7 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) srp->input_label = input_label; /* Install Prefix-SID in the forwarding plane. */ - isis_zebra_install_prefix_sid(srp); + isis_zebra_send_prefix_sid(ZEBRA_MPLS_LABELS_REPLACE, srp); return 0; } @@ -647,7 +642,7 @@ static void sr_prefix_uninstall(struct sr_prefix *srp) srp->sid.value); /* Uninstall Prefix-SID from the forwarding plane. */ - isis_zebra_uninstall_prefix_sid(srp); + isis_zebra_send_prefix_sid(ZEBRA_MPLS_LABELS_DELETE, srp); /* Reset internal state. */ srp->input_label = MPLS_INVALID_LABEL; @@ -666,15 +661,16 @@ static void sr_prefix_uninstall(struct sr_prefix *srp) } /* Reinstall local or remote Prefix-SID. */ -static void sr_prefix_reinstall(struct sr_prefix *srp, bool replace_semantics) +static inline void sr_prefix_reinstall(struct sr_prefix *srp, + bool make_before_break) { /* - * Route replace semantics can be used only when we know for sure that + * Make Before Break can be used only when we know for sure that * the Prefix-SID input label hasn't changed. Otherwise we need to * uninstall the Prefix-SID first using the old input label before * reinstalling it. */ - if (!replace_semantics) + if (!make_before_break) sr_prefix_uninstall(srp); sr_prefix_install(srp); @@ -960,6 +956,11 @@ static int sr_route_update(struct isis_area *area, struct prefix *prefix, return 0; if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) { + /* + * The Prefix-SID input label hasn't changed. We could use the + * "Make Before Break" option. Zebra layer will update output + * label by adding new label(s) before removing old one(s). + */ sr_prefix_reinstall(srp, true); srp->u.remote.rinfo = route_info; } else { @@ -972,36 +973,6 @@ static int sr_route_update(struct isis_area *area, struct prefix *prefix, /*----------------------------------------------------------------------------*/ -/* Install or uninstall (LAN)-Adj-SID. */ -static void sr_adj_sid_install_uninstall(bool install, - const struct sr_adjacency *sra) -{ - struct zapi_labels zl; - struct zapi_nexthop *znh; - int cmd; - - cmd = install ? ZEBRA_MPLS_LABELS_ADD : ZEBRA_MPLS_LABELS_DELETE; - - sr_debug(" |- %s label %u for interface %s", - install ? "Add" : "Delete", sra->nexthop.label, - sra->adj->circuit->interface->name); - - memset(&zl, 0, sizeof(zl)); - zl.type = ZEBRA_LSP_ISIS_SR; - zl.local_label = sra->nexthop.label; - zl.nexthop_num = 1; - znh = &zl.nexthops[0]; - znh->gate = sra->nexthop.address; - znh->type = (sra->nexthop.family == AF_INET) - ? NEXTHOP_TYPE_IPV4_IFINDEX - : NEXTHOP_TYPE_IPV6_IFINDEX; - znh->ifindex = sra->adj->circuit->interface->ifindex; - znh->label_num = 1; - znh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; - - (void)zebra_send_mpls_labels(zclient, cmd, &zl); -} - /* Add new local Adj-SID. */ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, bool backup) @@ -1082,7 +1053,7 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, listnode_add(area->srdb.adj_sids, sra); listnode_add(adj->adj_sids, sra); - sr_adj_sid_install_uninstall(true, sra); + isis_zebra_send_adjacency_sid(ZEBRA_MPLS_LABELS_ADD, sra); } static void sr_adj_sid_add(struct isis_adjacency *adj, int family) @@ -1099,7 +1070,7 @@ static void sr_adj_sid_del(struct sr_adjacency *sra) sr_debug("ISIS-Sr (%s): Delete Adjacency SID", area->area_tag); - sr_adj_sid_install_uninstall(false, sra); + isis_zebra_send_adjacency_sid(ZEBRA_MPLS_LABELS_DELETE, sra); switch (circuit->circ_type) { case CIRCUIT_T_BROADCAST: diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index 0b84db90ff..b2e0130754 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -240,7 +240,6 @@ struct isis_sr_db { /* Prototypes. */ extern int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, uint32_t upper_bound); -extern void isis_sr_cfg_msd_update(struct isis_area *area); extern struct sr_prefix_cfg * isis_sr_cfg_prefix_add(struct isis_area *area, const struct prefix *prefix); extern void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg); diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 94ad0ae488..68f80a3f1f 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -49,6 +49,7 @@ #include "isisd/isis_lsp.h" #include "isisd/isis_route.h" #include "isisd/isis_zebra.h" +#include "isisd/isis_adjacency.h" #include "isisd/isis_te.h" #include "isisd/isis_sr.h" @@ -254,7 +255,7 @@ void isis_zebra_route_del_route(struct prefix *prefix, } /* Install Prefix-SID in the forwarding plane. */ -void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) +static void isis_zebra_prefix_install_prefix_sid(const struct sr_prefix *srp) { struct zapi_labels zl; struct zapi_nexthop *znh; @@ -315,7 +316,7 @@ void isis_zebra_install_prefix_sid(const struct sr_prefix *srp) } /* Uninstall Prefix-SID from the forwarding plane. */ -void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) +static void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) { struct zapi_labels zl; @@ -336,6 +337,58 @@ void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) (void)zebra_send_mpls_labels(zclient, ZEBRA_MPLS_LABELS_DELETE, &zl); } +void isis_zebra_send_prefix_sid(int cmd, const struct sr_prefix *srp) +{ + + if (cmd != ZEBRA_MPLS_LABELS_REPLACE + && cmd != ZEBRA_MPLS_LABELS_DELETE) { + flog_warn(EC_LIB_DEVELOPMENT, "%s: wrong ZEBRA command", + __func__); + return; + } + + sr_debug(" |- %s label %u for prefix %pFX", + cmd == ZEBRA_MPLS_LABELS_REPLACE ? "Update" : "Delete", + srp->input_label, &srp->prefix); + + if (cmd == ZEBRA_MPLS_LABELS_REPLACE) + isis_zebra_prefix_install_prefix_sid(srp); + else + isis_zebra_uninstall_prefix_sid(srp); +} + +/* Install or uninstall (LAN)-Adj-SID. */ +void isis_zebra_send_adjacency_sid(int cmd, const struct sr_adjacency *sra) +{ + struct zapi_labels zl; + struct zapi_nexthop *znh; + + if (cmd != ZEBRA_MPLS_LABELS_ADD && cmd != ZEBRA_MPLS_LABELS_DELETE) { + flog_warn(EC_LIB_DEVELOPMENT, "%s: wrong ZEBRA command", + __func__); + return; + } + + sr_debug(" |- %s label %u for interface %s", + cmd == ZEBRA_MPLS_LABELS_ADD ? "Add" : "Delete", + sra->nexthop.label, sra->adj->circuit->interface->name); + + memset(&zl, 0, sizeof(zl)); + zl.type = ZEBRA_LSP_ISIS_SR; + zl.local_label = sra->nexthop.label; + zl.nexthop_num = 1; + znh = &zl.nexthops[0]; + znh->gate = sra->nexthop.address; + znh->type = (sra->nexthop.family == AF_INET) + ? NEXTHOP_TYPE_IPV4_IFINDEX + : NEXTHOP_TYPE_IPV6_IFINDEX; + znh->ifindex = sra->adj->circuit->interface->ifindex; + znh->label_num = 1; + znh->labels[0] = MPLS_LABEL_IMPLICIT_NULL; + + (void)zebra_send_mpls_labels(zclient, cmd, &zl); +} + static int isis_zebra_read(ZAPI_CALLBACK_ARGS) { struct zapi_route api; diff --git a/isisd/isis_zebra.h b/isisd/isis_zebra.h index cca2b08811..b143d34626 100644 --- a/isisd/isis_zebra.h +++ b/isisd/isis_zebra.h @@ -36,6 +36,7 @@ void isis_zebra_stop(void); struct isis_route_info; struct sr_prefix; +struct sr_adjacency; void isis_zebra_route_add_route(struct prefix *prefix, struct prefix_ipv6 *src_p, @@ -43,8 +44,8 @@ void isis_zebra_route_add_route(struct prefix *prefix, void isis_zebra_route_del_route(struct prefix *prefix, struct prefix_ipv6 *src_p, struct isis_route_info *route_info); -void isis_zebra_install_prefix_sid(const struct sr_prefix *srp); -void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp); +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); int isis_distribute_list_update(int routetype); void isis_zebra_redistribute_set(afi_t afi, int type); void isis_zebra_redistribute_unset(afi_t afi, int type); From f2333421ff6d7d8a05ea86dfb2199b09bcf7a8aa Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Mon, 4 May 2020 19:39:20 +0200 Subject: [PATCH 16/18] isisd: IS-IS-SR preparation for master 5/5 Update comments (doxygen style) for all functions. Signed-off-by: Olivier Dugeon --- isisd/isis_sr.c | 501 +++++++++++++++++++++++++++++++++++++++------ isisd/isis_sr.h | 52 ++--- isisd/isis_tlvs.c | 28 ++- isisd/isis_tlvs.h | 24 ++- isisd/isis_zebra.c | 25 ++- 5 files changed, 517 insertions(+), 113 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index fc97c0fc98..8a2a126997 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -1,8 +1,7 @@ /* - * This is an implementation of Segment Routing for IS-IS - * as per draft draft-ietf-isis-segment-routing-extensions-25 + * This is an implementation of Segment Routing for IS-IS as per RFC 8667 * - * Copyright (C) 2019 Orange Labs http://www.orange.com + * Copyright (C) 2019 Orange http://www.orange.com * * Author: Olivier Dugeon * Contributor: Renato Westphal for NetDEF @@ -48,13 +47,22 @@ #include "isisd/isis_zebra.h" #include "isisd/isis_errors.h" +/* Local variables and functions */ DEFINE_MTYPE_STATIC(ISISD, ISIS_SR_INFO, "ISIS segment routing information") static void sr_prefix_uninstall(struct sr_prefix *srp); static void sr_prefix_reinstall(struct sr_prefix *srp, bool make_before_break); -/*----------------------------------------------------------------------------*/ +/* --- RB-Tree Management functions ----------------------------------------- */ +/** + * SR Prefix comparison for RB-Tree. + * + * @param a First SR prefix + * @param b Second SR prefix + * + * @return -1 (a < b), 0 (a == b) or +1 (a > b) + */ static inline int sr_prefix_sid_compare(const struct sr_prefix *a, const struct sr_prefix *b) { @@ -65,6 +73,14 @@ DECLARE_RBTREE_UNIQ(srdb_node_prefix, struct sr_prefix, node_entry, DECLARE_RBTREE_UNIQ(srdb_area_prefix, struct sr_prefix, area_entry, sr_prefix_sid_compare) +/** + * Configured SR Prefix comparison for RB-Tree. + * + * @param a First SR prefix + * @param b Second SR prefix + * + * @return -1 (a < b), 0 (a == b) or +1 (a > b) + */ static inline int sr_prefix_sid_cfg_compare(const struct sr_prefix_cfg *a, const struct sr_prefix_cfg *b) { @@ -73,6 +89,14 @@ static inline int sr_prefix_sid_cfg_compare(const struct sr_prefix_cfg *a, DECLARE_RBTREE_UNIQ(srdb_prefix_cfg, struct sr_prefix_cfg, entry, sr_prefix_sid_cfg_compare) +/** + * SR Node comparison for RB-Tree. + * + * @param a First SR node + * @param b Second SR node + * + * @return -1 (a < b), 0 (a == b) or +1 (a > b) + */ static inline int sr_node_compare(const struct sr_node *a, const struct sr_node *b) { @@ -80,16 +104,32 @@ static inline int sr_node_compare(const struct sr_node *a, } DECLARE_RBTREE_UNIQ(srdb_node, struct sr_node, entry, sr_node_compare) -/*----------------------------------------------------------------------------*/ +/* --- Functions used for Yang model and CLI to configure Segment Routing --- */ -/* Returns true if the interface/address pair corresponds to a Node-SID. */ +/** + * Check if prefix correspond to a Node SID. + * + * @param ifp Interface + * @param prefix Prefix to be checked + * + * @return True if the interface/address pair corresponds to a Node-SID + */ static bool sr_prefix_is_node_sid(const struct interface *ifp, const struct prefix *prefix) { return (if_is_loopback(ifp) && is_host_route(prefix)); } -/* Handle changes in the local SRGB configuration. */ +/** + * Update local SRGB configuration. SRGB is reserved though Label Manager. + * This function trigger the update of local Prefix-SID installation. + * + * @param area IS-IS area + * @param lower_bound Lower bound of SRGB + * @param upper_bound Upper bound of SRGB + * + * @return 0 on success, -1 otherwise + */ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, uint32_t upper_bound) { @@ -137,7 +177,14 @@ int isis_sr_cfg_srgb_update(struct isis_area *area, uint32_t lower_bound, return 0; } -/* Handle new Prefix-SID configuration. */ +/** + * Add new Prefix-SID configuration to the SRDB. + * + * @param area IS-IS area + * @param prefix Prefix to be added + * + * @return Newly added Prefix-SID configuration structure + */ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, const struct prefix *prefix) { @@ -167,7 +214,11 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area, return pcfg; } -/* Handle removal of locally configured Prefix-SID. */ +/** + * Removal of locally configured Prefix-SID. + * + * @param pcfg Configured Prefix-SID + */ void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg) { struct isis_area *area = pcfg->area; @@ -181,7 +232,14 @@ void isis_sr_cfg_prefix_del(struct sr_prefix_cfg *pcfg) XFREE(MTYPE_ISIS_SR_INFO, pcfg); } -/* Lookup Prefix-SID in the local configuration. */ +/** + * Lookup for Prefix-SID in the local configuration. + * + * @param area IS-IS area + * @param prefix Prefix to lookup + * + * @return Configured Prefix-SID structure if found, NULL otherwise + */ struct sr_prefix_cfg *isis_sr_cfg_prefix_find(struct isis_area *area, union prefixconstptr prefix) { @@ -191,7 +249,13 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_find(struct isis_area *area, return srdb_prefix_cfg_find(&area->srdb.config.prefix_sids, &pcfg); } -/* Fill in Prefix-SID Sub-TLV according to the corresponding configuration. */ +/** + * Fill in Prefix-SID Sub-TLV according to the corresponding configuration. + * + * @param pcfg Prefix-SID configuration + * @param external False if prefix is locally configured, true otherwise + * @param psid Prefix-SID sub-TLV to be updated + */ void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, bool external, struct isis_prefix_sid *psid) { @@ -227,8 +291,19 @@ void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, bool external, } } -/*----------------------------------------------------------------------------*/ +/* --- Segment Routing Prefix Management functions -------------------------- */ +/** + * Add Segment Routing Prefix to a given Segment Routing Node. + * + * @param area IS-IS area + * @param srn Segment Routing Node + * @param prefix Prefix to be added + * @param local True if prefix is locally configured, false otherwise + * @param psid Prefix-SID sub-TLVs + * + * @return New Segment Routing Prefix structure + */ static struct sr_prefix *sr_prefix_add(struct isis_area *area, struct sr_node *srn, union prefixconstptr prefix, bool local, @@ -259,6 +334,14 @@ static struct sr_prefix *sr_prefix_add(struct isis_area *area, return srp; } +/** + * Remove given Segment Prefix from given Segment Routing Node. + * Prefix-SID is un-installed first. + * + * @param area IS-IS area + * @param srn Segment Routing Node + * @param srp Segment Routing Prefix + */ static void sr_prefix_del(struct isis_area *area, struct sr_node *srn, struct sr_prefix *srp) { @@ -272,6 +355,15 @@ static void sr_prefix_del(struct isis_area *area, struct sr_node *srn, XFREE(MTYPE_ISIS_SR_INFO, srp); } +/** + * Find Segment Routing Prefix by Area. + * + * @param area IS-IS area + * @param level IS-IS level + * @param prefix Prefix to lookup + * + * @return Segment Routing Prefix structure if found, NULL otherwise + */ static struct sr_prefix *sr_prefix_find_by_area(struct isis_area *area, int level, union prefixconstptr prefix) @@ -279,10 +371,17 @@ static struct sr_prefix *sr_prefix_find_by_area(struct isis_area *area, struct sr_prefix srp = {}; prefix_copy(&srp.prefix, prefix.p); - return srdb_area_prefix_find(&area->srdb.prefix_sids[level - 1], - &srp); + return srdb_area_prefix_find(&area->srdb.prefix_sids[level - 1], &srp); } +/** + * Find Segment Routing Prefix by Segment Routing Node. + * + * @param srn Segment Routing Node + * @param prefix Prefix to lookup + * + * @return Segment Routing Prefix structure if found, NULL otherwise + */ static struct sr_prefix *sr_prefix_find_by_node(struct sr_node *srn, union prefixconstptr prefix) { @@ -292,6 +391,18 @@ static struct sr_prefix *sr_prefix_find_by_node(struct sr_node *srn, return srdb_node_prefix_find(&srn->prefix_sids, &srp); } +/* --- Segment Routing Node Management functions ---------------------------- */ + +/** + * Add Segment Routing Node to the Segment Routing Data Base. + * + * @param area IS-IS area + * @param level IS-IS level + * @param sysid Node System ID + * @param cap Segment Routing Capability sub-TLVs + * + * @return New Segment Routing Node structure + */ static struct sr_node *sr_node_add(struct isis_area *area, int level, const uint8_t *sysid, const struct isis_router_cap *cap) @@ -312,6 +423,14 @@ static struct sr_node *sr_node_add(struct isis_area *area, int level, } static void sr_node_del(struct isis_area *area, int level, struct sr_node *srn) +/** + * Remove Segment Routing Node from the Segment Routing Data Base. + * All Prefix-SID attached to this Segment Routing Node are removed first. + * + * @param area IS-IS area + * @param level IS-IS level + * @param srn Segment Routing Node to be deleted + */ { sr_debug(" |- Delete SR Node %s", sysid_print(srn->sysid)); @@ -328,6 +447,15 @@ static void sr_node_del(struct isis_area *area, int level, struct sr_node *srn) XFREE(MTYPE_ISIS_SR_INFO, srn); } +/** + * Find Segment Routing Node in the Segment Routing Data Base per system ID. + * + * @param area IS-IS area + * @param level IS-IS level + * @param sysid Node System ID to lookup + * + * @return Segment Routing Node structure if found, NULL otherwise + */ static struct sr_node *sr_node_find(struct isis_area *area, int level, const uint8_t *sysid) { @@ -337,6 +465,14 @@ static struct sr_node *sr_node_find(struct isis_area *area, int level, return srdb_node_find(&area->srdb.sr_nodes[level - 1], &srn); } +/** + * Update Segment Routing Node following an SRGB update. This function + * is called when a neighbor SR Node has updated its SRGB. + * + * @param area IS-IS area + * @param level IS-IS level + * @param sysid Segment Routing Node system ID + */ static void sr_node_srgb_update(struct isis_area *area, int level, uint8_t *sysid) { @@ -372,6 +508,14 @@ static void sr_node_srgb_update(struct isis_area *area, int level, } } +/* --- Segment Routing Nexthop information Management functions ------------- */ + +/** + * Update Segment Routing Nexthop. + * + * @param srnh Segment Routing next hop + * @param label Output MPLS label + */ void isis_sr_nexthop_update(struct sr_nexthop_info *srnh, mpls_label_t label) { srnh->label = label; @@ -379,15 +523,28 @@ void isis_sr_nexthop_update(struct sr_nexthop_info *srnh, mpls_label_t label) srnh->uptime = time(NULL); } +/** + * Reset Segment Routing Nexthop. + * + * @param srnh Segment Routing Nexthop + */ void isis_sr_nexthop_reset(struct sr_nexthop_info *srnh) { srnh->label = MPLS_INVALID_LABEL; srnh->uptime = 0; } -/*----------------------------------------------------------------------------*/ +/* --- Segment Routing Prefix-SID Management functions to configure LFIB ---- */ -/* Lookup IS-IS route in the SPT. */ +/** + * Lookup IS-IS route in the Shortest Path Tree. + * + * @param area IS-IS area + * @param tree_id Shortest Path Tree identifier + * @param srp Segment Routing Prefix to lookup + * + * @return Route Information for this prefix if found, NULL otherwise + */ static struct isis_route_info *sr_prefix_lookup_route(struct isis_area *area, enum spf_tree_id tree_id, struct sr_prefix *srp) @@ -406,18 +563,24 @@ static struct isis_route_info *sr_prefix_lookup_route(struct isis_area *area, return NULL; } -/* Calculate Prefix-SID input label. */ +/** + * Compute input label for the given Prefix-SID. + * + * @param srp Segment Routing Prefix + * + * @return MPLS label or MPLS_INVALID_LABEL in case of SRGB overflow + */ static mpls_label_t sr_prefix_in_label(const struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; struct isis_area *area = srn->area; - /* Absolute SID value. */ + /* Return SID value as MPLS label if it is an Absolute SID */ if (CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE | ISIS_PREFIX_SID_LOCAL)) return srp->sid.value; - /* Index SID value. */ + /* Check that SID index falls inside the SRGB */ if (srp->sid.value >= (area->srdb.config.srgb_upper_bound - area->srdb.config.srgb_lower_bound + 1)) { flog_warn(EC_ISIS_SID_OVERFLOW, @@ -426,21 +589,32 @@ static mpls_label_t sr_prefix_in_label(const struct sr_prefix *srp) return MPLS_INVALID_LABEL; } + /* Return MPLS label as SID index + SRGB_lower_bound as per RFC 8667 */ return (area->srdb.config.srgb_lower_bound + srp->sid.value); } -/* Calculate Prefix-SID output label. */ +/** + * Compute output label for the given Prefix-SID. + * + * @param srp Segment Routing Prefix + * @param srn_nexthop Segment Routing nexthop node + * @param sysid System ID of the SR node which advertised the Prefix-SID + * + * @return MPLS label or MPLS_INVALID_LABEL in case of error + */ static mpls_label_t sr_prefix_out_label(const struct sr_prefix *srp, const struct sr_node *srn_nexthop, const uint8_t *sysid) { const struct sr_node *srn = srp->srn; - /* Is the adjacency the last hop? */ + /* Check if the nexthop SR Node is the last hop? */ if (memcmp(sysid, srn->sysid, ISIS_SYS_ID_LEN) == 0) { + /* SR-Node doesn't request NO-PHP. Return Implicit NULL label */ if (!CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_NO_PHP)) return MPLS_LABEL_IMPLICIT_NULL; + /* SR-Node requests Implicit NULL Label */ if (CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_EXPLICIT_NULL)) { if (srp->prefix.family == AF_INET) return MPLS_LABEL_IPV4_EXPLICIT_NULL; @@ -450,19 +624,19 @@ static mpls_label_t sr_prefix_out_label(const struct sr_prefix *srp, /* Fallthrough */ } - /* Absolute SID value. */ + /* Return SID value as MPLS label if it is an Absolute SID */ if (CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_VALUE | ISIS_PREFIX_SID_LOCAL)) { /* * V/L SIDs have local significance, so only adjacent routers - * can use them. + * can use them (RFC8667 section #2.1.1.1) */ if (srp->srn != srn_nexthop) return MPLS_INVALID_LABEL; return srp->sid.value; } - /* Index SID value. */ + /* Check that SID index falls inside the SRGB */ if (srp->sid.value >= srn_nexthop->cap.srgb.range_size) { flog_warn(EC_ISIS_SID_OVERFLOW, "%s: SID index %u falls outside remote SRGB range", @@ -470,17 +644,25 @@ static mpls_label_t sr_prefix_out_label(const struct sr_prefix *srp, return MPLS_INVALID_LABEL; } + /* Return MPLS label as SID index + SRGB_lower_bound as per RFC 8667 */ return (srn_nexthop->cap.srgb.lower_bound + srp->sid.value); } -/* Process local Prefix-SID and install it if possible. */ +/** + * Process local Prefix-SID and install it if possible. Input label is + * computed before installing it in LFIB. + * + * @param srp Segment Routing Prefix + * + * @return 0 on success, -1 otherwise + */ static int sr_prefix_install_local(struct sr_prefix *srp) { mpls_label_t input_label; const struct sr_node *srn = srp->srn; /* - * No need to install LSP to local Prefix-SID unless the + * No need to install Label for local Prefix-SID unless the * no-PHP option is configured. */ if (!CHECK_FLAG(srp->sid.flags, ISIS_PREFIX_SID_NO_PHP) @@ -491,7 +673,7 @@ static int sr_prefix_install_local(struct sr_prefix *srp) &srp->prefix, IS_SID_VALUE(srp->sid.flags) ? "label" : "index", srp->sid.value, circuit_t2string(srn->level)); - /* Calculate local label. */ + /* Compute input label and check that is valid. */ input_label = sr_prefix_in_label(srp); if (input_label == MPLS_INVALID_LABEL) return -1; @@ -506,7 +688,14 @@ static int sr_prefix_install_local(struct sr_prefix *srp) return 0; } -/* Process remote Prefix-SID and install it if possible. */ +/** + * Process remote Prefix-SID and install it if possible. Input and Output + * labels are computed before installing them in LFIB. + * + * @param srp Segment Routing Prefix + * + * @return 0 on success, -1 otherwise + */ static int sr_prefix_install_remote(struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; @@ -517,14 +706,14 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) mpls_label_t input_label; size_t nexthop_num = 0; - /* Lookup associated IS-IS route. */ + /* Lookup to associated IS-IS route. */ tree_id = (srp->prefix.family == AF_INET) ? SPFTREE_IPV4 : SPFTREE_IPV6; srp->u.remote.rinfo = sr_prefix_lookup_route(area, tree_id, srp); if (!srp->u.remote.rinfo) /* SPF hasn't converged for this route yet. */ return -1; - /* Calculate local label. */ + /* Compute input label and check that is valid. */ input_label = sr_prefix_in_label(srp); if (input_label == MPLS_INVALID_LABEL) return -1; @@ -533,6 +722,7 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) IS_SID_VALUE(srp->sid.flags) ? "label" : "index", srp->sid.value, circuit_t2string(srn->level)); + /* Process all SPF nexthops */ for (ALL_LIST_ELEMENTS_RO(srp->u.remote.rinfo->nexthops, node, nexthop)) { struct sr_node *srn_nexthop; @@ -553,6 +743,7 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) && !IS_SR_IPV6(srn_nexthop->cap.srgb))) goto next; + /* Compute output label and check if it is valid */ output_label = sr_prefix_out_label(srp, srn_nexthop, nexthop->sysid); if (output_label == MPLS_INVALID_LABEL) @@ -573,6 +764,8 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) next: isis_sr_nexthop_reset(&nexthop->sr); } + + /* Check that we found at least one valid nexthop */ if (nexthop_num == 0) { sr_debug(" |- no valid nexthops"); return -1; @@ -587,7 +780,11 @@ static int sr_prefix_install_remote(struct sr_prefix *srp) return 0; } -/* Process local or remote Prefix-SID and install it if possible. */ +/** + * Process local or remote Prefix-SID and install it if possible. + * + * @param srp Segment Routing Prefix + */ static void sr_prefix_install(struct sr_prefix *srp) { const struct sr_node *srn = srp->srn; @@ -620,6 +817,7 @@ static void sr_prefix_install(struct sr_prefix *srp) } } + /* Install corresponding LFIB entry */ if (srp->type == ISIS_SR_PREFIX_LOCAL) ret = sr_prefix_install_local(srp); else @@ -628,12 +826,17 @@ static void sr_prefix_install(struct sr_prefix *srp) sr_prefix_uninstall(srp); } -/* Uninstall local or remote Prefix-SID. */ +/** + * Uninstall local or remote Prefix-SID. + * + * @param srp Segment Routing Prefix + */ static void sr_prefix_uninstall(struct sr_prefix *srp) { struct listnode *node; struct isis_nexthop *nexthop; + /* Check that Input Label is valid */ if (srp->input_label == MPLS_INVALID_LABEL) return; @@ -660,7 +863,11 @@ static void sr_prefix_uninstall(struct sr_prefix *srp) } } -/* Reinstall local or remote Prefix-SID. */ +/** + * Reinstall local or remote Prefix-SID. + * + * @param srp Segment Routing Prefix + */ static inline void sr_prefix_reinstall(struct sr_prefix *srp, bool make_before_break) { @@ -673,12 +880,22 @@ static inline void sr_prefix_reinstall(struct sr_prefix *srp, if (!make_before_break) sr_prefix_uninstall(srp); + /* New input label is computed in sr_prefix_install() function */ sr_prefix_install(srp); } -/*----------------------------------------------------------------------------*/ +/* --- IS-IS LSP Parse functions -------------------------------------------- */ -/* Parse all SR-related information from the given Router Capabilities TLV. */ +/** + * Parse all SR-related information from the given Router Capabilities TLV. + * + * @param area IS-IS area + * @param level IS-IS level + * @param sysid System ID of the LSP + * @param router_cap Router Capability subTLVs + * + * @return Segment Routing Node structure for this System ID + */ static struct sr_node * parse_router_cap_tlv(struct isis_area *area, int level, const uint8_t *sysid, const struct isis_router_cap *router_cap) @@ -709,7 +926,14 @@ parse_router_cap_tlv(struct isis_area *area, int level, const uint8_t *sysid, return srn; } -/* Parse list of Prefix-SID Sub-TLVs. */ +/** + * Parse list of Prefix-SID Sub-TLVs. + * + * @param srn Segment Routing Node + * @param prefix Prefix to be parsed + * @param local True if prefix comes from own LSP, false otherwise + * @param prefix_sids Prefix SID subTLVs + */ static void parse_prefix_sid_subtlvs(struct sr_node *srn, union prefixconstptr prefix, bool local, struct isis_item_list *prefix_sids) @@ -719,13 +943,16 @@ static void parse_prefix_sid_subtlvs(struct sr_node *srn, sr_debug("ISIS-Sr (%s): Parse Prefix SID TLV", area->area_tag); + /* Parse list of Prefix SID subTLVs */ for (i = prefix_sids->head; i; i = i->next) { struct isis_prefix_sid *psid = (struct isis_prefix_sid *)i; struct sr_prefix *srp; + /* Only SPF algorithm is supported right now */ if (psid->algorithm != SR_ALGORITHM_SPF) continue; + /* Compute corresponding Segment Routing Prefix */ srp = sr_prefix_find_by_node(srn, prefix); if (srp) { if (srp->sid.flags != psid->flags @@ -753,7 +980,14 @@ static void parse_prefix_sid_subtlvs(struct sr_node *srn, } } -/* Parse all SR-related information from the given LSP. */ +/** + * Parse all SR-related information from the given LSP. + * + * @param area IS-IS area + * @param level IS-IS level + * @param srn Segment Routing Node + * @param lsp IS-IS LSP + */ static void parse_lsp(struct isis_area *area, int level, struct sr_node **srn, struct isis_lsp *lsp) { @@ -761,6 +995,7 @@ static void parse_lsp(struct isis_area *area, int level, struct sr_node **srn, struct isis_item *i; bool local = lsp->own_lsp; + /* Check LSP sequence number */ if (lsp->hdr.seqno == 0) { zlog_warn("%s: lsp with 0 seq_num - ignore", __func__); return; @@ -805,24 +1040,31 @@ static void parse_lsp(struct isis_area *area, int level, struct sr_node **srn, } } -/* Parse all SR-related information from the entire LSPDB. */ +/** + * Parse all SR-related information from the entire LSPDB. + * + * @param area IS-IS area + */ static void parse_lspdb(struct isis_area *area) { struct isis_lsp *lsp; sr_debug("ISIS-Sr (%s): Parse LSP Data Base", area->area_tag); + /* Process all LSP from Level 1 & 2 */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { frr_each (lspdb, &area->lspdb[level - 1], lsp) { struct isis_lsp *frag; struct listnode *node; struct sr_node *srn = NULL; + /* Skip Pseudo ID LSP and LSP without TLVs */ if (LSP_PSEUDO_ID(lsp->hdr.lsp_id)) continue; if (!lsp->tlvs) continue; + /* Parse LSP, then fragment */ parse_lsp(area, level, &srn, lsp); for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) parse_lsp(area, level, &srn, frag); @@ -830,7 +1072,12 @@ static void parse_lspdb(struct isis_area *area) } } -/* Process any new/deleted/modified Prefix-SID in the LSPDB. */ +/** + * Process any new/deleted/modified Prefix-SID in the LSPDB. + * + * @param srn Segment Routing Node + * @param srp Segment Routing Prefix + */ static void process_prefix_changes(struct sr_node *srn, struct sr_prefix *srp) { struct isis_area *area = srn->area; @@ -857,10 +1104,17 @@ static void process_prefix_changes(struct sr_node *srn, struct sr_prefix *srp) return; } + /* Validate SRDB State for next LSPDB parsing */ srp->state = SRDB_STATE_VALIDATED; } -/* Process any new/deleted/modified SRGB in the LSPDB. */ +/** + * Process any new/deleted/modified SRGB in the LSPDB. + * + * @param area IS-IS area + * @param level IS-IS level + * @param srn Segment Routing Node + */ static void process_node_changes(struct isis_area *area, int level, struct sr_node *srn) { @@ -871,8 +1125,8 @@ static void process_node_changes(struct isis_area *area, int level, memcpy(sysid, srn->sysid, sizeof(sysid)); /* - * If an adjacent router's SRGB was changed or created, then reinstall - * all Prefix-SIDs from all nodes. + * If an neighbor router's SRGB was changed or created, then reinstall + * all Prefix-SIDs from all nodes that use this neighbor as nexthop. */ adjacent = isis_adj_exists(area, level, sysid); switch (srn->state) { @@ -886,22 +1140,30 @@ static void process_node_changes(struct isis_area *area, int level, case SRDB_STATE_UNCHANGED: break; default: + /* SR capabilities have been removed. Delete SR-Node */ sr_debug("ISIS-Sr (%s): Remove SR node %s", area->area_tag, sysid_print(srn->sysid)); - sr_node_del(area, level, srn); + sr_node_del(area, level, srn); + /* and Update remaining Prefix-SID from all remaining SR Node */ if (adjacent) sr_node_srgb_update(area, level, sysid); return; } + /* Validate SRDB State for next LSPDB parsing */ srn->state = SRDB_STATE_VALIDATED; + /* Finally, process all Prefix-SID of this SR Node */ frr_each_safe (srdb_node_prefix, &srn->prefix_sids, srp) process_prefix_changes(srn, srp); } -/* Parse and process all SR-related Sub-TLVs after running the SPF algorithm. */ +/** + * Parse and process all SR-related Sub-TLVs after running the SPF algorithm. + * + * @param area IS-IS area + */ void isis_area_verify_sr(struct isis_area *area) { struct sr_node *srn; @@ -919,9 +1181,15 @@ void isis_area_verify_sr(struct isis_area *area) } } -/* +/** * Once a route is updated in the SPT, reinstall or uninstall its corresponding * Prefix-SID (if any). + * + * @param area IS-IS area + * @param prefix Prefix to be updated + * @param route_info New Route Information + * + * @return 0 */ static int sr_route_update(struct isis_area *area, struct prefix *prefix, struct isis_route_info *route_info) @@ -934,6 +1202,7 @@ static int sr_route_update(struct isis_area *area, struct prefix *prefix, sr_debug("ISIS-Sr (%s): Update route for prefix %pFX", area->area_tag, prefix); + /* Lookup to Segment Routing Prefix for this prefix */ switch (area->is_type) { case IS_LEVEL_1: srp = sr_prefix_find_by_area(area, ISIS_LEVEL1, prefix); @@ -952,9 +1221,11 @@ static int sr_route_update(struct isis_area *area, struct prefix *prefix, exit(1); } + /* Skip NULL or local Segment Routing Prefix */ if (!srp || srp->type == ISIS_SR_PREFIX_LOCAL) return 0; + /* Install or unintall Prefix-SID if route is Active or not */ if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) { /* * The Prefix-SID input label hasn't changed. We could use the @@ -971,9 +1242,15 @@ static int sr_route_update(struct isis_area *area, struct prefix *prefix, return 0; } -/*----------------------------------------------------------------------------*/ +/* --- Segment Routing Adjacency-SID management functions ------------------- */ -/* Add new local Adj-SID. */ +/** + * 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 + */ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, bool backup) { @@ -989,6 +1266,7 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, sr_debug("ISIS-Sr (%s): Add %s Adjacency SID", area->area_tag, backup ? "Backup" : "Primary"); + /* Determine nexthop IP address */ switch (family) { case AF_INET: if (!circuit->ip_router) @@ -1008,6 +1286,7 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, exit(1); } + /* Prepare Segment Routing Adjacency as per RFC8667 section #2.2 */ flags = EXT_SUBTLV_LINK_ADJ_SID_VFLG | EXT_SUBTLV_LINK_ADJ_SID_LFLG; if (family == AF_INET6) SET_FLAG(flags, EXT_SUBTLV_LINK_ADJ_SID_FFLG); @@ -1024,6 +1303,7 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, sra->nexthop.address = nexthop; sra->nexthop.label = input_label; switch (circuit->circ_type) { + /* LAN Adjacency-SID for Broadcast interface section #2.2.2 */ case CIRCUIT_T_BROADCAST: ladj_sid = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*ladj_sid)); ladj_sid->family = family; @@ -1035,6 +1315,7 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, isis_tlvs_add_lan_adj_sid(circuit->ext, ladj_sid); sra->u.ladj_sid = ladj_sid; break; + /* Adjacency-SID for Point to Point interface section #2.2.1 */ case CIRCUIT_T_P2P: adj_sid = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*adj_sid)); adj_sid->family = family; @@ -1049,6 +1330,8 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, __func__, circuit->circ_type); exit(1); } + + /* Add Adjacency-SID in SRDB */ sra->adj = adj; listnode_add(area->srdb.adj_sids, sra); listnode_add(adj->adj_sids, sra); @@ -1056,13 +1339,23 @@ static void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, isis_zebra_send_adjacency_sid(ZEBRA_MPLS_LABELS_ADD, sra); } +/** + * Add Primary and Backup local Adjacency SID. + * + * @param adj IS-IS Adjacency + * @param family Inet Family (IPv4 or IPv6) + */ 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); } -/* Delete local Adj-SID. */ +/** + * Delete local Adj-SID. + * + * @param sra Segment Routing Adjacency + */ static void sr_adj_sid_del(struct sr_adjacency *sra) { struct isis_circuit *circuit = sra->adj->circuit; @@ -1072,6 +1365,7 @@ static void sr_adj_sid_del(struct sr_adjacency *sra) isis_zebra_send_adjacency_sid(ZEBRA_MPLS_LABELS_DELETE, sra); + /* Release dynamic label and remove subTLVs */ switch (circuit->circ_type) { case CIRCUIT_T_BROADCAST: isis_zebra_release_dynamic_label(sra->u.ladj_sid->sid); @@ -1087,12 +1381,19 @@ static void sr_adj_sid_del(struct sr_adjacency *sra) exit(1); } + /* 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); } -/* Remove all Adj-SIDs associated to an adjacency that is going down. */ +/** + * Remove all Adjacency-SIDs associated to an adjacency that is going down. + * + * @param adj IS-IS Adjacency + * + * @return 0 + */ static int sr_adj_state_change(struct isis_adjacency *adj) { struct sr_adjacency *sra; @@ -1110,9 +1411,14 @@ static int sr_adj_state_change(struct isis_adjacency *adj) return 0; } -/* - * Adjacency now has one or more IPv4/IPv6 addresses. Add new IPv4 or IPv6 - * Adj-SID accordingly. +/** + * When IS-IS Adjacency got one or more IPv4/IPv6 addresses, add new IPv4 or + * IPv6 address to corresponding Adjacency-SID accordingly. + * + * @param adj IS-IS Adjacency + * @param family Inet Family (IPv4 or IPv6) + * + * @return 0 */ static int sr_adj_ip_enabled(struct isis_adjacency *adj, int family) { @@ -1124,9 +1430,14 @@ static int sr_adj_ip_enabled(struct isis_adjacency *adj, int family) return 0; } -/* - * Adjacency doesn't have any IPv4 or IPv6 addresses anymore. Delete the - * corresponding Adj-SID(s) accordingly. +/** + * When IS-IS Adjacency doesn't have any IPv4 or IPv6 addresses anymore, + * delete the corresponding Adjacency-SID(s) accordingly. + * + * @param adj IS-IS Adjacency + * @param family Inet Family (IPv4 or IPv6) + * + * @return 0 */ static int sr_adj_ip_disabled(struct isis_adjacency *adj, int family) { @@ -1143,6 +1454,13 @@ static int sr_adj_ip_disabled(struct isis_adjacency *adj, int family) return 0; } +/** + * Activate local Prefix-SID when loopback interface goes up for IS-IS. + * + * @param ifp Loopback Interface + * + * @return 0 + */ static int sr_if_new_hook(struct interface *ifp) { struct isis_circuit *circuit; @@ -1150,6 +1468,7 @@ static int sr_if_new_hook(struct interface *ifp) struct connected *connected; struct listnode *node; + /* Get corresponding circuit */ circuit = circuit_scan_by_ifp(ifp); if (!circuit) return 0; @@ -1180,8 +1499,16 @@ static int sr_if_new_hook(struct interface *ifp) return 0; } -/*----------------------------------------------------------------------------*/ +/* --- Segment Routing Show information functions --------------------------- */ +/** + * Show Local Prefix-SID. + * + * @param vty VTY output + * @param tt Table format + * @param area IS-IS area + * @param srp Segment Routing Prefix + */ static void show_prefix_sid_local(struct vty *vty, struct ttable *tt, const struct isis_area *area, const struct sr_prefix *srp) @@ -1209,6 +1536,14 @@ static void show_prefix_sid_local(struct vty *vty, struct ttable *tt, srp->sid.value, buf_llabel, buf_rlabel, buf_uptime); } +/** + * Show Remote Prefix-SID. + * + * @param vty VTY output + * @param tt Table format + * @param area IS-IS area + * @param srp Segment Routing Prefix + */ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, const struct isis_area *area, const struct sr_prefix *srp) @@ -1268,6 +1603,13 @@ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, } } +/** + * Show Prefix-SIDs. + * + * @param vty VTY output + * @param area IS-IS area + * @param level IS-IS level + */ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) { struct sr_prefix *srp; @@ -1286,6 +1628,7 @@ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) ttable_restyle(tt); ttable_rowseps(tt, 0, BOTTOM, true, '-'); + /* Process all Prefix-SID from the SRDB */ frr_each (srdb_area_prefix, &area->srdb.prefix_sids[level - 1], srp) { switch (srp->type) { case ISIS_SR_PREFIX_LOCAL: @@ -1308,6 +1651,9 @@ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) ttable_del(tt); } +/** + * Declaration of new show command. + */ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, "show isis segment-routing prefix-sids", SHOW_STR PROTO_HELP @@ -1328,9 +1674,15 @@ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, return CMD_SUCCESS; } -/*----------------------------------------------------------------------------*/ +/* --- IS-IS Segment Routing Management function ---------------------------- */ -/* Try to enable SR on the given IS-IS area. */ +/** + * Enable SR on the given IS-IS area. + * + * @param area IS-IS area + * + * @return 0 on success, -1 otherwise + */ int isis_sr_start(struct isis_area *area) { struct isis_sr_db *srdb = &area->srdb; @@ -1350,7 +1702,7 @@ int isis_sr_start(struct isis_area *area) sr_debug("ISIS-Sr: Starting Segment Routing for area %s", area->area_tag); - /* Create Adj-SIDs for existing adjacencies. */ + /* Create Adjacency-SIDs from existing IS-IS Adjacencies. */ for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) { struct isis_adjacency *adj; struct listnode *anode; @@ -1381,13 +1733,17 @@ int isis_sr_start(struct isis_area *area) } } - /* Regenerate LSPs. */ + /* Regenerate LSPs to advertise Segment Routing capabilities. */ lsp_regenerate_schedule(area, area->is_type, 0); return 0; } -/* Disable SR on the given IS-IS area. */ +/** + * Disable SR on the given IS-IS area. + * + * @param area IS-IS area + */ void isis_sr_stop(struct isis_area *area) { struct isis_sr_db *srdb = &area->srdb; @@ -1397,11 +1753,11 @@ void isis_sr_stop(struct isis_area *area) sr_debug("ISIS-Sr: Stopping Segment Routing for area %s", area->area_tag); - /* Uninstall Adj-SIDs. */ + /* Uninstall all local Adjacency-SIDs. */ for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra)) sr_adj_sid_del(sra); - /* Uninstall Prefix-SIDs. */ + /* Uninstall all Prefix-SIDs from all SR Node. */ for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { while (srdb_node_count(&srdb->sr_nodes[level - 1]) > 0) { struct sr_node *srn; @@ -1415,10 +1771,15 @@ void isis_sr_stop(struct isis_area *area) isis_zebra_release_label_range(srdb->config.srgb_lower_bound, srdb->config.srgb_upper_bound); - /* Regenerate LSPs. */ + /* Regenerate LSPs to advertise that the Node is no more SR enable. */ lsp_regenerate_schedule(area, area->is_type, 0); } +/** + * IS-IS Segment Routing initialization for given area. + * + * @param area IS-IS area + */ void isis_sr_area_init(struct isis_area *area) { struct isis_sr_db *srdb = &area->srdb; @@ -1426,6 +1787,7 @@ void isis_sr_area_init(struct isis_area *area) sr_debug("ISIS-Sr (%s): Initialize Segment Routing SRDB", area->area_tag); + /* Initialize Segment Routing Data Base */ memset(srdb, 0, sizeof(*srdb)); srdb->enabled = false; srdb->adj_sids = list_new(); @@ -1451,6 +1813,11 @@ void isis_sr_area_init(struct isis_area *area) srdb_prefix_cfg_init(&srdb->config.prefix_sids); } +/** + * Terminate IS-IS Segment Routing for the given area. + * + * @param area IS-IS area + */ void isis_sr_area_term(struct isis_area *area) { struct isis_sr_db *srdb = &area->srdb; @@ -1468,6 +1835,9 @@ void isis_sr_area_term(struct isis_area *area) } } +/** + * IS-IS Segment Routing global initialization. + */ void isis_sr_init(void) { install_element(VIEW_NODE, &show_sr_prefix_sids_cmd); @@ -1480,6 +1850,9 @@ void isis_sr_init(void) hook_register(isis_if_new_hook, sr_if_new_hook); } +/** + * IS-IS Segment Routing global terminate. + */ void isis_sr_term(void) { /* Unregister hooks. */ diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index b2e0130754..dec329ab48 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -1,8 +1,7 @@ /* - * This is an implementation of Segment Routing for IS-IS - * as per draft draft-ietf-isis-segment-routing-extensions-25 + * This is an implementation of Segment Routing for IS-IS as per RFC 8667 * - * Copyright (C) 2019 Orange Labs http://www.orange.com + * Copyright (C) 2019 Orange http://www.orange.com * * Author: Olivier Dugeon * Contributor: Renato Westphal for NetDEF @@ -55,30 +54,31 @@ #define SRGB_LOWER_BOUND 16000 #define SRGB_UPPER_BOUND 23999 +/* Segment Routing Data Base (SRDB) RB-Tree structure */ PREDECL_RBTREE_UNIQ(srdb_node) PREDECL_RBTREE_UNIQ(srdb_node_prefix) PREDECL_RBTREE_UNIQ(srdb_area_prefix) PREDECL_RBTREE_UNIQ(srdb_prefix_cfg) -/* SR Adj-SID type. */ +/* Segment Routing Adjacency-SID type. */ enum sr_adj_type { ISIS_SR_ADJ_NORMAL = 0, ISIS_SR_LAN_BACKUP, }; -/* SR Adjacency. */ +/* Segment Routing Adjacency. */ struct sr_adjacency { /* Adjacency type. */ enum sr_adj_type type; - /* Adj-SID nexthop information. */ + /* Adjacency-SID nexthop information. */ struct { int family; union g_addr address; mpls_label_t label; } nexthop; - /* (LAN-)Adj-SID Sub-TLV. */ + /* (LAN-)Adjacency-SID Sub-TLV. */ union { struct isis_adj_sid *adj_sid; struct isis_lan_adj_sid *ladj_sid; @@ -88,13 +88,13 @@ struct sr_adjacency { struct isis_adjacency *adj; }; -/* SR Prefix-SID type. */ +/* Segment Routing Prefix-SID type. */ enum sr_prefix_type { ISIS_SR_PREFIX_LOCAL = 0, ISIS_SR_PREFIX_REMOTE, }; -/* SR Nexthop Information. */ +/* Segment Routing Nexthop Information. */ struct sr_nexthop_info { mpls_label_t label; time_t uptime; @@ -108,16 +108,16 @@ enum srdb_state { SRDB_STATE_UNCHANGED }; -/* SR Prefix-SID. */ +/* Segment Routing Prefix-SID. */ struct sr_prefix { - /* RB-tree entries. */ + /* SRDB RB-tree entries. */ struct srdb_node_prefix_item node_entry; struct srdb_area_prefix_item area_entry; /* IP prefix. */ struct prefix prefix; - /* SID value, algorithm and flags. */ + /* SID value, algorithm and flags subTLVs. */ struct isis_prefix_sid sid; /* Input label value. */ @@ -136,16 +136,16 @@ struct sr_prefix { } remote; } u; - /* Backpointer to SR node. */ + /* Backpointer to Segment Routing node. */ struct sr_node *srn; /* SR-Prefix State used while the LSPDB is being parsed. */ enum srdb_state state; }; -/* SR node. */ +/* Segment Routing node. */ struct sr_node { - /* RB-tree entry. */ + /* SRDB RB-tree entry. */ struct srdb_node_item entry; /* IS-IS level: ISIS_LEVEL1 or ISIS_LEVEL2. */ @@ -154,7 +154,7 @@ struct sr_node { /* IS-IS node identifier. */ uint8_t sysid[ISIS_SYS_ID_LEN]; - /* IS-IS node capabilities (SRGB, SR Algorithms, etc). */ + /* Segment Routing node capabilities (SRGB, SR Algorithms) subTLVs. */ struct isis_router_cap cap; /* List of Prefix-SIDs advertised by this node. */ @@ -167,7 +167,7 @@ struct sr_node { enum srdb_state state; }; -/* NOTE: these values must be in sync with the YANG module. */ +/* SID type. NOTE: these values must be in sync with the YANG module. */ enum sr_sid_value_type { SR_SID_VALUE_TYPE_INDEX = 0, SR_SID_VALUE_TYPE_ABSOLUTE = 1, @@ -175,16 +175,16 @@ enum sr_sid_value_type { #define IS_SID_VALUE(flag) CHECK_FLAG(flag, ISIS_PREFIX_SID_VALUE) -/* NOTE: these values must be in sync with the YANG module. */ +/* Last Hop Behavior. NOTE: these values must be in sync with the YANG module */ enum sr_last_hop_behavior { SR_LAST_HOP_BEHAVIOR_EXP_NULL = 0, SR_LAST_HOP_BEHAVIOR_NO_PHP = 1, SR_LAST_HOP_BEHAVIOR_PHP = 2, }; -/* SR Prefix-SID configuration. */ +/* Segment Routing Prefix-SID configuration. */ struct sr_prefix_cfg { - /* RB-tree entry. */ + /* SRDB RB-tree entry. */ struct srdb_prefix_cfg_item entry; /* IP prefix. */ @@ -206,21 +206,21 @@ struct sr_prefix_cfg { struct isis_area *area; }; -/* Per-area IS-IS Segment Routing information. */ +/* Per-area IS-IS Segment Routing Data Base (SRDB). */ struct isis_sr_db { - /* Operational status of Segment Routing. */ + /* Global Operational status of Segment Routing. */ bool enabled; - /* Adj-SIDs. */ + /* List of local Adjacency-SIDs. */ struct list *adj_sids; - /* SR information from all nodes. */ + /* Segment Routing Node information per IS-IS level. */ struct srdb_node_head sr_nodes[ISIS_LEVELS]; - /* Prefix-SIDs. */ + /* Segment Routing Prefix-SIDs per IS-IS level. */ struct srdb_area_prefix_head prefix_sids[ISIS_LEVELS]; - /* Area SR configuration. */ + /* Area Segment Routing configuration. */ struct { /* Administrative status of Segment Routing. */ bool enabled; diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index be88ee85a6..923956fa6d 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -284,7 +284,7 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts, sbuf_push(buf, indent, "Unidir. Utilized Bandwidth: %g (Bytes/sec)\n", exts->use_bw); - /* Segment Routing Adjacency */ + /* Segment Routing Adjacency as per RFC8667 section #2.2.1 */ if (IS_SUBTLV(exts, EXT_ADJ_SID)) { struct isis_adj_sid *adj; @@ -315,6 +315,7 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts, : '0'); } } + /* Segment Routing LAN-Adjacency as per RFC8667 section #2.2.2 */ if (IS_SUBTLV(exts, EXT_LAN_ADJ_SID)) { struct isis_lan_adj_sid *lan; @@ -476,6 +477,7 @@ static int pack_item_ext_subtlvs(struct isis_ext_subtlvs *exts, stream_putc(s, ISIS_SUBTLV_DEF_SIZE); stream_putf(s, exts->use_bw); } + /* Segment Routing Adjacency as per RFC8667 section #2.2.1 */ if (IS_SUBTLV(exts, EXT_ADJ_SID)) { struct isis_adj_sid *adj; @@ -495,6 +497,7 @@ static int pack_item_ext_subtlvs(struct isis_ext_subtlvs *exts, } } + /* Segment Routing LAN-Adjacency as per RFC8667 section #2.2.2 */ if (IS_SUBTLV(exts, EXT_LAN_ADJ_SID)) { struct isis_lan_adj_sid *lan; @@ -721,7 +724,7 @@ static int unpack_item_ext_subtlvs(uint16_t mtid, uint8_t len, struct stream *s, SET_SUBTLV(exts, EXT_USE_BW); } break; - /* Segment Routing Adjacency */ + /* Segment Routing Adjacency as per RFC8667 section #2.2.1 */ case ISIS_SUBTLV_ADJ_SID: if (subtlv_len != ISIS_SUBTLV_ADJ_SID_SIZE && subtlv_len != ISIS_SUBTLV_ADJ_SID_SIZE + 1) { @@ -749,6 +752,7 @@ static int unpack_item_ext_subtlvs(uint16_t mtid, uint8_t len, struct stream *s, SET_SUBTLV(exts, EXT_ADJ_SID); } break; + /* Segment Routing LAN-Adjacency as per RFC8667 section 2.2.2 */ case ISIS_SUBTLV_LAN_ADJ_SID: if (subtlv_len != ISIS_SUBTLV_LAN_ADJ_SID_SIZE && subtlv_len != ISIS_SUBTLV_LAN_ADJ_SID_SIZE + 1) { @@ -789,7 +793,7 @@ static int unpack_item_ext_subtlvs(uint16_t mtid, uint8_t len, struct stream *s, return 0; } -/* Functions for Sub-TLV 3 SR Prefix-SID */ +/* Functions for Sub-TLV 3 SR Prefix-SID as per RFC8667 section 2.1 */ static struct isis_item *copy_item_prefix_sid(struct isis_item *i) { struct isis_prefix_sid *sid = (struct isis_prefix_sid *)i; @@ -2585,7 +2589,7 @@ out: return 1; } -/* Functions related to TLV 242 Router Capability */ +/* Functions related to TLV 242 Router Capability as per RFC7981 */ static struct isis_router_cap *copy_tlv_router_cap( const struct isis_router_cap *router_cap) { @@ -2614,7 +2618,7 @@ static void format_tlv_router_cap(const struct isis_router_cap *router_cap, router_cap->flags & ISIS_ROUTER_CAP_FLAG_D ? '1' : '0', router_cap->flags & ISIS_ROUTER_CAP_FLAG_S ? '1' : '0'); - /* SR Global Block */ + /* Segment Routing Global Block as per RFC8667 section #3.1 */ if (router_cap->srgb.range_size != 0) sbuf_push(buf, indent, " Segment Routing: I:%s V:%s, SRGB Base: %d Range: %d\n", @@ -2623,7 +2627,7 @@ static void format_tlv_router_cap(const struct isis_router_cap *router_cap, router_cap->srgb.lower_bound, router_cap->srgb.range_size); - /* SR Algorithms */ + /* Segment Routing Algorithms as per RFC8667 section #3.2 */ if (router_cap->algo[0] != SR_ALGORITHM_UNSET) { sbuf_push(buf, indent, " Algorithm: %s", router_cap->algo[0] == 0 ? "0: SPF" @@ -2637,7 +2641,7 @@ static void format_tlv_router_cap(const struct isis_router_cap *router_cap, sbuf_push(buf, indent, "\n"); } - /* SR Node MSSD */ + /* Segment Routing Node MSD as per RFC8491 section #2 */ if (router_cap->msd != 0) sbuf_push(buf, indent, " Node MSD: %d\n", router_cap->msd); } @@ -2674,7 +2678,7 @@ static int pack_tlv_router_cap(const struct isis_router_cap *router_cap, stream_put_ipv4(s, router_cap->router_id.s_addr); stream_putc(s, router_cap->flags); - /* Add SRGB if set */ + /* Add SRGB if set as per RFC8667 section #3.1 */ if ((router_cap->srgb.range_size != 0) && (router_cap->srgb.lower_bound != 0)) { stream_putc(s, ISIS_SUBTLV_SID_LABEL_RANGE); @@ -2685,7 +2689,7 @@ static int pack_tlv_router_cap(const struct isis_router_cap *router_cap, stream_putc(s, ISIS_SUBTLV_SID_LABEL_SIZE); stream_put3(s, router_cap->srgb.lower_bound); - /* Then SR Algorithm if set */ + /* Then SR Algorithm if set as per RFC8667 section #3.2 */ for (nb_algo = 0; nb_algo < SR_ALGORITHM_COUNT; nb_algo++) if (router_cap->algo[nb_algo] == SR_ALGORITHM_UNSET) break; @@ -2695,7 +2699,7 @@ static int pack_tlv_router_cap(const struct isis_router_cap *router_cap, for (int i = 0; i < nb_algo; i++) stream_putc(s, router_cap->algo[i]); } - /* And finish with MSD if set */ + /* And finish with MSD if set as per RFC8491 section #2 */ if (router_cap->msd != 0) { stream_putc(s, ISIS_SUBTLV_NODE_MSD); stream_putc(s, ISIS_SUBTLV_NODE_MSD_SIZE); @@ -4602,6 +4606,7 @@ void isis_tlvs_add_oldstyle_ip_reach(struct isis_tlvs *tlvs, append_item(&tlvs->oldstyle_ip_reach, (struct isis_item *)r); } +/* Add IS-IS SR Adjacency-SID subTLVs */ void isis_tlvs_add_adj_sid(struct isis_ext_subtlvs *exts, struct isis_adj_sid *adj) { @@ -4609,6 +4614,7 @@ void isis_tlvs_add_adj_sid(struct isis_ext_subtlvs *exts, SET_SUBTLV(exts, EXT_ADJ_SID); } +/* Delete IS-IS SR Adjacency-SID subTLVs */ void isis_tlvs_del_adj_sid(struct isis_ext_subtlvs *exts, struct isis_adj_sid *adj) { @@ -4618,6 +4624,7 @@ void isis_tlvs_del_adj_sid(struct isis_ext_subtlvs *exts, UNSET_SUBTLV(exts, EXT_ADJ_SID); } +/* Add IS-IS SR LAN-Adjacency-SID subTLVs */ void isis_tlvs_add_lan_adj_sid(struct isis_ext_subtlvs *exts, struct isis_lan_adj_sid *lan) { @@ -4625,6 +4632,7 @@ void isis_tlvs_add_lan_adj_sid(struct isis_ext_subtlvs *exts, SET_SUBTLV(exts, EXT_LAN_ADJ_SID); } +/* Delete IS-IS SR LAN-Adjacency-SID subTLVs */ void isis_tlvs_del_lan_adj_sid(struct isis_ext_subtlvs *exts, struct isis_lan_adj_sid *lan) { diff --git a/isisd/isis_tlvs.h b/isisd/isis_tlvs.h index c3b25669b6..f468d85bbd 100644 --- a/isisd/isis_tlvs.h +++ b/isisd/isis_tlvs.h @@ -135,10 +135,7 @@ struct isis_threeway_adj { uint32_t neighbor_circuit_id; }; -/* - * Segment Routing subTLV's as per - * draft-ietf-isis-segment-routing-extension-25 - */ +/* Segment Routing subTLV's as per RFC8667 */ #define ISIS_SUBTLV_SRGB_FLAG_I 0x80 #define ISIS_SUBTLV_SRGB_FLAG_V 0x40 #define IS_SR_IPV4(srgb) (srgb.flags & ISIS_SUBTLV_SRGB_FLAG_I) @@ -216,7 +213,7 @@ struct isis_router_cap { struct in_addr router_id; uint8_t flags; - /* draft-ietf-segment-routing-extensions-25 */ + /* RFC 8667 section #3 */ struct isis_srgb srgb; uint8_t algo[SR_ALGORITHM_COUNT]; /* RFC 8491 */ @@ -344,7 +341,7 @@ struct isis_subtlvs { /* draft-baker-ipv6-isis-dst-src-routing-06 */ struct prefix_ipv6 *source_prefix; - /* draft-ietf-isis-segment-routing-extensions-25 */ + /* RFC 8667 section #2.4 */ struct isis_item_list prefix_sids; }; @@ -394,15 +391,17 @@ enum isis_tlv_type { /* RFC 5307 */ ISIS_SUBTLV_LLRI = 4, + /* RFC 8491 */ + ISIS_SUBTLV_NODE_MSD = 23, + /* RFC 5316 */ ISIS_SUBTLV_RAS = 24, ISIS_SUBTLV_RIP = 25, - /* draft-isis-segment-routing-extension-25 */ + /* RFC 8667 section #2 */ ISIS_SUBTLV_SID_LABEL = 1, ISIS_SUBTLV_SID_LABEL_RANGE = 2, ISIS_SUBTLV_ALGORITHM = 19, - ISIS_SUBTLV_NODE_MSD = 23, ISIS_SUBTLV_PREFIX_SID = 3, ISIS_SUBTLV_ADJ_SID = 31, ISIS_SUBTLV_LAN_ADJ_SID = 32, @@ -421,21 +420,26 @@ enum isis_tlv_type { /* subTLVs size for TE and SR */ enum ext_subtlv_size { + /* RFC 5307 */ ISIS_SUBTLV_LLRI_SIZE = 8, + /* RFC 5305 & RFC 6119 */ ISIS_SUBTLV_UNRSV_BW_SIZE = 32, ISIS_SUBTLV_TE_METRIC_SIZE = 3, ISIS_SUBTLV_IPV6_ADDR_SIZE = 16, - /* draft-isis-segment-routing-extension-25 */ + /* RFC 8491 */ + ISIS_SUBTLV_NODE_MSD_SIZE = 2, + + /* RFC 8667 section #2 */ ISIS_SUBTLV_SID_LABEL_SIZE = 3, ISIS_SUBTLV_SID_LABEL_RANGE_SIZE = 9, ISIS_SUBTLV_ALGORITHM_SIZE = 4, - ISIS_SUBTLV_NODE_MSD_SIZE = 2, ISIS_SUBTLV_ADJ_SID_SIZE = 5, ISIS_SUBTLV_LAN_ADJ_SID_SIZE = 11, ISIS_SUBTLV_PREFIX_SID_SIZE = 5, + /* RFC 7810 */ ISIS_SUBTLV_MM_DELAY_SIZE = 8, ISIS_SUBTLV_HDR_SIZE = 2, diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 68f80a3f1f..e0bf0cee14 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -254,7 +254,11 @@ void isis_zebra_route_del_route(struct prefix *prefix, zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api); } -/* Install Prefix-SID in the forwarding plane. */ +/** + * Install Prefix-SID in the forwarding plane through Zebra. + * + * @param srp Segment Routing Prefix-SID + */ static void isis_zebra_prefix_install_prefix_sid(const struct sr_prefix *srp) { struct zapi_labels zl; @@ -315,7 +319,11 @@ static void isis_zebra_prefix_install_prefix_sid(const struct sr_prefix *srp) (void)zebra_send_mpls_labels(zclient, ZEBRA_MPLS_LABELS_REPLACE, &zl); } -/* Uninstall Prefix-SID from the forwarding plane. */ +/** + * Uninstall Prefix-SID from the forwarding plane through Zebra. + * + * @param srp Segment Routing Prefix-SID + */ static void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) { struct zapi_labels zl; @@ -337,6 +345,12 @@ static void isis_zebra_uninstall_prefix_sid(const struct sr_prefix *srp) (void)zebra_send_mpls_labels(zclient, ZEBRA_MPLS_LABELS_DELETE, &zl); } +/** + * Send Prefix-SID to ZEBRA for installation or deletion. + * + * @param cmd ZEBRA_MPLS_LABELS_REPLACE or ZEBRA_ROUTE_DELETE + * @param srp Segment Routing Prefix-SID + */ void isis_zebra_send_prefix_sid(int cmd, const struct sr_prefix *srp) { @@ -357,7 +371,12 @@ void isis_zebra_send_prefix_sid(int cmd, const struct sr_prefix *srp) isis_zebra_uninstall_prefix_sid(srp); } -/* Install or uninstall (LAN)-Adj-SID. */ +/** + * Send (LAN)-Adjacency-SID to ZEBRA for installation or deletion. + * + * @param cmd ZEBRA_MPLS_LABELS_ADD or ZEBRA_ROUTE_DELETE + * @param sra Segment Routing Adjacency-SID + */ void isis_zebra_send_adjacency_sid(int cmd, const struct sr_adjacency *sra) { struct zapi_labels zl; From c0083e53388067b834d0c7c79d14c136449e993c Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Tue, 5 May 2020 16:29:46 +0200 Subject: [PATCH 17/18] isisd: Update Segment Routing Show Commands * Improve `show isis segment-routing prefix-sids` output * Add new `show isis segment-routing node' command Signed-off-by: Olivier Dugeon --- isisd/isis_sr.c | 166 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 136 insertions(+), 30 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 8a2a126997..c24c0608b2 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -1501,6 +1501,45 @@ static int sr_if_new_hook(struct interface *ifp) /* --- Segment Routing Show information functions --------------------------- */ +/** + * 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 + * + * @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) +{ + if (size < 24) + return NULL; + + if (label_in == MPLS_INVALID_LABEL) { + snprintf(buf, size, "no-op."); + return buf; + } + + switch (label_out) { + case MPLS_LABEL_IMPLICIT_NULL: + snprintf(buf, size, "Pop(%u)", label_in); + break; + case MPLS_LABEL_IPV4_EXPLICIT_NULL: + case MPLS_LABEL_IPV6_EXPLICIT_NULL: + snprintf(buf, size, "Swap(%u, null)", label_in); + break; + case MPLS_INVALID_LABEL: + snprintf(buf, size, "no-op."); + break; + default: + snprintf(buf, size, "Swap(%u, %u)", label_in, label_out); + break; + } + return buf; +} + /** * Show Local Prefix-SID. * @@ -1515,25 +1554,28 @@ static void show_prefix_sid_local(struct vty *vty, struct ttable *tt, { const struct sr_nexthop_info *srnh = &srp->u.local.info; char buf_prefix[BUFSIZ]; - char buf_llabel[BUFSIZ]; - char buf_rlabel[BUFSIZ]; + char buf_oper[BUFSIZ]; + char buf_iface[BUFSIZ]; char buf_uptime[BUFSIZ]; - if (srp->input_label != MPLS_INVALID_LABEL) - label2str(srp->input_label, buf_llabel, sizeof(buf_llabel)); - else - snprintf(buf_llabel, sizeof(buf_llabel), "-"); if (srnh->label != MPLS_INVALID_LABEL) { - label2str(srnh->label, buf_rlabel, sizeof(buf_rlabel)); + struct interface *ifp; + ifp = if_lookup_prefix(&srp->prefix, VRF_DEFAULT); + if (ifp) + strlcpy(buf_iface, ifp->name, sizeof(buf_iface)); + else + snprintf(buf_iface, sizeof(buf_iface), "-"); log_uptime(srnh->uptime, buf_uptime, sizeof(buf_uptime)); } else { - snprintf(buf_rlabel, sizeof(buf_rlabel), "-"); + snprintf(buf_iface, sizeof(buf_iface), "-"); snprintf(buf_uptime, sizeof(buf_uptime), "-"); } + sr_op2str(buf_oper, sizeof(buf_oper), srp->input_label, + MPLS_LABEL_IMPLICIT_NULL); - ttable_add_row(tt, "%s|%u|%s|local|%s|%s", + ttable_add_row(tt, "%s|%u|%s|-|%s|%s", prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)), - srp->sid.value, buf_llabel, buf_rlabel, buf_uptime); + srp->sid.value, buf_oper, buf_iface, buf_uptime); } /** @@ -1551,22 +1593,19 @@ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, struct isis_nexthop *nexthop; struct listnode *node; char buf_prefix[BUFSIZ]; - char buf_llabel[BUFSIZ]; + char buf_oper[BUFSIZ]; char buf_nhop[BUFSIZ]; char buf_iface[BUFSIZ]; - char buf_rlabel[BUFSIZ]; char buf_uptime[BUFSIZ]; bool first = true; (void)prefix2str(&srp->prefix, buf_prefix, sizeof(buf_prefix)); - if (srp->input_label != MPLS_INVALID_LABEL) - label2str(srp->input_label, buf_llabel, sizeof(buf_llabel)); - else - snprintf(buf_llabel, sizeof(buf_llabel), "-"); if (!srp->u.remote.rinfo) { ttable_add_row(tt, "%s|%u|%s|-|-|-", buf_prefix, srp->sid.value, - buf_llabel); + sr_op2str(buf_oper, sizeof(buf_oper), + srp->input_label, + MPLS_LABEL_IMPLICIT_NULL)); return; } @@ -1582,23 +1621,21 @@ static void show_prefix_sid_remote(struct vty *vty, struct ttable *tt, else snprintf(buf_iface, sizeof(buf_iface), "ifindex %u", nexthop->ifindex); - if (nexthop->sr.label == MPLS_INVALID_LABEL) { - snprintf(buf_rlabel, sizeof(buf_rlabel), "-"); + if (nexthop->sr.label == MPLS_INVALID_LABEL) snprintf(buf_uptime, sizeof(buf_uptime), "-"); - } else { - label2str(nexthop->sr.label, buf_rlabel, - sizeof(buf_rlabel)); + else log_uptime(nexthop->sr.uptime, buf_uptime, sizeof(buf_uptime)); - } + sr_op2str(buf_oper, sizeof(buf_oper), srp->input_label, + nexthop->sr.label); if (first) - ttable_add_row(tt, "%s|%u|%s|%s, %s|%s|%s", buf_prefix, - srp->sid.value, buf_llabel, buf_nhop, - buf_iface, buf_rlabel, buf_uptime); + ttable_add_row(tt, "%s|%u|%s|%s|%s|%s", buf_prefix, + srp->sid.value, buf_oper, buf_nhop, + buf_iface, buf_uptime); else - ttable_add_row(tt, "|||%s, %s|%s|%s", buf_nhop, - buf_iface, buf_rlabel, buf_uptime); + ttable_add_row(tt, "|||%s|%s|%s|%s", buf_oper, buf_nhop, + buf_iface, buf_uptime); first = false; } } @@ -1622,7 +1659,7 @@ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) /* Prepare table. */ tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]); - ttable_add_row(tt, "Prefix|SID|In Label|Nexthop|Out Label|Uptime"); + ttable_add_row(tt, "Prefix|SID|Label Op.|Nexthop|Interface|Uptime"); tt->style.cell.rpad = 2; tt->style.corner = '+'; ttable_restyle(tt); @@ -1652,7 +1689,7 @@ static void show_prefix_sids(struct vty *vty, struct isis_area *area, int level) } /** - * Declaration of new show command. + * Declaration of new show commands. */ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, "show isis segment-routing prefix-sids", @@ -1674,6 +1711,74 @@ DEFUN(show_sr_prefix_sids, show_sr_prefix_sids_cmd, return CMD_SUCCESS; } +/** + * Show Segment Routing Node. + * + * @param vty VTY output + * @param area IS-IS area + * @param level IS-IS level + */ +static void show_node(struct vty *vty, struct isis_area *area, int level) +{ + struct sr_node *srn; + struct ttable *tt; + + if (srdb_area_prefix_count(&area->srdb.prefix_sids[level - 1]) == 0) + return; + + vty_out(vty, " IS-IS %s SR-Node:\n\n", circuit_t2string(level)); + + /* Prepare table. */ + tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]); + ttable_add_row(tt, "System ID|SRGB|Algorithm|MSD"); + tt->style.cell.rpad = 2; + tt->style.corner = '+'; + ttable_restyle(tt); + ttable_rowseps(tt, 0, BOTTOM, true, '-'); + + /* Process all SR-Node from the SRDB */ + frr_each (srdb_node, &area->srdb.sr_nodes[level - 1], srn) { + ttable_add_row(tt, "%s|%u - %u|%s|%u", sysid_print(srn->sysid), + srn->cap.srgb.lower_bound, + srn->cap.srgb.lower_bound + + srn->cap.srgb.range_size - 1, + srn->cap.algo[0] == SR_ALGORITHM_SPF ? "SPF" + : "S-SPF", + srn->cap.msd); + } + + /* Dump the generated table. */ + if (tt->nrows > 1) { + char *table; + + table = ttable_dump(tt, "\n"); + vty_out(vty, "%s\n", table); + XFREE(MTYPE_TMP, table); + } + ttable_del(tt); +} + +DEFUN(show_sr_node, show_sr_node_cmd, + "show isis segment-routing node", + SHOW_STR PROTO_HELP + "Segment-Routing\n" + "Segment-Routing node\n") +{ + struct listnode *node; + struct isis_area *area; + + for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) { + vty_out(vty, "Area %s:\n", + area->area_tag ? area->area_tag : "null"); + + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) + show_node(vty, area, level); + } + + return CMD_SUCCESS; +} + + /* --- IS-IS Segment Routing Management function ---------------------------- */ /** @@ -1841,6 +1946,7 @@ void isis_sr_area_term(struct isis_area *area) void isis_sr_init(void) { install_element(VIEW_NODE, &show_sr_prefix_sids_cmd); + install_element(VIEW_NODE, &show_sr_node_cmd); /* Register hooks. */ hook_register(isis_adj_state_change_hook, sr_adj_state_change); From d4d008fea1172e6981ad18518a311d13c96269ed Mon Sep 17 00:00:00 2001 From: Olivier Dugeon Date: Tue, 5 May 2020 16:40:35 +0200 Subject: [PATCH 18/18] isisd: Update documentation for Segment Routing Signed-off-by: Olivier Dugeon --- doc/user/isisd.rst | 48 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/doc/user/isisd.rst b/doc/user/isisd.rst index f0c64b9bb0..dc598ea5bf 100644 --- a/doc/user/isisd.rst +++ b/doc/user/isisd.rst @@ -473,15 +473,16 @@ Traffic Engineering Segment Routing =============== -This is an EXPERIMENTAL support of Segment Routing as per draft -`draft-ietf-isis-segment-routing-extensions-25.txt` for MPLS dataplane. -It supports IPv4, IPv6 and ECMP and has been tested against Cisco & Juniper -routers. +This is an EXPERIMENTAL support of Segment Routing as per RFC8667 +for MPLS dataplane. It supports IPv4, IPv6 and ECMP and has been +tested against Cisco & Juniper routers. Known limitations: - No support for level redistribution (L1 to L2 or L2 to L1) - No support for binding SID - No support for SRMS + - No support for SRLB + - Only one SRGB and default SPF Algorithm is supported .. index:: [no] segment-routing on .. clicmd:: [no] segment-routing on @@ -491,14 +492,15 @@ Known limitations: .. index:: [no] segment-routing global-block (0-1048575) (0-1048575) .. clicmd:: [no] segment-routing global-block (0-1048575) (0-1048575) - Seet the Segment Routing Global Block i.e. the label range used by MPLS + Set the Segment Routing Global Block i.e. the label range used by MPLS to store label in the MPLS FIB. .. index:: [no] segment-routing node-msd (1-16) .. clicmd:: [no] segment-routing node-msd (1-16) Set the Maximum Stack Depth supported by the router. The value depend of the - MPLS dataplane. E.g. for Linux kernel, since version 4.13 it is 32. + MPLS dataplane. E.g. for Linux kernel, since version 4.13 the maximum value + is 32. .. index:: [no] segment-routing prefix [no-php-flag|explicit-null] .. clicmd:: [no] segment-routing prefix