]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: don't initialize the northbound database in the unit tests
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 15 Apr 2019 22:03:15 +0000 (19:03 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 18 Apr 2019 16:06:14 +0000 (13:06 -0300)
Move call to nb_db_init() from nb_init() to frr_init() so that only
the FRR daemons will initialize the northbound database. This should
fix a few warnings when running some unit tests.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/libfrr.c
lib/northbound.c

index 1afe30d618486594fe454f1d8816bdb3e7ca2a0f..0d4c8d6c0f1b4200895491cc3ef28c7fb5aa2847 100644 (file)
@@ -38,6 +38,7 @@
 #include "lib_errors.h"
 #include "db.h"
 #include "northbound_cli.h"
+#include "northbound_db.h"
 
 DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm))
 DEFINE_KOOH(frr_early_fini, (), ())
@@ -654,6 +655,10 @@ struct thread_master *frr_init(void)
 
        yang_init();
        nb_init(master, di->yang_modules, di->n_yang_modules);
+       if (nb_db_init() != NB_OK)
+               flog_warn(EC_LIB_NB_DATABASE,
+                         "%s: failed to initialize northbound database",
+                         __func__);
 
        return master;
 }
index 9deb9c6cceb28a9dc908f56f6bdec85b6c0d3d4b..fd92aaa9d356edd487ded567ab3de79cddfe8af5 100644 (file)
@@ -1677,12 +1677,6 @@ void nb_init(struct thread_master *tm,
                exit(1);
        }
 
-       /* Initialize the northbound database (used for the rollback log). */
-       if (nb_db_init() != NB_OK)
-               flog_warn(EC_LIB_NB_DATABASE,
-                         "%s: failed to initialize northbound database",
-                         __func__);
-
        /* Create an empty running configuration. */
        running_config = nb_config_new(NULL);