summaryrefslogtreecommitdiff
path: root/tests/lib/cli/common_cli.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-04-20 05:36:30 +0200
committerMartin Winter <mwinter@opensourcerouting.org>2021-07-06 01:44:35 +0200
commitf8f4aec3b0c976c6b933770cfac36b21ca7f06bb (patch)
tree579946971ba8fa80024f0b1c160c1515034437ac /tests/lib/cli/common_cli.c
parent19cf3fc5abaeb633bacbda82d5fd6ad6d06d4849 (diff)
tests/lib/cli: allow using YANG modules
Since the common CLI code calls nb_init, allow specifying some modules to load by overriding test_yang_models. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'tests/lib/cli/common_cli.c')
-rw-r--r--tests/lib/cli/common_cli.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c
index 49bc0f4fb2..8be81cc4cb 100644
--- a/tests/lib/cli/common_cli.c
+++ b/tests/lib/cli/common_cli.c
@@ -59,10 +59,13 @@ static void vty_do_exit(int isexit)
exit(0);
}
+const struct frr_yang_module_info *const *test_yang_modules = NULL;
+
/* main routine. */
int main(int argc, char **argv)
{
struct thread thread;
+ size_t yangcount;
/* Set umask before anything for security */
umask(0027);
@@ -79,7 +82,11 @@ int main(int argc, char **argv)
vty_init(master, false);
lib_cmd_init();
- nb_init(master, NULL, 0, false);
+
+ for (yangcount = 0; test_yang_modules && test_yang_modules[yangcount];
+ yangcount++)
+ ;
+ nb_init(master, test_yang_modules, yangcount, false);
test_init(argc, argv);