]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests, isisd: add IS-IS SPF unit tests
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 24 Aug 2020 17:46:36 +0000 (14:46 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 26 Aug 2020 23:16:19 +0000 (20:16 -0300)
Now that the IS-IS SPF code is more modular, write some unit tests
for it.

This commit includes a new test program called "test_isis_spf" which
can load any test topology (there are 13 different ones available)
and run SPF on any desired node. In the future this same test program
and topologies will also be used to test reverse SPF and TI-LFA.

The "test_common.c" file contains helper functions used to parse the
topology descriptions from "test_topologies.c" into LSP databases
that can be used as an input to the SPF code.

This commit also introduces the F_ISIS_UNIT_TEST flag which is used
to prevent the IS-IS code from scheduling any event when running
under the context of an unit test.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
20 files changed:
isisd/isis_dynhn.c
isisd/isis_dynhn.h
isisd/isis_misc.c
isisd/isis_route.c
isisd/isis_spf.c
isisd/isis_spf.h
isisd/isisd.c
isisd/isisd.h
tests/.gitignore
tests/isisd/test_common.c [new file with mode: 0644]
tests/isisd/test_common.h [new file with mode: 0644]
tests/isisd/test_fuzz_isis_tlv.c
tests/isisd/test_isis_lspdb.c
tests/isisd/test_isis_spf.c [new file with mode: 0644]
tests/isisd/test_isis_spf.in [new file with mode: 0644]
tests/isisd/test_isis_spf.py [new file with mode: 0644]
tests/isisd/test_isis_spf.refout [new file with mode: 0644]
tests/isisd/test_isis_vertex_queue.c
tests/isisd/test_topologies.c [new file with mode: 0644]
tests/subdir.am

index e34c59be11bb5527505f9bb128d5ffc957ba02fa..244f388c261ded08327a57bf0fdb01f15cab7628 100644 (file)
@@ -49,11 +49,23 @@ void dyn_cache_init(struct isis *isis)
 {
        if (dyn_cache == NULL)
                dyn_cache = list_new();
-       thread_add_timer(master, dyn_cache_cleanup, isis, 120,
-                        &isis->t_dync_clean);
+       if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+               thread_add_timer(master, dyn_cache_cleanup, isis, 120,
+                                &isis->t_dync_clean);
        return;
 }
 
+void dyn_cache_cleanup_all(void)
+{
+       struct listnode *node, *nnode;
+       struct isis_dynhn *dyn;
+
+       for (ALL_LIST_ELEMENTS(dyn_cache, node, nnode, dyn)) {
+               list_delete_node(dyn_cache, node);
+               XFREE(MTYPE_ISIS_DYNHN, dyn);
+       }
+}
+
 static int dyn_cache_cleanup(struct thread *thread)
 {
        struct listnode *node, *nnode;
index 2cfc43fc1770c5bcf1a53573f8175aee2e394397..973fde83076e40e706a05686dec9338c601fe4f1 100644 (file)
@@ -31,6 +31,7 @@ struct isis_dynhn {
 };
 
 void dyn_cache_init(struct isis *isis);
+void dyn_cache_cleanup_all(void);
 void isis_dynhn_insert(const uint8_t *id, const char *hostname, int level);
 void isis_dynhn_remove(const uint8_t *id);
 struct isis_dynhn *dynhn_find_by_id(const uint8_t *id);
index 27425f24a4c2e9aff0e4ce6de928078c9267fc51..6e9cbaf98ead9353316026f43e2135d113ec1828 100644 (file)
@@ -447,7 +447,7 @@ const char *print_sys_hostname(const uint8_t *sysid)
 
        /* For our system ID return our host name */
        isis = isis_lookup_by_sysid(sysid);
-       if (isis)
+       if (isis && !CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
                return cmd_hostname_get();
 
        dyn = dynhn_find_by_id(sysid);
index c12f9fd339d2bc877e02c95c4049cbeb4795cc64..c83a7c04bb40d0141fdc49b0a4798a62cf509c38 100644 (file)
@@ -159,6 +159,17 @@ static void adjinfo2nexthop(int family, struct list *nexthops,
        }
 }
 
+static void isis_route_add_dummy_nexthops(struct isis_route_info *rinfo,
+                                         const uint8_t *sysid)
+{
+       struct isis_nexthop *nh;
+
+       nh = XCALLOC(MTYPE_ISIS_NEXTHOP, sizeof(struct isis_nexthop));
+       memcpy(nh->sysid, sysid, sizeof(nh->sysid));
+       isis_sr_nexthop_reset(&nh->sr);
+       listnode_add(rinfo->nexthops, nh);
+}
+
 static struct isis_route_info *isis_route_info_new(struct prefix *prefix,
                                                   struct prefix_ipv6 *src_p,
                                                   uint32_t cost,
@@ -176,6 +187,15 @@ static struct isis_route_info *isis_route_info_new(struct prefix *prefix,
                struct isis_spf_adj *sadj = vadj->sadj;
                struct isis_adjacency *adj = sadj->adj;
 
+               /*
+                * Create dummy nexthops when running SPF on a testing
+                * environment.
+                */
+               if (CHECK_FLAG(im->options, F_ISIS_UNIT_TEST)) {
+                       isis_route_add_dummy_nexthops(rinfo, sadj->id);
+                       continue;
+               }
+
                /* check for force resync this route */
                if (CHECK_FLAG(adj->circuit->flags,
                               ISIS_CIRCUIT_FLAPPED_AFTER_SPF))
index 72f2beaafee078636cb19c1cd690bee335278b11..19a373791e76c14c58fafe0d7abb1fdf7655fc55 100644 (file)
@@ -1367,6 +1367,9 @@ int _isis_spf_schedule(struct isis_area *area, int level,
        time_t now = monotime(NULL);
        int diff = now - spftree->last_run_monotime;
 
+       if (CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+               return 0;
+
        assert(diff >= 0);
        assert(area->is_type & level);
 
@@ -1500,7 +1503,7 @@ static void isis_print_paths(struct vty *vty, struct isis_vertex_queue *queue,
        }
 }
 
-static void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree)
+void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree)
 {
        const char *tree_id_text = NULL;
 
@@ -1626,7 +1629,7 @@ DEFUN(show_isis_topology, show_isis_topology_cmd,
        return CMD_SUCCESS;
 }
 
-static void isis_print_routes(struct vty *vty, struct isis_spftree *spftree)
+void isis_print_routes(struct vty *vty, struct isis_spftree *spftree)
 {
        struct ttable *tt;
        struct route_node *rn;
index e3c0fbc8b878968340babad3400d2d42a94b1c2b..61a107bea26f37b0da1f00fc8d627929ba288f5c 100644 (file)
@@ -55,6 +55,8 @@ void spftree_area_del(struct isis_area *area);
                           __FILE__, __LINE__)
 int _isis_spf_schedule(struct isis_area *area, int level,
                       const char *func, const char *file, int line);
+void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree);
+void isis_print_routes(struct vty *vty, struct isis_spftree *spftree);
 void isis_spf_init(void);
 void isis_spf_print(struct isis_spftree *spftree, struct vty *vty);
 void isis_run_spf(struct isis_spftree *spftree);
index 1ce3829548f4670a34df32b549a330aed2c0dfc5..aca98bf651946e1a0a7ab85a7b6de041c86b2bd9 100644 (file)
@@ -262,7 +262,8 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
        area->circuit_list = list_new();
        area->adjacency_list = list_new();
        area->area_addrs = list_new();
-       thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
+       if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+               thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
        flags_initialize(&area->flags);
 
        isis_sr_area_init(area);
@@ -418,7 +419,8 @@ void isis_area_destroy(struct isis_area *area)
        spf_backoff_free(area->spf_delay_ietf[0]);
        spf_backoff_free(area->spf_delay_ietf[1]);
 
-       isis_redist_area_finish(area);
+       if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+               isis_redist_area_finish(area);
 
        for (ALL_LIST_ELEMENTS(area->area_addrs, node, nnode, addr)) {
                list_delete_node(area->area_addrs, node);
@@ -1846,60 +1848,61 @@ struct isis_lsp *lsp_for_arg(struct lspdb_head *head, const char *argv,
        return lsp;
 }
 
-static int show_isis_database_common(struct vty *vty, const char *argv,
-                                    int ui_level, struct isis *isis)
+void show_isis_database_lspdb(struct vty *vty, struct isis_area *area,
+                             int level, struct lspdb_head *lspdb,
+                             const char *argv, int ui_level)
+{
+       struct isis_lsp *lsp;
+       int lsp_count;
+
+       if (lspdb_count(lspdb) > 0) {
+               lsp = lsp_for_arg(lspdb, argv, area->isis);
+
+               if (lsp != NULL || argv == NULL) {
+                       vty_out(vty, "IS-IS Level-%d link-state database:\n",
+                               level + 1);
+
+                       /* print the title in all cases */
+                       vty_out(vty,
+                               "LSP ID                  PduLen  SeqNumber   Chksum  Holdtime  ATT/P/OL\n");
+               }
+
+               if (lsp) {
+                       if (ui_level == ISIS_UI_LEVEL_DETAIL)
+                               lsp_print_detail(lsp, vty, area->dynhostname,
+                                                area->isis);
+                       else
+                               lsp_print(lsp, vty, area->dynhostname,
+                                         area->isis);
+               } else if (argv == NULL) {
+                       lsp_count =
+                               lsp_print_all(vty, lspdb, ui_level,
+                                             area->dynhostname, area->isis);
+
+                       vty_out(vty, "    %u LSPs\n\n", lsp_count);
+               }
+       }
+}
+
+static void show_isis_database_common(struct vty *vty, const char *argv,
+                                     int ui_level, struct isis *isis)
 {
        struct listnode *node;
        struct isis_area *area;
-       struct isis_lsp *lsp;
-       int level, lsp_count;
+       int level;
 
        if (isis->area_list->count == 0)
-               return CMD_SUCCESS;
+               return;
 
        for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
                vty_out(vty, "Area %s:\n",
                        area->area_tag ? area->area_tag : "null");
 
-               for (level = 0; level < ISIS_LEVELS; level++) {
-                       if (lspdb_count(&area->lspdb[level]) > 0) {
-                               lsp = NULL;
-                               lsp = lsp_for_arg(&area->lspdb[level], argv,
-                                                 isis);
-
-                               if (lsp != NULL || argv == NULL) {
-                                       vty_out(vty,
-                                               "IS-IS Level-%d link-state database:\n",
-                                               level + 1);
-
-                                       /* print the title in all cases */
-                                       vty_out(vty,
-                                               "LSP ID                  PduLen  SeqNumber   Chksum  Holdtime  ATT/P/OL\n");
-                               }
-
-                               if (lsp) {
-                                       if (ui_level == ISIS_UI_LEVEL_DETAIL)
-                                               lsp_print_detail(
-                                                       lsp, vty,
-                                                       area->dynhostname,
-                                                       isis);
-                                       else
-                                               lsp_print(lsp, vty,
-                                                         area->dynhostname,
-                                                         isis);
-                               } else if (argv == NULL) {
-                                       lsp_count = lsp_print_all(
-                                               vty, &area->lspdb[level],
-                                               ui_level, area->dynhostname,
-                                               isis);
-
-                                       vty_out(vty, "    %u LSPs\n\n",
-                                               lsp_count);
-                               }
-                       }
-               }
+               for (level = 0; level < ISIS_LEVELS; level++)
+                       show_isis_database_lspdb(vty, area, level,
+                                                &area->lspdb[level], argv,
+                                                ui_level);
        }
-       return CMD_SUCCESS;
 }
 /*
  * This function supports following display options:
index 2314cc262c4390908ec30b018bdc16befb551782..0c0a1eed107e19a83e1b376dca5ac1f71e72f1db 100644 (file)
@@ -76,6 +76,7 @@ struct isis_master {
        /* Various OSPF global configuration. */
        uint8_t options;
 };
+#define F_ISIS_UNIT_TEST 0x01
 
 struct isis {
        vrf_id_t vrf_id;
@@ -247,6 +248,9 @@ int isis_area_passwd_cleartext_set(struct isis_area *area, int level,
                                   const char *passwd, uint8_t snp_auth);
 int isis_area_passwd_hmac_md5_set(struct isis_area *area, int level,
                                  const char *passwd, uint8_t snp_auth);
+void show_isis_database_lspdb(struct vty *vty, struct isis_area *area,
+                             int level, struct lspdb_head *lspdb,
+                             const char *argv, int ui_level);
 
 /* YANG paths */
 #define ISIS_INSTANCE  "/frr-isisd:isis/instance"
index 5414cb8cc914a1b510631c0a7ed3dd3b2415a11b..5e809a81e6014063094746854592c3f5b3fb31e3 100644 (file)
@@ -13,6 +13,7 @@
 /isisd/test_fuzz_isis_tlv
 /isisd/test_fuzz_isis_tlv_tests.h
 /isisd/test_isis_lspdb
+/isisd/test_isis_spf
 /isisd/test_isis_vertex_queue
 /lib/cli/test_cli
 /lib/cli/test_cli_clippy.c
diff --git a/tests/isisd/test_common.c b/tests/isisd/test_common.c
new file mode 100644 (file)
index 0000000..536847a
--- /dev/null
@@ -0,0 +1,331 @@
+/*
+ * Copyright (C) 2020  NetDEF, Inc.
+ *                     Renato Westphal
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include "isisd/isisd.h"
+#include "isisd/isis_dynhn.h"
+#include "isisd/isis_mt.h"
+
+#include "test_common.h"
+
+struct thread_master *master;
+struct zebra_privs_t isisd_privs;
+
+int isis_sock_init(struct isis_circuit *circuit)
+{
+       return 0;
+}
+
+const struct isis_test_node *
+test_topology_find_node(const struct isis_topology *topology,
+                       const char *hostname, uint8_t pseudonode_id)
+{
+       for (size_t i = 0; topology->nodes[i].hostname[0]; i++)
+               if (strmatch(hostname, topology->nodes[i].hostname)
+                   && pseudonode_id == topology->nodes[i].pseudonode_id)
+                       return &topology->nodes[i];
+
+       return NULL;
+}
+
+const struct isis_topology *
+test_topology_find(struct isis_topology *test_topologies, uint16_t number)
+{
+       for (size_t i = 0; test_topologies[i].number; i++)
+               if (test_topologies[i].number == number)
+                       return &test_topologies[i];
+
+       return NULL;
+}
+
+static const struct isis_test_node *
+test_find_adjacency(const struct isis_test_node *tnode, const char *hostname)
+{
+       for (size_t i = 0; tnode->adjacencies[i].hostname[0]; i++) {
+               const struct isis_test_adj *tadj;
+
+               tadj = &tnode->adjacencies[i];
+               if (strmatch(hostname, tadj->hostname))
+                       return tnode;
+       }
+
+       return NULL;
+}
+
+static struct isis_lsp *lsp_add(struct lspdb_head *lspdb,
+                               struct isis_area *area, int level,
+                               const uint8_t *sysid, uint8_t pseudonode_id)
+{
+       struct isis_lsp *lsp;
+       uint8_t lspid[ISIS_SYS_ID_LEN + 2];
+
+       memcpy(lspid, sysid, ISIS_SYS_ID_LEN);
+       LSP_PSEUDO_ID(lspid) = pseudonode_id;
+       LSP_FRAGMENT(lspid) = 0;
+
+       lsp = lsp_new(area, lspid, 6000, 1, 0, 0, NULL, level);
+       lsp->tlvs = isis_alloc_tlvs();
+       lspdb_add(lspdb, lsp);
+
+       return lsp;
+}
+
+static void lsp_add_ip_reach(struct isis_lsp *lsp,
+                            const struct isis_test_node *tnode,
+                            const char *prefix_str, uint32_t *next_sid_index)
+{
+       struct prefix prefix;
+       struct sr_prefix_cfg pcfg = {};
+       struct sr_prefix_cfg *pcfg_p = NULL;
+
+       if (str2prefix(prefix_str, &prefix) != 1) {
+               zlog_debug("%s: invalid network: %s", __func__, prefix_str);
+               return;
+       }
+
+       if (CHECK_FLAG(tnode->flags, F_ISIS_TEST_NODE_SR)) {
+               pcfg_p = &pcfg;
+
+               pcfg.sid = *next_sid_index;
+               *next_sid_index = *next_sid_index + 1;
+               pcfg.sid_type = SR_SID_VALUE_TYPE_INDEX;
+               pcfg.last_hop_behavior = SR_LAST_HOP_BEHAVIOR_PHP;
+       }
+
+       if (prefix.family == AF_INET)
+               isis_tlvs_add_extended_ip_reach(lsp->tlvs,
+                                               (struct prefix_ipv4 *)&prefix,
+                                               10, false, pcfg_p);
+       else
+               isis_tlvs_add_ipv6_reach(lsp->tlvs, ISIS_MT_IPV6_UNICAST,
+                                        (struct prefix_ipv6 *)&prefix, 10,
+                                        false, pcfg_p);
+}
+
+static void lsp_add_reach(struct isis_lsp *lsp,
+                         const struct isis_test_node *tnode,
+                         const uint8_t *ne_id, uint8_t pseudonode_id,
+                         uint32_t metric, int family, mpls_label_t *next_label)
+{
+       uint8_t nodeid[ISIS_SYS_ID_LEN + 1];
+       uint16_t mtid;
+       struct isis_ext_subtlvs *ext = NULL;
+
+       memcpy(nodeid, ne_id, ISIS_SYS_ID_LEN);
+       LSP_PSEUDO_ID(nodeid) = pseudonode_id;
+
+       if (CHECK_FLAG(tnode->flags, F_ISIS_TEST_NODE_SR)) {
+               struct isis_adj_sid *adj_sid;
+
+               adj_sid = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*adj_sid));
+               adj_sid->family = family;
+               SET_FLAG(adj_sid->flags, EXT_SUBTLV_LINK_ADJ_SID_VFLG);
+               SET_FLAG(adj_sid->flags, EXT_SUBTLV_LINK_ADJ_SID_LFLG);
+               if (family == AF_INET6)
+                       SET_FLAG(adj_sid->flags, EXT_SUBTLV_LINK_ADJ_SID_FFLG);
+               adj_sid->weight = 0;
+               adj_sid->sid = *next_label;
+               *next_label = *next_label + 1;
+
+               ext = isis_alloc_ext_subtlvs();
+               isis_tlvs_add_adj_sid(ext, adj_sid);
+       }
+
+       mtid = (family == AF_INET) ? ISIS_MT_IPV4_UNICAST
+                                  : ISIS_MT_IPV6_UNICAST;
+
+       isis_tlvs_add_extended_reach(lsp->tlvs, mtid, nodeid, metric, ext);
+}
+
+static void lsp_add_router_capability(struct isis_lsp *lsp,
+                                     const struct isis_test_node *tnode)
+{
+       struct isis_router_cap cap = {};
+
+       if (!tnode->router_id)
+               return;
+
+       if (inet_pton(AF_INET, tnode->router_id, &cap.router_id) != 1) {
+               zlog_debug("%s: invalid router-id: %s", __func__,
+                          tnode->router_id);
+               return;
+       }
+
+       if (CHECK_FLAG(tnode->flags, F_ISIS_TEST_NODE_SR)) {
+               cap.srgb.flags =
+                       ISIS_SUBTLV_SRGB_FLAG_I | ISIS_SUBTLV_SRGB_FLAG_V;
+               cap.srgb.lower_bound = tnode->srgb.lower_bound
+                                              ? tnode->srgb.lower_bound
+                                              : SRGB_DFTL_LOWER_BOUND;
+               cap.srgb.range_size = tnode->srgb.range_size
+                                             ? tnode->srgb.range_size
+                                             : SRGB_DFTL_RANGE_SIZE;
+               cap.algo[0] = SR_ALGORITHM_SPF;
+               cap.algo[1] = SR_ALGORITHM_UNSET;
+       }
+
+       isis_tlvs_set_router_capability(lsp->tlvs, &cap);
+}
+
+static void lsp_add_mt_router_info(struct isis_lsp *lsp,
+                                  const struct isis_test_node *tnode)
+{
+       if (tnode->protocols.ipv4)
+               isis_tlvs_add_mt_router_info(lsp->tlvs, ISIS_MT_IPV4_UNICAST, 0,
+                                            false);
+       if (tnode->protocols.ipv6)
+               isis_tlvs_add_mt_router_info(lsp->tlvs, ISIS_MT_IPV6_UNICAST, 0,
+                                            false);
+}
+
+static void lsp_add_protocols_supported(struct isis_lsp *lsp,
+                                       const struct isis_test_node *tnode)
+{
+       struct nlpids nlpids = {};
+
+       if (!tnode->protocols.ipv4 && !tnode->protocols.ipv6)
+               return;
+
+       if (tnode->protocols.ipv4) {
+               nlpids.nlpids[nlpids.count] = NLPID_IP;
+               nlpids.count++;
+       }
+       if (tnode->protocols.ipv6) {
+               nlpids.nlpids[nlpids.count] = NLPID_IPV6;
+               nlpids.count++;
+       }
+       isis_tlvs_set_protocols_supported(lsp->tlvs, &nlpids);
+}
+
+static int topology_load_node_level(const struct isis_topology *topology,
+                                   const struct isis_test_node *tnode,
+                                   size_t tnode_index, struct isis_area *area,
+                                   struct lspdb_head *lspdb, int level)
+{
+       struct isis_lsp *lsp;
+       uint32_t next_sid_index = (tnode_index + 1) * 10;
+       mpls_label_t next_label = 16;
+
+       lsp = lsp_add(lspdb, area, level, tnode->sysid, tnode->pseudonode_id);
+       lsp_add_mt_router_info(lsp, tnode);
+       lsp_add_protocols_supported(lsp, tnode);
+       lsp_add_router_capability(lsp, tnode);
+
+       /* Add IP Reachability Information. */
+       for (size_t i = 0; tnode->networks[i]; i++) {
+               if (i > MAX_NETWORKS) {
+                       zlog_debug(
+                               "%s: node has too many networks (maximum is %u)",
+                               __func__, MAX_NETWORKS);
+                       return -1;
+               }
+               lsp_add_ip_reach(lsp, tnode, tnode->networks[i],
+                                &next_sid_index);
+       }
+
+       /* Add IS Reachability Information. */
+       for (size_t i = 0; tnode->adjacencies[i].hostname[0]; i++) {
+               const struct isis_test_adj *tadj;
+               const struct isis_test_node *tadj_node;
+
+               if (i > MAX_ADJACENCIES) {
+                       zlog_debug(
+                               "%s: node has too many adjacencies (maximum is %u)",
+                               __func__, MAX_ADJACENCIES);
+                       return -1;
+               }
+
+               tadj = &tnode->adjacencies[i];
+               tadj_node = test_topology_find_node(topology, tadj->hostname,
+                                                   tadj->pseudonode_id);
+               if (!tadj_node) {
+                       zlog_debug(
+                               "%s: node \"%s\" has an adjacency with non-existing node \"%s\"",
+                               __func__, tnode->hostname, tadj->hostname);
+                       return -1;
+               }
+               if (!test_find_adjacency(tadj_node, tnode->hostname)) {
+                       zlog_debug(
+                               "%s: node \"%s\" has an one-way adjacency with node \"%s\"",
+                               __func__, tnode->hostname, tadj->hostname);
+                       return -1;
+               }
+
+               if (tnode->pseudonode_id || tadj_node->pseudonode_id
+                   || (tnode->protocols.ipv4 && tadj_node->protocols.ipv4))
+                       lsp_add_reach(lsp, tnode, tadj_node->sysid,
+                                     tadj_node->pseudonode_id, tadj->metric,
+                                     AF_INET, &next_label);
+               if (tadj_node->pseudonode_id
+                   || (tnode->protocols.ipv6 && tadj_node->protocols.ipv6))
+                       lsp_add_reach(lsp, tnode, tadj_node->sysid,
+                                     tadj_node->pseudonode_id, tadj->metric,
+                                     AF_INET6, &next_label);
+       }
+
+       return 0;
+}
+
+static int topology_load_node(const struct isis_topology *topology,
+                             const struct isis_test_node *tnode,
+                             size_t tnode_index, struct isis_area *area,
+                             struct lspdb_head lspdb[])
+{
+       int ret;
+
+       isis_dynhn_insert(tnode->sysid, tnode->hostname, tnode->level);
+
+       for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
+               if ((tnode->level & level) == 0)
+                       continue;
+
+               ret = topology_load_node_level(topology, tnode, tnode_index,
+                                              area, &lspdb[level - 1], level);
+               if (ret != 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+int test_topology_load(const struct isis_topology *topology,
+                      struct isis_area *area, struct lspdb_head lspdb[])
+{
+       for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++)
+               lsp_db_init(&lspdb[level - 1]);
+
+       for (size_t i = 0; topology->nodes[i].hostname[0]; i++) {
+               const struct isis_test_node *tnode = &topology->nodes[i];
+               int ret;
+
+               if (i > MAX_NODES) {
+                       zlog_debug(
+                               "%s: topology has too many nodes (maximum is %u)",
+                               __func__, MAX_NODES);
+                       return -1;
+               }
+
+               ret = topology_load_node(topology, tnode, i, area, lspdb);
+               if (ret != 0)
+                       return ret;
+       }
+
+       return 0;
+}
diff --git a/tests/isisd/test_common.h b/tests/isisd/test_common.h
new file mode 100644 (file)
index 0000000..6fd0d38
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2020  NetDEF, Inc.
+ *                     Renato Westphal
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _COMMON_ISIS_H
+#define _COMMON_ISIS_H
+
+#include "isisd/isisd.h"
+#include "isisd/isis_spf.h"
+#include "isisd/isis_spf_private.h"
+
+#define MAX_HOSTNAME 16
+#define MAX_NETWORKS 8
+#define MAX_ADJACENCIES 8
+#define MAX_NODES 12
+
+#define SRGB_DFTL_LOWER_BOUND 16000
+#define SRGB_DFTL_RANGE_SIZE 8000
+
+struct isis_test_adj {
+       char hostname[MAX_HOSTNAME];
+       uint8_t pseudonode_id;
+       uint32_t metric;
+};
+
+struct isis_test_node {
+       char hostname[MAX_HOSTNAME];
+       uint8_t sysid[ISIS_SYS_ID_LEN];
+       uint8_t pseudonode_id;
+       int level;
+       struct {
+               bool ipv4;
+               bool ipv6;
+       } protocols;
+       const char *router_id;
+       struct {
+               uint32_t lower_bound;
+               uint32_t range_size;
+       } srgb;
+       const char *networks[MAX_NETWORKS + 1];
+       struct isis_test_adj adjacencies[MAX_ADJACENCIES + 1];
+       uint8_t flags;
+};
+#define F_ISIS_TEST_NODE_SR 0x01
+
+struct isis_topology {
+       uint16_t number;
+       struct isis_test_node nodes[MAX_NODES + 1];
+};
+
+/* Prototypes. */
+extern int isis_sock_init(struct isis_circuit *circuit);
+extern const struct isis_test_node *
+test_topology_find_node(const struct isis_topology *topology,
+                       const char *hostname, uint8_t pseudonode_id);
+extern const struct isis_topology *
+test_topology_find(struct isis_topology *test_topologies, uint16_t number);
+extern int test_topology_load(const struct isis_topology *topology,
+                             struct isis_area *area,
+                             struct lspdb_head lspdb[]);
+
+/* Global variables. */
+extern struct thread_master *master;
+extern struct zebra_privs_t isisd_privs;
+extern struct isis_topology test_topologies[];
+
+#endif /* _COMMON_ISIS_H */
index 917ea66f133aa6e0bba41b14c9ca48ad3d1f9e4c..97aade6578486b79f2fd66b587fe3b8de707a871 100644 (file)
 #include "isisd/isis_circuit.h"
 #include "isisd/isis_tlvs.h"
 
-#define TEST_STREAM_SIZE 1500
-
-struct thread_master *master;
-int isis_sock_init(struct isis_circuit *circuit);
-int isis_sock_init(struct isis_circuit *circuit)
-{
-       return 0;
-}
+#include "test_common.h"
 
-struct zebra_privs_t isisd_privs;
+#define TEST_STREAM_SIZE 1500
 
 static bool atexit_registered;
 
index 6a571eaa847a987da2cc481901a357999c57dd64..244922ea4ed8793928d5a3b590ef98ac41cff365 100644 (file)
@@ -2,15 +2,7 @@
 
 #include "isisd/isis_lsp.c"
 
-struct thread_master *master;
-
-int isis_sock_init(struct isis_circuit *circuit);
-int isis_sock_init(struct isis_circuit *circuit)
-{
-       return 0;
-}
-
-struct zebra_privs_t isisd_privs;
+#include "test_common.h"
 
 static void test_lsp_build_list_nonzero_ht(void)
 {
diff --git a/tests/isisd/test_isis_spf.c b/tests/isisd/test_isis_spf.c
new file mode 100644 (file)
index 0000000..4e1d7b0
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2020  NetDEF, Inc.
+ *                     Renato Westphal
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include <lib/version.h>
+#include "getopt.h"
+#include "thread.h"
+#include "vty.h"
+#include "command.h"
+#include "log.h"
+#include "vrf.h"
+#include "yang.h"
+
+#include "isisd/isisd.h"
+#include "isisd/isis_dynhn.h"
+#include "isisd/isis_misc.h"
+#include "isisd/isis_spf.h"
+#include "isisd/isis_spf_private.h"
+
+#include "test_common.h"
+
+enum test_type {
+       TEST_SPF = 1,
+};
+
+#define F_DISPLAY_LSPDB 0x01
+#define F_IPV4_ONLY 0x02
+#define F_IPV6_ONLY 0x04
+#define F_LEVEL1_ONLY 0x08
+#define F_LEVEL2_ONLY 0x10
+
+static struct isis *isis;
+
+static void test_run_spf(struct vty *vty, const struct isis_topology *topology,
+                        const struct isis_test_node *root,
+                        struct isis_area *area, struct lspdb_head *lspdb,
+                        int level, int tree)
+{
+       struct isis_spftree *spftree;
+
+       /* Run SPF. */
+       spftree = isis_spftree_new(area, lspdb, root->sysid, level, tree,
+                                  F_SPFTREE_NO_ADJACENCIES);
+       isis_run_spf(spftree);
+
+       /* Print the SPT and the corresponding routing table. */
+       isis_print_spftree(vty, spftree);
+       isis_print_routes(vty, spftree);
+
+       /* Cleanup SPF tree. */
+       isis_spftree_del(spftree);
+}
+
+static int test_run(struct vty *vty, const struct isis_topology *topology,
+                   const struct isis_test_node *root, enum test_type test_type,
+                   uint8_t flags)
+{
+       struct isis_area *area;
+
+       /* Init topology. */
+       memcpy(isis->sysid, root->sysid, sizeof(isis->sysid));
+       area = isis_area_create("1", NULL);
+       area->is_type = IS_LEVEL_1_AND_2;
+       area->srdb.enabled = true;
+       if (test_topology_load(topology, area, area->lspdb) != 0) {
+               vty_out(vty, "%% Failed to load topology\n");
+               return CMD_WARNING;
+       }
+
+       for (int level = IS_LEVEL_1; level <= IS_LEVEL_2; level++) {
+               if (level == IS_LEVEL_1 && CHECK_FLAG(flags, F_LEVEL2_ONLY))
+                       continue;
+               if (level == IS_LEVEL_2 && CHECK_FLAG(flags, F_LEVEL1_ONLY))
+                       continue;
+               if ((root->level & level) == 0)
+                       continue;
+
+               /* Print the LDPDB. */
+               if (CHECK_FLAG(flags, F_DISPLAY_LSPDB))
+                       show_isis_database_lspdb(vty, area, level - 1,
+                                                &area->lspdb[level - 1], NULL,
+                                                ISIS_UI_LEVEL_DETAIL);
+
+               for (int tree = SPFTREE_IPV4; tree <= SPFTREE_IPV6; tree++) {
+                       if (tree == SPFTREE_IPV4
+                           && CHECK_FLAG(flags, F_IPV6_ONLY))
+                               continue;
+                       if (tree == SPFTREE_IPV6
+                           && CHECK_FLAG(flags, F_IPV4_ONLY))
+                               continue;
+
+                       switch (test_type) {
+                       case TEST_SPF:
+                               test_run_spf(vty, topology, root, area,
+                                            &area->lspdb[level - 1], level,
+                                            tree);
+                               break;
+                       }
+               }
+       }
+
+       /* Cleanup IS-IS area. */
+       isis_area_destroy(area);
+
+       /* Cleanup hostnames. */
+       dyn_cache_cleanup_all();
+
+       return CMD_SUCCESS;
+}
+
+DEFUN(test_isis, test_isis_cmd,
+      "test isis topology (1-13) root HOSTNAME spf\
+        [display-lspdb] [<ipv4-only|ipv6-only>] [<level-1-only|level-2-only>]",
+      "Test command\n"
+      "IS-IS routing protocol\n"
+      "Test topology\n"
+      "Test topology number\n"
+      "SPF root\n"
+      "SPF root hostname\n"
+      "Normal Shortest Path First\n"
+      "Display the LSPDB\n"
+      "Do IPv4 processing only\n"
+      "Do IPv6 processing only\n"
+      "Skip L2 LSPs\n"
+      "Skip L1 LSPs\n")
+{
+       uint16_t topology_number;
+       const struct isis_topology *topology;
+       const struct isis_test_node *root;
+       uint8_t flags = 0;
+       int idx = 0;
+
+       /* Load topology. */
+       argv_find(argv, argc, "topology", &idx);
+       topology_number = atoi(argv[idx + 1]->arg);
+       topology = test_topology_find(test_topologies, topology_number);
+       if (!topology) {
+               vty_out(vty, "%% Topology \"%s\" not found\n",
+                       argv[idx + 1]->arg);
+               return CMD_WARNING;
+       }
+
+       /* Find root node. */
+       argv_find(argv, argc, "root", &idx);
+       root = test_topology_find_node(topology, argv[idx + 1]->arg, 0);
+       if (!root) {
+               vty_out(vty, "%% Node \"%s\" not found\n", argv[idx + 1]->arg);
+               return CMD_WARNING;
+       }
+
+       /* Parse control flags. */
+       if (argv_find(argv, argc, "display-lspdb", &idx))
+               SET_FLAG(flags, F_DISPLAY_LSPDB);
+       if (argv_find(argv, argc, "ipv4-only", &idx))
+               SET_FLAG(flags, F_IPV4_ONLY);
+       else if (argv_find(argv, argc, "ipv6-only", &idx))
+               SET_FLAG(flags, F_IPV6_ONLY);
+       if (argv_find(argv, argc, "level-1-only", &idx))
+               SET_FLAG(flags, F_LEVEL1_ONLY);
+       else if (argv_find(argv, argc, "level-2-only", &idx))
+               SET_FLAG(flags, F_LEVEL2_ONLY);
+
+       return test_run(vty, topology, root, TEST_SPF, flags);
+}
+
+static void vty_do_exit(int isexit)
+{
+       printf("\nend.\n");
+
+       isis_finish(isis);
+       cmd_terminate();
+       vty_terminate();
+       yang_terminate();
+       thread_master_free(master);
+
+       log_memstats(stderr, "test-isis-spf");
+       if (!isexit)
+               exit(0);
+}
+
+struct option longopts[] = {{"help", no_argument, NULL, 'h'},
+                           {"debug", no_argument, NULL, 'd'},
+                           {0}};
+
+/* Help information display. */
+static void usage(char *progname, int status)
+{
+       if (status != 0)
+               fprintf(stderr, "Try `%s --help' for more information.\n",
+                       progname);
+       else {
+               printf("Usage : %s [OPTION...]\n\
+isisd SPF test program.\n\n\
+-u, --debug        Enable debugging\n\
+-h, --help         Display this help and exit\n\
+\n\
+Report bugs to %s\n",
+                      progname, FRR_BUG_ADDRESS);
+       }
+       exit(status);
+}
+
+int main(int argc, char **argv)
+{
+       char *p;
+       char *progname;
+       struct thread thread;
+       bool debug = false;
+
+       /* Set umask before anything for security */
+       umask(0027);
+
+       /* get program name */
+       progname = ((p = strrchr(argv[0], '/')) ? ++p : argv[0]);
+
+       while (1) {
+               int opt;
+
+               opt = getopt_long(argc, argv, "hd", longopts, 0);
+
+               if (opt == EOF)
+                       break;
+
+               switch (opt) {
+               case 0:
+                       break;
+               case 'd':
+                       debug = true;
+                       break;
+               case 'h':
+                       usage(progname, 0);
+                       break;
+               default:
+                       usage(progname, 1);
+                       break;
+               }
+       }
+
+       /* master init. */
+       master = thread_master_create(NULL);
+       isis_master_init(master);
+
+       /* Library inits. */
+       cmd_init(1);
+       cmd_hostname_set("test");
+       vty_init(master, false);
+       yang_init(true);
+       if (debug)
+               zlog_aux_init("NONE: ", LOG_DEBUG);
+       else
+               zlog_aux_init("NONE: ", ZLOG_DISABLED);
+
+       /* IS-IS inits. */
+       yang_module_load("frr-isisd");
+       isis = isis_new(VRF_DEFAULT);
+       listnode_add(im->isis, isis);
+       SET_FLAG(im->options, F_ISIS_UNIT_TEST);
+       debug_spf_events |= DEBUG_SPF_EVENTS;
+       debug_events |= DEBUG_EVENTS;
+       debug_rte_events |= DEBUG_RTE_EVENTS;
+
+       /* Install test command. */
+       install_element(VIEW_NODE, &test_isis_cmd);
+
+       /* Read input from .in file. */
+       vty_stdio(vty_do_exit);
+
+       /* Fetch next active thread. */
+       while (thread_fetch(master, &thread))
+               thread_call(&thread);
+
+       /* Not reached. */
+       exit(0);
+}
diff --git a/tests/isisd/test_isis_spf.in b/tests/isisd/test_isis_spf.in
new file mode 100644 (file)
index 0000000..28d3c59
--- /dev/null
@@ -0,0 +1,13 @@
+test isis topology 1 root rt1 spf
+test isis topology 2 root rt1 spf
+test isis topology 3 root rt1 spf ipv4-only
+test isis topology 4 root rt1 spf ipv4-only
+test isis topology 5 root rt1 spf ipv4-only
+test isis topology 6 root rt1 spf ipv4-only
+test isis topology 7 root rt1 spf ipv4-only
+test isis topology 8 root rt1 spf ipv4-only
+test isis topology 9 root rt1 spf
+test isis topology 10 root rt1 spf
+test isis topology 11 root rt1 spf
+test isis topology 12 root rt1 spf ipv4-only
+test isis topology 13 root rt1 spf ipv4-only
diff --git a/tests/isisd/test_isis_spf.py b/tests/isisd/test_isis_spf.py
new file mode 100644 (file)
index 0000000..21e7ef6
--- /dev/null
@@ -0,0 +1,4 @@
+import frrtest
+
+class TestIsisSPF(frrtest.TestRefOut):
+    program = './test_isis_spf'
diff --git a/tests/isisd/test_isis_spf.refout b/tests/isisd/test_isis_spf.refout
new file mode 100644 (file)
index 0000000..ee82926
--- /dev/null
@@ -0,0 +1,619 @@
+test# test isis topology 1 root rt1 spf\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         rt5(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+10.0.255.5/32        IP TE        30     rt3                  -         rt5(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+ 10.0.255.5/32  30      -          rt3      -         \r
+ 10.0.255.6/32  40      -          rt2      -         \r
+                        -          rt3      -         \r
+\r
+IS-IS paths to level-1 routers that speak IPv6\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+2001:db8::1/128      IP6 internal 0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+2001:db8::2/128      IP6 internal 20     rt2                  -         rt2(4)\r
+2001:db8::3/128      IP6 internal 20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         rt5(4)\r
+2001:db8::4/128      IP6 internal 30     rt2                  -         rt4(4)\r
+2001:db8::5/128      IP6 internal 30     rt3                  -         rt5(4)\r
+2001:db8::6/128      IP6 internal 40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+\r
+IS-IS L1 IPv6 routing table:\r
+\r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::2/128  20      -          rt2      -         \r
+ 2001:db8::3/128  20      -          rt3      -         \r
+ 2001:db8::4/128  30      -          rt2      -         \r
+ 2001:db8::5/128  30      -          rt3      -         \r
+ 2001:db8::6/128  40      -          rt2      -         \r
+                          -          rt3      -         \r
+\r
+test# test isis topology 2 root rt1 spf\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt4                  TE-IS        10     rt4                  -         rt1(4)\r
+rt5                  TE-IS        10     rt5                  -         rt1(4)\r
+rt2                  TE-IS        15     rt2                  -         rt1(4)\r
+rt1                                                                   \r
+rt6                  TE-IS        20     rt4                  -         rt4(4)\r
+                                         rt5                  -         rt5(4)\r
+10.0.255.4/32        IP TE        20     rt4                  -         rt4(4)\r
+10.0.255.5/32        IP TE        20     rt5                  -         rt5(4)\r
+10.0.255.2/32        IP TE        25     rt2                  -         rt2(4)\r
+rt3                  TE-IS        30     rt3                  -         rt1(4)\r
+10.0.255.6/32        IP TE        30     rt4                  -         rt6(4)\r
+                                         rt5                  -         \r
+10.0.255.3/32        IP TE        40     rt3                  -         rt3(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  25      -          rt2      -         \r
+ 10.0.255.3/32  40      -          rt3      -         \r
+ 10.0.255.4/32  20      -          rt4      -         \r
+ 10.0.255.5/32  20      -          rt5      -         \r
+ 10.0.255.6/32  30      -          rt4      -         \r
+                        -          rt5      -         \r
+\r
+IS-IS paths to level-1 routers that speak IPv6\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+2001:db8::1/128      IP6 internal 0                                     rt1(4)\r
+rt4                  TE-IS        10     rt4                  -         rt1(4)\r
+rt5                  TE-IS        10     rt5                  -         rt1(4)\r
+rt2                  TE-IS        15     rt2                  -         rt1(4)\r
+rt1                                                                   \r
+rt6                  TE-IS        20     rt4                  -         rt4(4)\r
+                                         rt5                  -         rt5(4)\r
+2001:db8::4/128      IP6 internal 20     rt4                  -         rt4(4)\r
+2001:db8::5/128      IP6 internal 20     rt5                  -         rt5(4)\r
+2001:db8::2/128      IP6 internal 25     rt2                  -         rt2(4)\r
+rt3                  TE-IS        30     rt3                  -         rt1(4)\r
+2001:db8::6/128      IP6 internal 30     rt4                  -         rt6(4)\r
+                                         rt5                  -         \r
+2001:db8::3/128      IP6 internal 40     rt3                  -         rt3(4)\r
+\r
+IS-IS L1 IPv6 routing table:\r
+\r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::2/128  25      -          rt2      -         \r
+ 2001:db8::3/128  40      -          rt3      -         \r
+ 2001:db8::4/128  20      -          rt4      -         \r
+ 2001:db8::5/128  20      -          rt5      -         \r
+ 2001:db8::6/128  30      -          rt4      -         \r
+                          -          rt5      -         \r
+\r
+test# test isis topology 3 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt5                  TE-IS        30     rt2                  -         rt4(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+10.0.255.5/32        IP TE        40     rt2                  -         rt5(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+ 10.0.255.5/32  40      -          rt2      -         \r
+ 10.0.255.6/32  40      -          rt2      -         \r
+\r
+test# test isis topology 4 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+rt7                  TE-IS        30     rt3                  -         rt5(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+10.0.255.5/32        IP TE        30     rt3                  -         rt5(4)\r
+rt8                  TE-IS        40     rt2                  -         rt6(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+10.0.255.7/32        IP TE        40     rt3                  -         rt7(4)\r
+10.0.255.8/32        IP TE        50     rt2                  -         rt8(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+ 10.0.255.5/32  30      -          rt3      -         \r
+ 10.0.255.6/32  40      -          rt2      -         \r
+ 10.0.255.7/32  40      -          rt3      -         \r
+ 10.0.255.8/32  50      -          rt2      -         \r
+\r
+test# test isis topology 5 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+rt7                  TE-IS        30     rt3                  -         rt5(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+10.0.255.5/32        IP TE        30     rt3                  -         rt5(4)\r
+rt8                  TE-IS        40     rt2                  -         rt6(4)\r
+                                         rt3                  -         rt7(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+10.0.255.7/32        IP TE        40     rt3                  -         rt7(4)\r
+10.0.255.8/32        IP TE        50     rt2                  -         rt8(4)\r
+                                         rt3                  -         \r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+ 10.0.255.5/32  30      -          rt3      -         \r
+ 10.0.255.6/32  40      -          rt2      -         \r
+ 10.0.255.7/32  40      -          rt3      -         \r
+ 10.0.255.8/32  50      -          rt2      -         \r
+                        -          rt3      -         \r
+\r
+test# test isis topology 6 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+                                         rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         \r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         \r
+rt5                  TE-IS        40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+rt8                  TE-IS        40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+rt7                  TE-IS        50     rt2                  -         rt5(4)\r
+                                         rt3                  -         rt8(4)\r
+10.0.255.5/32        IP TE        50     rt2                  -         rt5(4)\r
+                                         rt3                  -         \r
+10.0.255.8/32        IP TE        50     rt2                  -         rt8(4)\r
+                                         rt3                  -         \r
+10.0.255.7/32        IP TE        60     rt2                  -         rt7(4)\r
+                                         rt3                  -         \r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+                        -          rt3      -         \r
+ 10.0.255.5/32  50      -          rt2      -         \r
+                        -          rt3      -         \r
+ 10.0.255.6/32  40      -          rt2      -         \r
+                        -          rt3      -         \r
+ 10.0.255.7/32  60      -          rt2      -         \r
+                        -          rt3      -         \r
+ 10.0.255.8/32  50      -          rt2      -         \r
+                        -          rt3      -         \r
+\r
+test# test isis topology 7 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt4                  TE-IS        10     rt4                  -         rt1(4)\r
+rt5                  TE-IS        20     rt4                  -         rt4(4)\r
+rt7                  TE-IS        20     rt4                  -         rt4(4)\r
+10.0.255.4/32        IP TE        20     rt4                  -         rt4(4)\r
+rt2                  TE-IS        30     rt4                  -         rt5(4)\r
+rt6                  TE-IS        30     rt4                  -         rt5(4)\r
+rt8                  TE-IS        30     rt4                  -         rt5(4)\r
+                                                                        rt7(4)\r
+10.0.255.5/32        IP TE        30     rt4                  -         rt5(4)\r
+10.0.255.7/32        IP TE        30     rt4                  -         rt7(4)\r
+rt10                 TE-IS        40     rt4                  -         rt7(4)\r
+rt3                  TE-IS        40     rt4                  -         rt2(4)\r
+                                                                        rt6(4)\r
+rt9                  TE-IS        40     rt4                  -         rt8(4)\r
+rt11                 TE-IS        40     rt4                  -         rt8(4)\r
+10.0.255.2/32        IP TE        40     rt4                  -         rt2(4)\r
+10.0.255.6/32        IP TE        40     rt4                  -         rt6(4)\r
+10.0.255.8/32        IP TE        40     rt4                  -         rt8(4)\r
+rt12                 TE-IS        50     rt4                  -         rt9(4)\r
+                                                                        rt11(4)\r
+10.0.255.10/32       IP TE        50     rt4                  -         rt10(4)\r
+10.0.255.3/32        IP TE        50     rt4                  -         rt3(4)\r
+10.0.255.9/32        IP TE        50     rt4                  -         rt9(4)\r
+10.0.255.11/32       IP TE        50     rt4                  -         rt11(4)\r
+10.0.255.12/32       IP TE        60     rt4                  -         rt12(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix          Metric  Interface  Nexthop  Label(s)  \r
+ ------------------------------------------------------\r
+ 10.0.255.2/32   40      -          rt4      -         \r
+ 10.0.255.3/32   50      -          rt4      -         \r
+ 10.0.255.4/32   20      -          rt4      -         \r
+ 10.0.255.5/32   30      -          rt4      -         \r
+ 10.0.255.6/32   40      -          rt4      -         \r
+ 10.0.255.7/32   30      -          rt4      -         \r
+ 10.0.255.8/32   40      -          rt4      -         \r
+ 10.0.255.9/32   50      -          rt4      -         \r
+ 10.0.255.10/32  50      -          rt4      -         \r
+ 10.0.255.11/32  50      -          rt4      -         \r
+ 10.0.255.12/32  60      -          rt4      -         \r
+\r
+test# test isis topology 8 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt4                  TE-IS        10     rt4                  -         rt1(4)\r
+rt3                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt2                  -         rt2(4)\r
+rt7                  TE-IS        20     rt4                  -         rt4(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.4/32        IP TE        20     rt4                  -         rt4(4)\r
+rt6                  TE-IS        30     rt2                  -         rt3(4)\r
+                                                                        rt5(4)\r
+rt8                  TE-IS        30     rt2                  -         rt5(4)\r
+rt10                 TE-IS        30     rt4                  -         rt7(4)\r
+10.0.255.3/32        IP TE        30     rt2                  -         rt3(4)\r
+10.0.255.5/32        IP TE        30     rt2                  -         rt5(4)\r
+10.0.255.7/32        IP TE        30     rt4                  -         rt7(4)\r
+rt9                  TE-IS        40     rt2                  -         rt8(4)\r
+rt11                 TE-IS        40     rt2                  -         rt8(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+10.0.255.8/32        IP TE        40     rt2                  -         rt8(4)\r
+10.0.255.10/32       IP TE        40     rt4                  -         rt10(4)\r
+rt12                 TE-IS        50     rt2                  -         rt9(4)\r
+                                                                        rt11(4)\r
+10.0.255.9/32        IP TE        50     rt2                  -         rt9(4)\r
+10.0.255.11/32       IP TE        50     rt2                  -         rt11(4)\r
+10.0.255.12/32       IP TE        60     rt2                  -         rt12(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix          Metric  Interface  Nexthop  Label(s)  \r
+ ------------------------------------------------------\r
+ 10.0.255.2/32   20      -          rt2      -         \r
+ 10.0.255.3/32   30      -          rt2      -         \r
+ 10.0.255.4/32   20      -          rt4      -         \r
+ 10.0.255.5/32   30      -          rt2      -         \r
+ 10.0.255.6/32   40      -          rt2      -         \r
+ 10.0.255.7/32   30      -          rt4      -         \r
+ 10.0.255.8/32   40      -          rt2      -         \r
+ 10.0.255.9/32   50      -          rt2      -         \r
+ 10.0.255.10/32  40      -          rt4      -         \r
+ 10.0.255.11/32  50      -          rt2      -         \r
+ 10.0.255.12/32  60      -          rt2      -         \r
+\r
+test# test isis topology 9 root rt1 spf\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt5                  TE-IS        30     rt2                  -         rt4(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+rt9                  TE-IS        40     rt2                  -         rt5(4)\r
+10.0.255.5/32        IP TE        40     rt2                  -         rt5(4)\r
+rt6                  TE-IS        50     rt2                  -         rt4(4)\r
+                                                                        rt9(4)\r
+rt7                  TE-IS        50     rt2                  -         rt4(4)\r
+                                                                        rt9(4)\r
+rt8                  TE-IS        50     rt2                  -         rt4(4)\r
+                                                                        rt9(4)\r
+10.0.255.9/32        IP TE        50     rt2                  -         rt9(4)\r
+10.0.255.6/32        IP TE        60     rt2                  -         rt6(4)\r
+10.0.255.7/32        IP TE        60     rt2                  -         rt7(4)\r
+10.0.255.8/32        IP TE        60     rt2                  -         rt8(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+ 10.0.255.5/32  40      -          rt2      -         \r
+ 10.0.255.6/32  60      -          rt2      -         \r
+ 10.0.255.7/32  60      -          rt2      -         \r
+ 10.0.255.8/32  60      -          rt2      -         \r
+ 10.0.255.9/32  50      -          rt2      -         \r
+\r
+IS-IS paths to level-1 routers that speak IPv6\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+2001:db8::1/128      IP6 internal 0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+2001:db8::2/128      IP6 internal 20     rt2                  -         rt2(4)\r
+2001:db8::3/128      IP6 internal 20     rt3                  -         rt3(4)\r
+rt5                  TE-IS        30     rt2                  -         rt4(4)\r
+2001:db8::4/128      IP6 internal 30     rt2                  -         rt4(4)\r
+rt9                  TE-IS        40     rt2                  -         rt5(4)\r
+2001:db8::5/128      IP6 internal 40     rt2                  -         rt5(4)\r
+rt6                  TE-IS        50     rt2                  -         rt4(4)\r
+                                                                        rt9(4)\r
+rt7                  TE-IS        50     rt2                  -         rt4(4)\r
+                                                                        rt9(4)\r
+rt8                  TE-IS        50     rt2                  -         rt4(4)\r
+                                                                        rt9(4)\r
+2001:db8::9/128      IP6 internal 50     rt2                  -         rt9(4)\r
+2001:db8::6/128      IP6 internal 60     rt2                  -         rt6(4)\r
+2001:db8::7/128      IP6 internal 60     rt2                  -         rt7(4)\r
+2001:db8::8/128      IP6 internal 60     rt2                  -         rt8(4)\r
+\r
+IS-IS L1 IPv6 routing table:\r
+\r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::2/128  20      -          rt2      -         \r
+ 2001:db8::3/128  20      -          rt3      -         \r
+ 2001:db8::4/128  30      -          rt2      -         \r
+ 2001:db8::5/128  40      -          rt2      -         \r
+ 2001:db8::6/128  60      -          rt2      -         \r
+ 2001:db8::7/128  60      -          rt2      -         \r
+ 2001:db8::8/128  60      -          rt2      -         \r
+ 2001:db8::9/128  50      -          rt2      -         \r
+\r
+test# test isis topology 10 root rt1 spf\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        20     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt4                  -         rt1(4)\r
+rt5                  TE-IS        20     rt2                  -         rt2(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+rt6                  TE-IS        30     rt3                  -         rt3(4)\r
+rt7                  TE-IS        30     rt4                  -         rt4(4)\r
+rt8                  TE-IS        30     rt2                  -         rt5(4)\r
+10.0.255.3/32        IP TE        30     rt3                  -         rt3(4)\r
+10.0.255.4/32        IP TE        30     rt4                  -         rt4(4)\r
+10.0.255.5/32        IP TE        30     rt2                  -         rt5(4)\r
+10.0.255.6/32        IP TE        40     rt3                  -         rt6(4)\r
+10.0.255.7/32        IP TE        40     rt4                  -         rt7(4)\r
+10.0.255.8/32        IP TE        40     rt2                  -         rt8(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  30      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt4      -         \r
+ 10.0.255.5/32  30      -          rt2      -         \r
+ 10.0.255.6/32  40      -          rt3      -         \r
+ 10.0.255.7/32  40      -          rt4      -         \r
+ 10.0.255.8/32  40      -          rt2      -         \r
+\r
+IS-IS paths to level-1 routers that speak IPv6\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+2001:db8::1/128      IP6 internal 0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        20     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt4                  -         rt1(4)\r
+rt5                  TE-IS        20     rt2                  -         rt2(4)\r
+2001:db8::2/128      IP6 internal 20     rt2                  -         rt2(4)\r
+rt6                  TE-IS        30     rt3                  -         rt3(4)\r
+rt7                  TE-IS        30     rt4                  -         rt4(4)\r
+rt8                  TE-IS        30     rt2                  -         rt5(4)\r
+2001:db8::3/128      IP6 internal 30     rt3                  -         rt3(4)\r
+2001:db8::4/128      IP6 internal 30     rt4                  -         rt4(4)\r
+2001:db8::5/128      IP6 internal 30     rt2                  -         rt5(4)\r
+2001:db8::6/128      IP6 internal 40     rt3                  -         rt6(4)\r
+2001:db8::7/128      IP6 internal 40     rt4                  -         rt7(4)\r
+2001:db8::8/128      IP6 internal 40     rt2                  -         rt8(4)\r
+\r
+IS-IS L1 IPv6 routing table:\r
+\r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::2/128  20      -          rt2      -         \r
+ 2001:db8::3/128  30      -          rt3      -         \r
+ 2001:db8::4/128  30      -          rt4      -         \r
+ 2001:db8::5/128  30      -          rt2      -         \r
+ 2001:db8::6/128  40      -          rt3      -         \r
+ 2001:db8::7/128  40      -          rt4      -         \r
+ 2001:db8::8/128  40      -          rt2      -         \r
+\r
+test# test isis topology 11 root rt1 spf\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt2                  pseudo_TE-IS 20     rt3                  -         rt3(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         rt5(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+10.0.255.5/32        IP TE        30     rt3                  -         rt5(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+ 10.0.255.5/32  30      -          rt3      -         \r
+ 10.0.255.6/32  40      -          rt2      -         \r
+                        -          rt3      -         \r
+\r
+IS-IS paths to level-1 routers that speak IPv6\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+2001:db8::1/128      IP6 internal 0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt2                  pseudo_TE-IS 20     rt3                  -         rt3(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+2001:db8::2/128      IP6 internal 20     rt2                  -         rt2(4)\r
+2001:db8::3/128      IP6 internal 20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         rt5(4)\r
+2001:db8::4/128      IP6 internal 30     rt2                  -         rt4(4)\r
+2001:db8::5/128      IP6 internal 30     rt3                  -         rt5(4)\r
+2001:db8::6/128      IP6 internal 40     rt2                  -         rt6(4)\r
+                                         rt3                  -         \r
+\r
+IS-IS L1 IPv6 routing table:\r
+\r
+ Prefix           Metric  Interface  Nexthop  Label(s)  \r
+ -------------------------------------------------------\r
+ 2001:db8::2/128  20      -          rt2      -         \r
+ 2001:db8::3/128  20      -          rt3      -         \r
+ 2001:db8::4/128  30      -          rt2      -         \r
+ 2001:db8::5/128  30      -          rt3      -         \r
+ 2001:db8::6/128  40      -          rt2      -         \r
+                          -          rt3      -         \r
+\r
+test# test isis topology 12 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        30     rt2                  -         rt4(4)\r
+rt7                  TE-IS        30     rt3                  -         rt5(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+10.0.255.5/32        IP TE        30     rt3                  -         rt5(4)\r
+rt8                  TE-IS        40     rt2                  -         rt6(4)\r
+rt9                  TE-IS        40     rt3                  -         rt7(4)\r
+10.0.255.6/32        IP TE        40     rt2                  -         rt6(4)\r
+10.0.255.7/32        IP TE        40     rt3                  -         rt7(4)\r
+rt10                 TE-IS        50     rt2                  -         rt8(4)\r
+10.0.255.8/32        IP TE        50     rt2                  -         rt8(4)\r
+10.0.255.9/32        IP TE        50     rt3                  -         rt9(4)\r
+10.0.255.10/32       IP TE        60     rt2                  -         rt10(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix          Metric  Interface  Nexthop  Label(s)  \r
+ ------------------------------------------------------\r
+ 10.0.255.2/32   20      -          rt2      -         \r
+ 10.0.255.3/32   20      -          rt3      -         \r
+ 10.0.255.4/32   30      -          rt2      -         \r
+ 10.0.255.5/32   30      -          rt3      -         \r
+ 10.0.255.6/32   40      -          rt2      -         \r
+ 10.0.255.7/32   40      -          rt3      -         \r
+ 10.0.255.8/32   50      -          rt2      -         \r
+ 10.0.255.9/32   50      -          rt3      -         \r
+ 10.0.255.10/32  60      -          rt2      -         \r
+\r
+test# test isis topology 13 root rt1 spf ipv4-only\r
+IS-IS paths to level-1 routers that speak IP\r
+Vertex               Type         Metric Next-Hop             Interface Parent\r
+rt1                                                                   \r
+10.0.255.1/32        IP internal  0                                     rt1(4)\r
+rt2                  TE-IS        10     rt2                  -         rt1(4)\r
+rt3                  TE-IS        10     rt3                  -         rt1(4)\r
+rt4                  TE-IS        20     rt2                  -         rt2(4)\r
+                                         rt3                  -         rt3(4)\r
+rt5                  TE-IS        20     rt3                  -         rt3(4)\r
+rt6                  TE-IS        20     rt3                  -         rt3(4)\r
+10.0.255.2/32        IP TE        20     rt2                  -         rt2(4)\r
+10.0.255.3/32        IP TE        20     rt3                  -         rt3(4)\r
+rt7                  TE-IS        30     rt3                  -         rt5(4)\r
+                                                                        rt6(4)\r
+10.0.255.4/32        IP TE        30     rt2                  -         rt4(4)\r
+                                         rt3                  -         \r
+10.0.255.5/32        IP TE        30     rt3                  -         rt5(4)\r
+10.0.255.6/32        IP TE        30     rt3                  -         rt6(4)\r
+10.0.255.7/32        IP TE        40     rt3                  -         rt7(4)\r
+\r
+IS-IS L1 IPv4 routing table:\r
+\r
+ Prefix         Metric  Interface  Nexthop  Label(s)  \r
+ -----------------------------------------------------\r
+ 10.0.255.2/32  20      -          rt2      -         \r
+ 10.0.255.3/32  20      -          rt3      -         \r
+ 10.0.255.4/32  30      -          rt2      -         \r
+                        -          rt3      -         \r
+ 10.0.255.5/32  30      -          rt3      -         \r
+ 10.0.255.6/32  30      -          rt3      -         \r
+ 10.0.255.7/32  40      -          rt3      -         \r
+\r
+test# 
+end.
index 869dd732eb9dcf6b3ba98156e427d1ade530685f..d2d9f6293ad9ef74507dac9403d130c01c7d0b97 100644 (file)
@@ -2,14 +2,7 @@
 
 #include "isisd/isis_spf.c"
 
-struct thread_master *master;
-int isis_sock_init(struct isis_circuit *circuit);
-int isis_sock_init(struct isis_circuit *circuit)
-{
-       return 0;
-}
-
-struct zebra_privs_t isisd_privs;
+#include "test_common.h"
 
 static struct isis_vertex **vertices;
 static size_t vertex_count;
diff --git a/tests/isisd/test_topologies.c b/tests/isisd/test_topologies.c
new file mode 100644 (file)
index 0000000..ee89407
--- /dev/null
@@ -0,0 +1,3307 @@
+/*
+ * Copyright (C) 2020  NetDEF, Inc.
+ *                     Renato Westphal
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include "isisd/isisd.h"
+
+#include "test_common.h"
+
+/*
+ * clang-format off
+ *
+ * All topologies have the following properties:
+ * - The System-ID is 0000.0000.000X, where X is the node number (in hex);
+ * - The Router-ID is 10.0.255.X, where X is the node number;
+ * - The default link metric is 10;
+ * - When SR is enabled, Adj-SIDs and Prefix-SIDs are generated automatically;
+ * - When SR is enabled, the default SRGB is [16000-23999] (can be overriden).
+ *
+ * Test topology 1:
+ * ================
+ *
+ *                 +---------+
+ *                 |         |
+ *                 |   RT1   |
+ *      +----------+         +----------+
+ *      |          |         |          |
+ *      |          +---------+          |
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ * +----+----+                     +----+----+
+ * |         |                     |         |
+ * |   RT2   |                     |   RT3   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ * +---+-+---+                     +----+----+
+ * |         |                     |         |
+ * |   RT4   |                     |   RT5   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ *      |          +---------+          |
+ *      |          |         |          |
+ *      |          |   RT6   |          |
+ *      +----------+         +----------+
+ *                 |         |
+ *                 +---------+
+ *
+ * Test topology 2:
+ * ================
+ *
+ *                 +---------+
+ *                 |         |
+ *                 |   RT1   |
+ *      +----------+         +----------+
+ *      |          |         |          |
+ *      |          +----+----+          |
+ *      |               |               |
+ *   15 |               |               | 30
+ *      |               |               |
+ * +----+----+          |          +----+----+
+ * |         |          |          |         |
+ * |   RT2   |          |          |   RT3   |
+ * |         |          |          |         |
+ * |         |          |          |         |
+ * +----+----+          |          +----+----+
+ *      |               |               |
+ *   40 |               |               | 40
+ *      |               |               |
+ * +----+----+          |          +----+----+
+ * |         |          |          |         |
+ * |   RT4   |          |          |   RT5   |
+ * |         +----------+----------+         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ *      |          +---------+          |
+ *      |          |         |          |
+ *      |          |   RT6   |          |
+ *      +----------+         +----------+
+ *                 |         |
+ *                 +---------+
+ *
+ * Test topology 3:
+ * ================
+ *
+ *                 +---------+
+ *                 |         |
+ *                 |   RT1   |
+ *      +----------+         +----------+
+ *      |          |         |          |
+ *      |          +---------+          |
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ * +----+----+                     +----+----+
+ * |         |                     |         |
+ * |   RT2   |                     |   RT3   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               | 30
+ *      |                               |
+ * +----+----+                     +----+----+
+ * |         |                     |         |
+ * |   RT4   |                     |   RT5   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ *      |          +---------+          |
+ *      |          |         |          |
+ *      |          |   RT6   |          |
+ *      +----------+         +----------+
+ *                 |         |
+ *                 +---------+
+ *
+ * Test topology 4:
+ * ================
+ *
+ * +---------+                     +---------+
+ * |         |                     |         |
+ * |   RT1   |                     |   RT2   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT3   |                     |   RT4   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |^                                 |
+ *     ||200                              |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT5   |          50         |   RT6   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT7   |                     |   RT8   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---------+                     +---------+
+ *
+ * Test topology 5:
+ * ================
+ *
+ * +---------+                     +---------+
+ * |         |                     |         |
+ * |   RT1   |                     |   RT2   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT3   |                     |   RT4   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT5   |                     |   RT6   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT7   |                     |   RT8   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---------+                     +---------+
+ *
+ * Test topology 6:
+ * ================
+ *
+ * +---------+                     +---------+
+ * |         |                     |         |
+ * |   RT1   |                     |   RT2   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT3   |                     |   RT4   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---------+                     +------+--+
+ *                                        |
+ *                                        |
+ *                                        |
+ * +---------+                     +------+--+
+ * |         |                     |         |
+ * |   RT5   |                     |   RT6   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT7   |                     |   RT8   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---------+                     +---------+
+ *
+ * Test topology 7:
+ * ================
+ *
+ * +---------+                     +---------+                     +---------+
+ * |         |                     |         |                     |         |
+ * |   RT1   |         40          |   RT2   |                     |   RT3   |
+ * |         +---------------------+         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---+-----+                     +----+----+                     +------+--+
+ *     |                                |                                 |
+ *     |                                |                                 |
+ *     |                                |                                 |
+ * +---+-----+                     +----+----+                     +------+--+
+ * |         |                     |         |                     |         |
+ * |   RT4   |                     |   RT5   |                     |   RT6   |
+ * |         +---------------------+         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---+-----+                     +----+----+                     +------+--+
+ *     |                                |                                 |
+ *     |                                |                                 | 30
+ *     |                                |                                 |
+ * +---+-----+                     +----+----+                     +------+--+
+ * |         |                     |         |                     |         |
+ * |   RT7   |                     |   RT8   |                     |   RT9   |
+ * |         +---------------------+         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---+-----+                     +----+----+                     +------+--+
+ *     |                                |                                 |
+ *     | 20                             |                                 |
+ *     |                                |                                 |
+ * +---+-----+                     +----+----+                     +------+--+
+ * |         |                     |         |                     |         |
+ * |   RT10  |                     |   RT11  |                     |   RT12  |
+ * |         +---------------------+         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---------+                     +---------+                     +---------+
+ *
+ * Test topology 8:
+ * ================
+ *
+ * +---------+                     +---------+                     +---------+
+ * |         |                     |         |                     |         |
+ * |   RT1   |                     |   RT2   |                     |   RT3   |
+ * |         +---------------------+         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---+-----+                     +----+----+                     +------+--+
+ *     |                                |                                 |
+ *     |                                |                                 |
+ *     |                                |                                 |
+ * +---+-----+                     +----+----+                     +------+--+
+ * |         |                     |         |                     |         |
+ * |   RT4   |                     |   RT5   |                     |   RT6   |
+ * |         |                     |         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---+-----+                     +----+----+                     +---------+
+ *     |                                |
+ *     |                                |
+ *     |                                |
+ * +---+-----+                     +----+----+                     +---------+
+ * |         |                     |         |                     |         |
+ * |   RT7   |                     |   RT8   |                     |   RT9   |
+ * |         |                     |         +---------------------+         |
+ * |         |                     |         |                     |         |
+ * +---+-----+                     +----+----+                     +------+--+
+ *     |                                |                                 |
+ *     |                                |                                 |
+ *     |                                |                                 |
+ * +---+-----+                     +----+----+                     +------+--+
+ * |         |                     |         |                     |         |
+ * |   RT10  |                     |   RT11  |                     |   RT12  |
+ * |         +---------------------+         +---------------------+         |
+ * |         |          30         |         |                     |         |
+ * +---------+                     +---------+                     +---------+
+ *
+ * Test topology 9:
+ * ================
+ *
+ *                       +---------+
+ *                       |         |
+ *                       |   RT1   |
+ *            +----------+         +----------+
+ *            |          |         |          |
+ *            |          +---------+          |
+ *            |                               |
+ *            |                               |
+ *            |                               |
+ *       +----+----+                     +----+----+
+ *       |         |                     |         |
+ *       |   RT2   |                     |   RT3   |
+ *       |         |                     |         |
+ *       |         |                     |         |
+ *       +----+----+                     +------+--+
+ *            |                                 |
+ *            |                                 |
+ *            |                                 |100
+ *            |          +---------+            |
+ *            |          |         |            |
+ *            +----------+   RT4   +------------+
+ *      +----------------|         |----------------+
+ *      |              +-+         +--+             |
+ *      |              | +---------+  |             |
+ *      |              |              |             |
+ *      |              |30            |30           |30
+ *      |              |              |             |
+ * +----+----+    +----+----+    +----+----+   +----+----+
+ * |         |    |         |    |         |   |         |
+ * |   RT5   |    |   RT6   |    |   RT7   |   |   RT8   |
+ * |         |    |         |    |         |   |         |
+ * |         |    |         |    |         |   |         |
+ * +----+----+    +----+----+    +----+----+   +----+----+
+ *      |              |              |             |
+ *      |              |              |             |
+ *      |              |              |             |
+ *      |              | +---------+  |             |
+ *      |              +-+         +--+             |
+ *      +----------------+   RT9   +----------------+
+ *                       |         |
+ *                       |         |
+ *                       +---------+
+ *
+ * Test topology 10:
+ * ================
+ *
+ *                 +---------+
+ *                 |         |
+ *                 |   RT1   |
+ *      +----------+         +----------+
+ *      |          |         |          |
+ *      |          +----+----+          |
+ *      |               |               |
+ *      |               |20             |20
+ *      |               |               |
+ * +----+----+     +----+----+     +----+----+
+ * |         |     |         |     |         |
+ * |   RT2   |     |   RT3   |     |   RT4   |
+ * |         |     |         |     |         |
+ * |         |     |         |     |         |
+ * +----+----+     +----+----+     +----+----+
+ *      |               |               |
+ *      |               |               |
+ *      |               |               |
+ * +----+----+     +----+----+     +----+----+
+ * |         |     |         |     |         |
+ * |   RT5   |     |   RT6   |     |   RT7   |
+ * |         |     |         |     |         |
+ * |         |     |         |     |         |
+ * +----+----+     +----+----+     +----+----+
+ *      |               |               |
+ *      |               |50             |50
+ *      |               |               |
+ *      |          +----+----+          |
+ *      |          |         |          |
+ *      +----------+   RT8   +----------+
+ *                 |         |
+ *                 |         |
+ *                 +---------+
+ *
+ * Test topology 11:
+ * ================
+ *
+ *                 +---------+
+ *                 |         |
+ *                 |   RT1   |
+ *                 |         |
+ *                 |         |
+ *                 +----+----+
+ *                      |
+ *                      |
+ *                      |
+ * +---------+          |          +---------+
+ * |         |          |          |         |
+ * |   RT2   |50        |          |   RT3   |
+ * |         +----------+----------+         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ * +----+----+                     +----+----+
+ * |         |                     |         |
+ * |   RT4   |                     |   RT5   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +----+----+                     +----+----+
+ *      |                               |
+ *      |                               |
+ *      |                               |
+ *      |          +---------+          |
+ *      |          |         |          |
+ *      |          |   RT6   |          |
+ *      +----------+         +----------+
+ *                 |         |
+ *                 +---------+
+ *
+ * Test topology 12:
+ * ================
+ *
+ * +---------+                     +---------+
+ * |         |                     |         |
+ * |   RT1   |                     |   RT2   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT3   |                     |   RT4   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |^                                 |
+ *     |400                               |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT5   |                     |   RT6   |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---+-----+                     +------+--+
+ *     |^                                 |
+ *     |200                               |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT7   |                     |   RT8   |
+ * |         +---------------------+         |
+ * |         |         100         |         |
+ * +---+-----+                     +------+--+
+ *     |                                  |
+ *     |                                  |
+ *     |                                  |
+ * +---+-----+                     +------+--+
+ * |         |                     |         |
+ * |   RT9   |                     |   RT10  |
+ * |         |                     |         |
+ * |         |                     |         |
+ * +---------+                     +---------+
+ *
+ * Test topology 13:
+ * ================
+ *
+ * +---------+                     +---------+
+ * |         |                     |         |
+ * |   RT1   |                     |   RT2   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---+-----+                     +----+----+
+ *     |                                |
+ *     |                                |
+ *     |                                |
+ *     |                           +----+----+
+ *     |                           |         |
+ *     |                +----------+   RT4   |
+ *     |                |          |         |
+ * +---+-----+          |          |         |
+ * |         |          |          +----+----+
+ * |   RT3   +----------+               |
+ * |         +----------+               |100
+ * |         |          |               |
+ * +---+-----+          |          +----+----+
+ *     |                |          |         |
+ *     |                |          |   RT5   |
+ *     |                +----------+         |
+ *     |                           |         |
+ *     |                           +----+----+
+ *     |                                |
+ *     |                                |
+ *     |                                |
+ * +---+-----+                     +----+----+
+ * |         |                     |         |
+ * |   RT6   |                     |   RT7   |
+ * |         +---------------------+         |
+ * |         |                     |         |
+ * +---------+                     +---------+
+ */
+
+struct isis_topology test_topologies[] = {
+       {
+               .number = 1,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                                       "2001:db8::1/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                                       "2001:db8::2/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                                       "2001:db8::3/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                                       "2001:db8::4/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                                       "2001:db8::5/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                                       "2001:db8::6/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 2,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                                       "2001:db8::1/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .pseudonode_id = 1,
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 15,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 30,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                                       "2001:db8::2/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 15,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 40,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                                       "2001:db8::3/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 40,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                                       "2001:db8::4/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .pseudonode_id = 1,
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 40,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                                       "2001:db8::5/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .pseudonode_id = 1,
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 40,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                                       "2001:db8::6/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .pseudonode_id = 1,
+                               .level = IS_LEVEL_1,
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 0,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 0,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 0,
+                                       },
+                               },
+                       },
+               },
+       },
+       {
+               .number = 3,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 30,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 4,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 200,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 50,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 50,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 5,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 6,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 7,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 40,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 40,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 30,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt10",
+                                               .metric = 20,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt11",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt9",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x09},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.9",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.9/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt12",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt10",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0a},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.10",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.10/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 20,
+                                       },
+                                       {
+                                               .hostname = "rt11",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt11",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0b},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.11",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.11/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt10",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt12",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt12",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0c},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.12",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.12/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt11",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 8,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt10",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt11",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt9",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x09},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.9",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.9/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt12",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt10",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0a},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.10",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.10/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt11",
+                                               .metric = 30,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt11",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0b},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.11",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.11/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt10",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt12",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt12",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0c},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.12",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.12/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt11",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 9,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                                       "2001:db8::1/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                                       "2001:db8::2/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                                       "2001:db8::3/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 100,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                                       "2001:db8::4/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 100,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 30,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                                       "2001:db8::5/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                                       "2001:db8::6/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                                       "2001:db8::7/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                                       "2001:db8::8/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 30,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt9",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x09},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.9",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.9/32",
+                                       "2001:db8::9/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 10,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                                       "2001:db8::1/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 20,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 20,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                                       "2001:db8::2/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .srgb = {
+                                       .lower_bound = 20000,
+                                       .range_size = 8000,
+                               },
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                                       "2001:db8::3/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 20,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                                       "2001:db8::4/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 20,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                                       "2001:db8::5/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                                       "2001:db8::6/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 50,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                                       "2001:db8::7/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 50,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                                       "2001:db8::8/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 50,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 50,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 11,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                                       "2001:db8::1/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .pseudonode_id = 1,
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                                       "2001:db8::2/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .pseudonode_id = 1,
+                                               .metric = 50,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                                       "2001:db8::3/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .pseudonode_id = 1,
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                                       "2001:db8::4/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                                       "2001:db8::5/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                                       .ipv6 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                                       "2001:db8::6/128",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .pseudonode_id = 1,
+                               .level = IS_LEVEL_1,
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 0,
+                                       },
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 0,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 0,
+                                       },
+                               },
+                       },
+               },
+       },
+       {
+               .number = 12,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 400,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 200,
+                                       },
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 100,
+                                       },
+                                       {
+                                               .hostname = "rt9",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt8",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.8",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.8/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 100,
+                                       },
+                                       {
+                                               .hostname = "rt10",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt9",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x09},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.9",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.9/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt10",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x0a},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.10",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.10/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt8",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               .number = 13,
+               .nodes = {
+                       {
+                               .hostname = "rt1",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.1",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.1/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt2",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.2",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.2/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt3",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.3",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.3/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt1",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt4",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x04},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.4",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.4/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt2",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 100,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt5",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.5",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.5/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt4",
+                                               .metric = 100,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt6",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x06},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.6",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.6/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt3",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt7",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+                       {
+                               .hostname = "rt7",
+                               .sysid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x07},
+                               .level = IS_LEVEL_1,
+                               .router_id = "10.0.255.7",
+                               .protocols = {
+                                       .ipv4 = true,
+                               },
+                               .networks = {
+                                       "10.0.255.7/32",
+                               },
+                               .adjacencies = {
+                                       {
+                                               .hostname = "rt5",
+                                               .metric = 10,
+                                       },
+                                       {
+                                               .hostname = "rt6",
+                                               .metric = 10,
+                                       },
+                               },
+                               .flags = F_ISIS_TEST_NODE_SR,
+                       },
+               },
+       },
+       {
+               /* sentinel */
+       },
+};
index 04053a6f46bb1a46c7a7893cb6677b624363f030..e54bfc4a35816b1bbceef9b747e518d0ad76100b 100644 (file)
@@ -23,6 +23,7 @@ else
 TESTS_ISISD = \
        tests/isisd/test_fuzz_isis_tlv \
        tests/isisd/test_isis_lspdb \
+       tests/isisd/test_isis_spf \
        tests/isisd/test_isis_vertex_queue \
        # end
 endif
@@ -111,6 +112,7 @@ noinst_HEADERS += \
        tests/helpers/c/tests.h \
        tests/lib/cli/common_cli.h \
        tests/lib/test_typelist.h \
+       tests/isisd/test_common.h \
        # end
 
 #
@@ -168,16 +170,21 @@ tests_bgpd_test_peer_attr_SOURCES = tests/bgpd/test_peer_attr.c
 tests_isisd_test_fuzz_isis_tlv_CFLAGS = $(TESTS_CFLAGS) -I$(top_builddir)/tests/isisd
 tests_isisd_test_fuzz_isis_tlv_CPPFLAGS = $(TESTS_CPPFLAGS) -I$(top_builddir)/tests/isisd
 tests_isisd_test_fuzz_isis_tlv_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv.c
+tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv.c tests/isisd/test_common.c
 nodist_tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv_tests.h
 tests_isisd_test_isis_lspdb_CFLAGS = $(TESTS_CFLAGS)
 tests_isisd_test_isis_lspdb_CPPFLAGS = $(TESTS_CPPFLAGS)
 tests_isisd_test_isis_lspdb_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_isis_lspdb_SOURCES = tests/isisd/test_isis_lspdb.c
+tests_isisd_test_isis_lspdb_SOURCES = tests/isisd/test_isis_lspdb.c tests/isisd/test_common.c
+tests_isisd_test_isis_spf_CFLAGS = $(TESTS_CFLAGS)
+tests_isisd_test_isis_spf_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_isisd_test_isis_spf_LDADD = $(ISISD_TEST_LDADD)
+tests_isisd_test_isis_spf_SOURCES = tests/isisd/test_isis_spf.c tests/isisd/test_common.c tests/isisd/test_topologies.c
+nodist_tests_isisd_test_isis_spf_SOURCES = yang/frr-isisd.yang.c
 tests_isisd_test_isis_vertex_queue_CFLAGS = $(TESTS_CFLAGS)
 tests_isisd_test_isis_vertex_queue_CPPFLAGS = $(TESTS_CPPFLAGS)
 tests_isisd_test_isis_vertex_queue_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_isis_vertex_queue_SOURCES = tests/isisd/test_isis_vertex_queue.c
+tests_isisd_test_isis_vertex_queue_SOURCES = tests/isisd/test_isis_vertex_queue.c tests/isisd/test_common.c
 
 tests_lib_cxxcompat_CFLAGS = $(TESTS_CFLAGS) $(CXX_COMPAT_CFLAGS) $(WERROR)
 tests_lib_cxxcompat_CPPFLAGS = $(TESTS_CPPFLAGS)
@@ -327,6 +334,9 @@ EXTRA_DIST += \
        tests/isisd/test_fuzz_isis_tlv.py \
        tests/isisd/test_fuzz_isis_tlv_tests.h.gz \
        tests/isisd/test_isis_lspdb.py \
+       tests/isisd/test_isis_spf.py \
+       tests/isisd/test_isis_spf.in \
+       tests/isisd/test_isis_spf.refout \
        tests/isisd/test_isis_vertex_queue.py \
        tests/lib/cli/test_commands.in \
        tests/lib/cli/test_commands.py \