From: David Lamparter Date: Sun, 7 Nov 2021 14:49:17 +0000 (+0100) Subject: tests: allow common_cli.c with logging enabled X-Git-Tag: frr-8.2.2~289^2~2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=865dd9fe0bff73a46deb174e988cf1d4f8ce5e78;p=mirror_frr.git tests: allow common_cli.c with logging enabled 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 --- diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c index 8be81cc4c..7c9febe2c 100644 --- a/tests/lib/cli/common_cli.c +++ b/tests/lib/cli/common_cli.c @@ -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); diff --git a/tests/lib/cli/common_cli.h b/tests/lib/cli/common_cli.h index 3042ff5b1..6660b27ef 100644 --- a/tests/lib/cli/common_cli.h +++ b/tests/lib/cli/common_cli.h @@ -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[]);