]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: allow common_cli.c with logging enabled
authorDavid Lamparter <equinox@opensourcerouting.org>
Sun, 7 Nov 2021 14:49:17 +0000 (15:49 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 8 Nov 2021 13:06:21 +0000 (14:06 +0100)
common_cli.c disables logging by default so stdio is usable as vty
without log messages getting strewn inbetween.  This the right thing for
most tests, but not all; sometimes we do want log messages.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
tests/lib/cli/common_cli.c
tests/lib/cli/common_cli.h

index 8be81cc4cb1ece3d326f85c17548cabda1019829..7c9febe2cab91b988fa44c80e5641cac8b2a8881 100644 (file)
@@ -60,6 +60,7 @@ static void vty_do_exit(int isexit)
 }
 
 const struct frr_yang_module_info *const *test_yang_modules = NULL;
+int test_log_prio = ZLOG_DISABLED;
 
 /* main routine. */
 int main(int argc, char **argv)
@@ -73,7 +74,7 @@ int main(int argc, char **argv)
        /* master init. */
        master = thread_master_create(NULL);
 
-       zlog_aux_init("NONE: ", ZLOG_DISABLED);
+       zlog_aux_init("NONE: ", test_log_prio);
 
        /* Library inits. */
        cmd_init(1);
index 3042ff5b12696320f1415434ad22bf25ffa6aa7c..6660b27ef7b7f1f787073dce01b0515cd11f8101 100644 (file)
@@ -37,6 +37,8 @@ extern void test_init(int argc, char **argv);
  */
 extern struct thread_master *master;
 
+extern int test_log_prio;
+
 extern int dump_args(struct vty *vty, const char *descr, int argc,
                     struct cmd_token *argv[]);