mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 03:00:14 +00:00
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>
This commit is contained in:
parent
19cf3fc5ab
commit
f8f4aec3b0
@ -59,10 +59,13 @@ static void vty_do_exit(int isexit)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const struct frr_yang_module_info *const *test_yang_modules = NULL;
|
||||||
|
|
||||||
/* main routine. */
|
/* main routine. */
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct thread thread;
|
struct thread thread;
|
||||||
|
size_t yangcount;
|
||||||
|
|
||||||
/* Set umask before anything for security */
|
/* Set umask before anything for security */
|
||||||
umask(0027);
|
umask(0027);
|
||||||
@ -79,7 +82,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
vty_init(master, false);
|
vty_init(master, false);
|
||||||
lib_cmd_init();
|
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);
|
test_init(argc, argv);
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
#include "zebra.h"
|
#include "zebra.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
#include "northbound.h"
|
||||||
|
|
||||||
|
extern const struct frr_yang_module_info *const *test_yang_modules;
|
||||||
|
|
||||||
/* function to be implemented by test */
|
/* function to be implemented by test */
|
||||||
extern void test_init(int argc, char **argv);
|
extern void test_init(int argc, char **argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user