]> git.puffer.fish Git - mirror/frr.git/commitdiff
pathd: Skip SR-TE topotests if pathd has been disabled 7847/head
authorSebastien Merle <sebastien@netdef.org>
Mon, 11 Jan 2021 11:48:08 +0000 (12:48 +0100)
committerSebastien Merle <sebastien@netdef.org>
Mon, 11 Jan 2021 11:52:15 +0000 (12:52 +0100)
 * If pathd binary is not found, skip the SR-TE topotests.
 * Fix some compilation warnings when pathd is not built.

Signed-off-by: Sebastien Merle <sebastien@netdef.org>
tests/topotests/isis-sr-te-topo1/test_isis_sr_te_topo1.py
vtysh/vtysh.c

index 5e5c0f9feed5f4c2e15e391fd912cf93f67adb93..b1071310cf552136d745b70709e75531f2e87008 100755 (executable)
@@ -150,7 +150,13 @@ class TemplateTopo(Topo):
 
 def setup_module(mod):
     "Sets up the pytest environment"
+
     tgen = Topogen(TemplateTopo, mod.__name__)
+
+    frrdir = tgen.config.get(tgen.CONFIG_SECTION, "frrdir")
+    if not os.path.isfile(os.path.join(frrdir, "pathd")):
+        pytest.skip("pathd daemon wasn't built")
+
     tgen.start_topology()
 
     router_list = tgen.routers()
index f3e28b70e8aea78b98a4a68ada1b3bcb69b798b3..a6f9f39a4cf37fe6e12513d6c94c8b3c3fb30bd9 100644 (file)
@@ -1261,6 +1261,7 @@ static struct cmd_node pw_node = {
        .prompt = "%s(config-pw)# ",
 };
 
+#if defined(HAVE_PATHD)
 static struct cmd_node segment_routing_node = {
        .name = "segment-routing",
        .node = SEGMENT_ROUTING_NODE,
@@ -1296,6 +1297,7 @@ static struct cmd_node srte_candidate_dyn_node = {
        .prompt = "%s(config-sr-te-candidate)# ",
 };
 
+#if defined(HAVE_PATHD_PCEP)
 static struct cmd_node pcep_node = {
        .name = "srte pcep",
        .node = PCEP_NODE,
@@ -1323,6 +1325,8 @@ static struct cmd_node pcep_pce_config_node = {
        .parent_node = PCEP_NODE,
        .prompt = "%s(pcep-sr-te-pcep-pce-config)# ",
 };
+#endif /* HAVE_PATHD_PCEP */
+#endif /* HAVE_PATHD */
 
 static struct cmd_node vrf_node = {
        .name = "vrf",
@@ -2548,6 +2552,7 @@ DEFUNSH(VTYSH_KEYS, vtysh_quit_keys, vtysh_quit_keys_cmd, "quit",
        return vtysh_exit_keys(self, vty, argc, argv);
 }
 
+#if defined(HAVE_PATHD)
 DEFUNSH(VTYSH_PATHD, vtysh_exit_pathd, vtysh_exit_pathd_cmd, "exit",
        "Exit current mode and down to previous mode\n")
 {
@@ -2559,6 +2564,7 @@ DEFUNSH(VTYSH_PATHD, vtysh_quit_pathd, vtysh_quit_pathd_cmd, "quit",
 {
        return vtysh_exit_pathd(self, vty, argc, argv);
 }
+#endif /* HAVE_PATHD */
 
 DEFUNSH(VTYSH_ALL, vtysh_exit_line_vty, vtysh_exit_line_vty_cmd, "exit",
        "Exit current mode and down to previous mode\n")