summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--babeld/babel_main.c2
-rw-r--r--babeld/subdir.am7
-rw-r--r--bfdd/bfdd.c2
-rw-r--r--bgpd/bgp_bfd.c2
-rw-r--r--bgpd/bgp_fsm.c12
-rw-r--r--bgpd/bgp_main.c2
-rw-r--r--bgpd/bgp_mpath.c20
-rw-r--r--bgpd/bgp_mpath.h2
-rw-r--r--bgpd/bgp_route.c40
-rw-r--r--configure.ac69
-rw-r--r--doc/developer/process-architecture.rst48
-rw-r--r--doc/user/babeld.rst2
-rw-r--r--eigrpd/eigrp_main.c2
-rw-r--r--eigrpd/subdir.am7
-rw-r--r--gdb/lib.txt4
-rw-r--r--isisd/isis_main.c2
-rw-r--r--ldpd/lde.c2
-rw-r--r--ldpd/ldpd.c2
-rw-r--r--ldpd/ldpe.c2
-rw-r--r--lib/bfd.c29
-rw-r--r--lib/bfd.h47
-rw-r--r--lib/if.h12
-rw-r--r--lib/libfrr.h2
-rw-r--r--lib/log.c2
-rw-r--r--lib/log.h10
-rw-r--r--lib/sigevent.c34
-rw-r--r--lib/sigevent.h16
-rw-r--r--lib/subdir.am3
-rw-r--r--lib/thread.c2
-rw-r--r--lib/vty.c6
-rw-r--r--nhrpd/nhrp_main.c2
-rw-r--r--ospf6d/ospf6_main.c2
-rw-r--r--ospfd/ospf_main.c2
-rw-r--r--ospfd/ospf_packet.c2
-rw-r--r--ospfd/ospf_snmp.c2
-rw-r--r--ospfd/ospfd.c2
-rw-r--r--pathd/path_main.c2
-rw-r--r--pbrd/pbr_main.c2
-rw-r--r--pimd/pim_signals.c2
-rw-r--r--pimd/pim_signals.h2
-rw-r--r--pimd/subdir.am16
-rw-r--r--ripd/rip_main.c2
-rw-r--r--ripd/subdir.am9
-rw-r--r--ripngd/ripng_main.c2
-rw-r--r--ripngd/subdir.am9
-rw-r--r--sharpd/sharp_main.c2
-rw-r--r--staticd/static_main.c2
-rw-r--r--tests/bgpd/subdir.am82
-rw-r--r--tests/bgpd/test_mpath.c4
-rw-r--r--tests/isisd/subdir.am66
-rw-r--r--tests/lib/subdir.am364
-rw-r--r--tests/lib/test_printfrr.c4
-rw-r--r--tests/lib/test_segv.c2
-rw-r--r--tests/lib/test_sig.c24
-rw-r--r--tests/lib/test_zmq.c2
-rw-r--r--tests/ospf6d/subdir.am19
-rw-r--r--tests/ospfd/subdir.am21
-rw-r--r--tests/subdir.am502
-rw-r--r--tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py62
-rw-r--r--tests/zebra/subdir.am17
-rw-r--r--vrrpd/subdir.am7
-rw-r--r--vrrpd/vrrp_main.c2
-rw-r--r--vtysh/vtysh.c2
-rw-r--r--watchfrr/watchfrr.c2
-rw-r--r--zebra/interface.c4
-rw-r--r--zebra/interface.h4
-rw-r--r--zebra/kernel_socket.c2
-rw-r--r--zebra/main.c4
68 files changed, 911 insertions, 739 deletions
diff --git a/babeld/babel_main.c b/babeld/babel_main.c
index 61a800eef4..b29374fee3 100644
--- a/babeld/babel_main.c
+++ b/babeld/babel_main.c
@@ -115,7 +115,7 @@ babel_sigusr1 (void)
zlog_rotate ();
}
-static struct quagga_signal_t babel_signals[] =
+static struct frr_signal_t babel_signals[] =
{
{
.signal = SIGUSR1,
diff --git a/babeld/subdir.am b/babeld/subdir.am
index c9b6959fca..856cbd13e3 100644
--- a/babeld/subdir.am
+++ b/babeld/subdir.am
@@ -3,7 +3,6 @@
#
if BABELD
-noinst_LIBRARIES += babeld/libbabel.a
sbin_PROGRAMS += babeld/babeld
vtysh_scan += \
babeld/babel_interface.c \
@@ -13,10 +12,11 @@ vtysh_scan += \
vtysh_daemons += babeld
endif
-babeld_libbabel_a_SOURCES = \
+babeld_babeld_SOURCES = \
babeld/babel_errors.c \
babeld/babel_filter.c \
babeld/babel_interface.c \
+ babeld/babel_main.c \
babeld/babel_zebra.c \
babeld/babeld.c \
babeld/kernel.c \
@@ -48,5 +48,4 @@ noinst_HEADERS += \
babeld/xroute.h \
# end
-babeld_babeld_SOURCES = babeld/babel_main.c
-babeld_babeld_LDADD = babeld/libbabel.a lib/libfrr.la $(LIBCAP)
+babeld_babeld_LDADD = lib/libfrr.la $(LIBCAP)
diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c
index 188e47905c..c764941513 100644
--- a/bfdd/bfdd.c
+++ b/bfdd/bfdd.c
@@ -103,7 +103,7 @@ static void sighup_handler(void)
vty_read_config(NULL, bfdd_di.config_file, config_default);
}
-static struct quagga_signal_t bfd_signals[] = {
+static struct frr_signal_t bfd_signals[] = {
{
.signal = SIGUSR1,
.handler = &sigusr1_handler,
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c
index f23e6b2e9b..ed54f42b0a 100644
--- a/bgpd/bgp_bfd.c
+++ b/bgpd/bgp_bfd.c
@@ -163,7 +163,7 @@ void bgp_peer_bfd_update_source(struct peer *p)
return;
/* Figure out the correct source to use. */
- if (CHECK_FLAG(p->flags, PEER_FLAG_UPDATE_SOURCE))
+ if (CHECK_FLAG(p->flags, PEER_FLAG_UPDATE_SOURCE) && p->update_source)
source = p->update_source;
else
source = p->su_local;
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 5b997867e0..91265ed358 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -756,8 +756,8 @@ void bgp_update_delay_end(struct bgp *bgp)
bgp->implicit_eors = 0;
bgp->explicit_eors = 0;
- quagga_timestamp(3, bgp->update_delay_end_time,
- sizeof(bgp->update_delay_end_time));
+ frr_timestamp(3, bgp->update_delay_end_time,
+ sizeof(bgp->update_delay_end_time));
/*
* Add an end-of-initial-update marker to the main process queues so
@@ -804,8 +804,8 @@ void bgp_start_routeadv(struct bgp *bgp)
if (bgp->main_peers_update_hold)
return;
- quagga_timestamp(3, bgp->update_delay_peers_resume_time,
- sizeof(bgp->update_delay_peers_resume_time));
+ frr_timestamp(3, bgp->update_delay_peers_resume_time,
+ sizeof(bgp->update_delay_peers_resume_time));
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
if (!peer_established(peer))
@@ -1057,8 +1057,8 @@ static void bgp_update_delay_begin(struct bgp *bgp)
thread_add_timer(bm->master, bgp_establish_wait_timer, bgp,
bgp->v_establish_wait, &bgp->t_establish_wait);
- quagga_timestamp(3, bgp->update_delay_begin_time,
- sizeof(bgp->update_delay_begin_time));
+ frr_timestamp(3, bgp->update_delay_begin_time,
+ sizeof(bgp->update_delay_begin_time));
}
static void bgp_update_delay_process_status_change(struct peer *peer)
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index 08776d200f..6a01a6137c 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -90,7 +90,7 @@ void sigusr1(void);
static void bgp_exit(int);
static void bgp_vrf_terminate(void);
-static struct quagga_signal_t bgp_signals[] = {
+static struct frr_signal_t bgp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 1d727d267a..42077d4e8e 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -508,7 +508,7 @@ static void bgp_path_info_mpath_attr_set(struct bgp_path_info *path,
* Compare and sync up the multipath list with the mp_list generated by
* bgp_best_selection
*/
-void bgp_path_info_mpath_update(struct bgp_dest *dest,
+void bgp_path_info_mpath_update(struct bgp *bgp, struct bgp_dest *dest,
struct bgp_path_info *new_best,
struct bgp_path_info *old_best,
struct list *mp_list,
@@ -553,11 +553,11 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
if (debug)
zlog_debug(
- "%pRN: starting mpath update, newbest %s num candidates %d old-mpath-count %d old-cum-bw u%" PRIu64,
- bgp_dest_to_rnode(dest),
+ "%pRN(%s): starting mpath update, newbest %s num candidates %d old-mpath-count %d old-cum-bw u%" PRIu64,
+ bgp_dest_to_rnode(dest), bgp->name_pretty,
new_best ? new_best->peer->host : "NONE",
- mp_list ? listcount(mp_list) : 0,
- old_mpath_count, old_cum_bw);
+ mp_list ? listcount(mp_list) : 0, old_mpath_count,
+ old_cum_bw);
/*
* We perform an ordered walk through both lists in parallel.
@@ -589,8 +589,8 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
if (debug)
zlog_debug(
- "%pRN: comparing candidate %s with existing mpath %s",
- bgp_dest_to_rnode(dest),
+ "%pRN(%s): comparing candidate %s with existing mpath %s",
+ bgp_dest_to_rnode(dest), bgp->name_pretty,
tmp_info ? tmp_info->peer->host : "NONE",
cur_mpath ? cur_mpath->peer->host : "NONE");
@@ -734,9 +734,9 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
if (debug)
zlog_debug(
- "%pRN: New mpath count (incl newbest) %d mpath-change %s all_paths_lb %d cum_bw u%" PRIu64,
- bgp_dest_to_rnode(dest), mpath_count,
- mpath_changed ? "YES" : "NO",
+ "%pRN(%s): New mpath count (incl newbest) %d mpath-change %s all_paths_lb %d cum_bw u%" PRIu64,
+ bgp_dest_to_rnode(dest), bgp->name_pretty,
+ mpath_count, mpath_changed ? "YES" : "NO",
all_paths_lb, cum_bw);
if (mpath_changed
diff --git a/bgpd/bgp_mpath.h b/bgpd/bgp_mpath.h
index a07e48159e..5476297c3d 100644
--- a/bgpd/bgp_mpath.h
+++ b/bgpd/bgp_mpath.h
@@ -64,7 +64,7 @@ extern void bgp_mp_list_init(struct list *);
extern void bgp_mp_list_clear(struct list *);
extern void bgp_mp_list_add(struct list *mp_list, struct bgp_path_info *mpinfo);
extern void bgp_mp_dmed_deselect(struct bgp_path_info *dmed_best);
-extern void bgp_path_info_mpath_update(struct bgp_dest *dest,
+extern void bgp_path_info_mpath_update(struct bgp *bgp, struct bgp_dest *dest,
struct bgp_path_info *new_best,
struct bgp_path_info *old_best,
struct list *mp_list,
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index fdaee9b600..e51bf55696 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -605,17 +605,17 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
if (exist == NULL) {
*reason = bgp_path_selection_first;
if (debug)
- zlog_debug("%s: %s is the initial bestpath", pfx_buf,
- new_buf);
+ zlog_debug("%s(%s): %s is the initial bestpath",
+ pfx_buf, bgp->name_pretty, new_buf);
return 1;
}
if (debug) {
bgp_path_info_path_with_addpath_rx_str(exist, exist_buf,
sizeof(exist_buf));
- zlog_debug("%s: Comparing %s flags 0x%x with %s flags 0x%x",
- pfx_buf, new_buf, new->flags, exist_buf,
- exist->flags);
+ zlog_debug("%s(%s): Comparing %s flags 0x%x with %s flags 0x%x",
+ pfx_buf, bgp->name_pretty, new_buf, new->flags,
+ exist_buf, exist->flags);
}
newattr = new->attr;
@@ -2404,8 +2404,8 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
bgp_path_info_path_with_addpath_rx_str(
new_select, path_buf, sizeof(path_buf));
zlog_debug(
- "%pBD: %s is the bestpath from AS %u",
- dest, path_buf,
+ "%pBD(%s): %s is the bestpath from AS %u",
+ dest, bgp->name_pretty, path_buf,
aspath_get_first_as(
new_select->attr->aspath));
}
@@ -2481,8 +2481,8 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
else
snprintf(path_buf, sizeof(path_buf), "NONE");
zlog_debug(
- "%pBD: After path selection, newbest is %s oldbest was %s",
- dest, path_buf,
+ "%pBD(%s): After path selection, newbest is %s oldbest was %s",
+ dest, bgp->name_pretty, path_buf,
old_select ? old_select->peer->host : "NONE");
}
@@ -2497,8 +2497,9 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
if (pi == new_select) {
if (debug)
zlog_debug(
- "%pBD: %s is the bestpath, add to the multipath list",
- dest, path_buf);
+ "%pBD(%s): %s is the bestpath, add to the multipath list",
+ dest, bgp->name_pretty,
+ path_buf);
bgp_mp_list_add(&mp_list, pi);
continue;
}
@@ -2534,7 +2535,7 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
}
}
- bgp_path_info_mpath_update(dest, new_select, old_select, &mp_list,
+ bgp_path_info_mpath_update(bgp, dest, new_select, old_select, &mp_list,
mpath_cfg);
bgp_path_info_mpath_aggregate_update(new_select, old_select);
bgp_mp_list_clear(&mp_list);
@@ -2775,8 +2776,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
}
/* Is it end of initial update? (after startup) */
if (!dest) {
- quagga_timestamp(3, bgp->update_delay_zebra_resume_time,
- sizeof(bgp->update_delay_zebra_resume_time));
+ frr_timestamp(3, bgp->update_delay_zebra_resume_time,
+ sizeof(bgp->update_delay_zebra_resume_time));
bgp->main_zebra_update_hold = 0;
FOREACH_AFI_SAFI (afi, safi) {
@@ -2793,8 +2794,9 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
debug = bgp_debug_bestpath(dest);
if (debug)
- zlog_debug("%s: p=%pBD afi=%s, safi=%s start", __func__, dest,
- afi2str(afi), safi2str(safi));
+ zlog_debug("%s: p=%pBDi(%s) afi=%s, safi=%s start", __func__,
+ dest, bgp->name_pretty, afi2str(afi),
+ safi2str(safi));
/* The best path calculation for the route is deferred if
* BGP_NODE_SELECT_DEFER is set
@@ -2856,9 +2858,9 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
if (debug)
zlog_debug(
- "%s: p=%pBD afi=%s, safi=%s, old_select=%p, new_select=%p",
- __func__, dest, afi2str(afi), safi2str(safi),
- old_select, new_select);
+ "%s: p=%pBD(%s) afi=%s, safi=%s, old_select=%p, new_select=%p",
+ __func__, dest, bgp->name_pretty, afi2str(afi),
+ safi2str(safi), old_select, new_select);
/* If best route remains the same and this is not due to user-initiated
* clear, see exactly what needs to be done.
diff --git a/configure.ac b/configure.ac
index c5e5d64aa0..42b3b659a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,8 +180,6 @@ AM_PROG_CC_C_O
dnl remove autoconf default "-g -O2"
CFLAGS="$orig_cflags"
CXXFLAGS="$orig_cxxflags"
-AC_PROG_CC_C99
-dnl NB: see C11 below
dnl Some special handling for ICC later on
if test "$CC" = "icc"; then
@@ -254,12 +252,24 @@ if test "$cc_is_icc" = "yes"; then
AC_C_FLAG([-diag-error 10006])
fi
-dnl AC_PROG_CC_C99 may change CC to include -std=gnu99 or something
-ac_cc="$CC"
-CC="${CC% -std=gnu99}"
-CC="${CC% -std=c99}"
+dnl autoconf 2.69 AC_PROG_CC_C99 is "state of the art"
+dnl autoconf 2.70 AC_PROG_CC_C99 is deprecated and AC_PROC_CC tries to do C11
+m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.70]), [-1], [dnl
+ dnl autoconf < 2.70
+ AC_PROG_CC_C99
-AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
+ dnl AC_PROG_CC_C99 may change CC to include -std=gnu99 or something
+ ac_cc="$CC"
+ CC="${CC% -std=gnu99}"
+ CC="${CC% -std=c99}"
+
+ AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
+], [
+ dnl autoconf >= 2.70
+ if test "$ac_cv_prog_cc_c11" = "no"; then
+ AC_MSG_ERROR([ISO C11 compiler support (with GNU extensions) is required.])
+ fi
+])
dnl if the user has specified any CFLAGS, override our settings
if test "$enable_gcov" = "yes"; then
@@ -507,6 +517,15 @@ AC_SUBST([AC_LDFLAGS])
AC_SUBST([AC_LDFLAGS_EXEC])
AM_CONDITIONAL([STATIC_BIN], [test "$enable_static_bin" = "yes"])
+dnl libtool, the repository of all knowledge related linkers, is too stupid to
+dnl correctly tell the linker how to build modules.
+if test -z "$module_cmds"; then
+ module_cmds="`echo \"$archive_cmds\" | sed -e 's%$wl-soname $wl$soname%%'`"
+fi
+if test -z "$module_expsym_cmds"; then
+ module_expsym_cmds="`echo \"$archive_expsym_cmds\" | sed -e 's%$wl-soname $wl$soname%%'`"
+fi
+
AC_ARG_ENABLE([rpath],
[AS_HELP_STRING([--enable-rpath], [set hardcoded rpaths in the executable @<:@default=yes@:>@])],
[],
@@ -801,6 +820,8 @@ AS_IF([test "$host" = "$build"], [
AC_CHECK_HEADER([gelf.h], [], [
AC_MSG_ERROR([libelf headers are required for building clippy. (Host only when cross-compiling.)])
])
+
+ LIBS_save="$LIBS"
AC_CHECK_LIB([elf], [elf_memory], [], [
AC_MSG_ERROR([libelf is required for building clippy. (Host only when cross-compiling.)])
])
@@ -811,6 +832,8 @@ AS_IF([test "$host" = "$build"], [
AC_CHECK_LIB([elf], [gelf_getnote], [
AC_DEFINE([HAVE_GELF_GETNOTE], [1], [Have gelf_getnote()])
])
+ LIBS="$LIBS_save"
+ unset LIBS_save
FRR_PYTHON_DEV
], [
@@ -1567,8 +1590,17 @@ if test "$ac_cv_have_decl_TCP_MD5SIG" = "no"; then
AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
fi
-AC_CHECK_LIB([crypt], [crypt], [],
- [AC_CHECK_LIB([crypto], [DES_crypt])])
+LIBS_save="$LIBS"
+AC_CHECK_LIB([crypt], [crypt], [], [
+ AC_CHECK_LIB([crypto], [DES_crypt])
+])
+LIBCRYPT="$LIBS"
+LIBCRYPT="${LIBCRYPT%$LIBS_save}"
+LIBCRYPT="${LIBCRYPT#$LIBS_save}"
+AC_SUBST([LIBCRYPT])
+LIBS="$LIBS_save"
+unset LIBS_save
+
AC_CHECK_LIB([resolv], [res_init])
dnl ---------------------------
@@ -2022,6 +2054,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "rtrlib/rtrlib.h"]],
dnl ---------------
dnl dlopen & dlinfo
dnl ---------------
+LIBS_save="$LIBS"
AC_SEARCH_LIBS([dlopen], [dl dld], [], [
AC_MSG_ERROR([unable to find the dlopen()])
])
@@ -2068,6 +2101,13 @@ if test "$frr_cv_rtld_di_linkmap" = "yes"; then
AC_DEFINE([HAVE_DLINFO_LINKMAP], [1], [Have dlinfo RTLD_DI_LINKMAP])
fi
+LIBDL="$LIBS"
+LIBDL="${LIBDL%$LIBS_save}"
+LIBDL="${LIBDL#$LIBS_save}"
+AC_SUBST([LIBDL])
+LIBS="$LIBS_save"
+unset LIBS_save
+
dnl ##########################################################################
dnl test "$enable_clippy_only" != "yes"
fi
@@ -2235,7 +2275,16 @@ dnl --------------------------------------
dnl checking for flex and bison
dnl --------------------------------------
-AM_PROG_LEX
+dnl autoconf 2.69 AC_PROG_LEX has no parameters
+dnl autoconf 2.70 AC_PROG_LEX prints a deprecation warning without params
+m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.70]), [-1], [dnl
+ dnl autoconf < 2.70
+ AC_PROG_LEX
+], [
+ dnl autoconf >= 2.70
+ AC_PROG_LEX([noyywrap])
+])
+
AC_MSG_CHECKING([version of flex])
frr_ac_flex_version="$(eval $LEX -V | grep flex | head -n 1)"
frr_ac_flex_version="${frr_ac_flex_version##* }"
diff --git a/doc/developer/process-architecture.rst b/doc/developer/process-architecture.rst
index 6a028d0000..37bd620f24 100644
--- a/doc/developer/process-architecture.rst
+++ b/doc/developer/process-architecture.rst
@@ -3,34 +3,38 @@
Process Architecture
====================
-FRR inherited its overall design architecture from Quagga. The chosen model for
-Quagga is that of a suite of independent daemons that do IPC via Unix domain
-sockets. Within each daemon, the architecture follows the event-driven model.
-FRR has inherited this model as well. As FRR is deployed at larger scales and
-gains ever more features, each adding to the overall processing workload, we
-are approaching the saturation point for a single thread per daemon. In light
-of this, there are ongoing efforts to introduce multithreading to various
-components of FRR. This document aims to describe the current design choices
-and overall model for integrating the event-driven and multithreaded
-architectures into a cohesive whole.
+FRR is a suite of daemons that serve different functions. This document
+describes internal architecture of daemons, focusing their general design
+patterns, and especially how threads are used in the daemons that use them.
+
+Overview
+--------
+The fundamental pattern used in FRR daemons is an `event loop
+<https://en.wikipedia.org/wiki/Event_loop>`_. Some daemons use `kernel threads
+<https://en.wikipedia.org/wiki/Thread_(computing)#Kernel_threads>`_. In these
+daemons, each kernel thread runs its own event loop. The event loop
+implementation is constructed to be thread safe and to allow threads other than
+its owning thread to schedule events on it. The rest of this document describes
+these two designs in detail.
Terminology
-----------
-Because this document describes the architecture for true kernel threads as
-well as the event system, a digression on terminology is in order here.
+Because this document describes the architecture for kernel threads as well as
+the event system, a digression on terminology is in order here.
-Historically Quagga's event system was viewed as an implementation of userspace
+Historically Quagga's loop system was viewed as an implementation of userspace
threading. Because of this design choice, the names for various datastructures
within the event system are variations on the term "thread". The primary
-context datastructure in this system is called a "threadmaster". What would
-today be called an 'event' or 'task' in systems such as libevent are called
-"threads" and the datastructure for them is ``struct thread``. To add to the
-confusion, these "threads" have various types, one of which is "event". To
-hopefully avoid some of this confusion, this document refers to these "threads"
-as a 'task' except where the datastructures are explicitly named. When they are
-explicitly named, they will be formatted ``like this`` to differentiate from
-the conceptual names. When speaking of kernel threads, the term used will be
-"pthread" since FRR's kernel threading implementation is POSIX threads.
+datastructure that holds the state of an event loop in this system is called a
+"threadmaster". Events scheduled on the event loop - what would today be called
+an 'event' or 'task' in systems such as libevent - are called "threads" and the
+datastructure for them is ``struct thread``. To add to the confusion, these
+"threads" have various types, one of which is "event". To hopefully avoid some
+of this confusion, this document refers to these "threads" as a 'task' except
+where the datastructures are explicitly named. When they are explicitly named,
+they will be formatted ``like this`` to differentiate from the conceptual
+names. When speaking of kernel threads, the term used will be "pthread" since
+FRR's kernel threading implementation uses the POSIX threads API.
.. This should be broken into its document under :ref:`libfrr`
.. _event-architecture:
diff --git a/doc/user/babeld.rst b/doc/user/babeld.rst
index c8015bb7e5..2d9fef13c3 100644
--- a/doc/user/babeld.rst
+++ b/doc/user/babeld.rst
@@ -268,6 +268,6 @@ Babel sample configuration file
! babel hello-interval 12000
! babel update-interval 36000
- ! log file /var/log/quagga/babeld.log
+ ! log file /var/log/frr/babeld.log
log stdout
diff --git a/eigrpd/eigrp_main.c b/eigrpd/eigrp_main.c
index 9acb517d8c..9dd795f0b0 100644
--- a/eigrpd/eigrp_main.c
+++ b/eigrpd/eigrp_main.c
@@ -120,7 +120,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t eigrp_signals[] = {
+struct frr_signal_t eigrp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/eigrpd/subdir.am b/eigrpd/subdir.am
index 82873a4960..3b647e060b 100644
--- a/eigrpd/subdir.am
+++ b/eigrpd/subdir.am
@@ -3,7 +3,6 @@
#
if EIGRPD
-noinst_LIBRARIES += eigrpd/libeigrp.a
sbin_PROGRAMS += eigrpd/eigrpd
vtysh_scan += \
eigrpd/eigrp_cli.c \
@@ -15,7 +14,7 @@ vtysh_daemons += eigrpd
man8 += $(MANBUILD)/frr-eigrpd.8
endif
-eigrpd_libeigrp_a_SOURCES = \
+eigrpd_eigrpd_SOURCES = \
eigrpd/eigrp_cli.c \
eigrpd/eigrp_dump.c \
eigrpd/eigrp_errors.c \
@@ -23,6 +22,7 @@ eigrpd_libeigrp_a_SOURCES = \
eigrpd/eigrp_fsm.c \
eigrpd/eigrp_hello.c \
eigrpd/eigrp_interface.c \
+ eigrpd/eigrp_main.c \
eigrpd/eigrp_metric.c \
eigrpd/eigrp_neighbor.c \
eigrpd/eigrp_network.c \
@@ -78,5 +78,4 @@ nodist_eigrpd_eigrpd_SOURCES = \
yang/frr-eigrpd.yang.c \
# end
-eigrpd_eigrpd_SOURCES = eigrpd/eigrp_main.c
-eigrpd_eigrpd_LDADD = eigrpd/libeigrp.a lib/libfrr.la $(LIBCAP)
+eigrpd_eigrpd_LDADD = lib/libfrr.la $(LIBCAP)
diff --git a/gdb/lib.txt b/gdb/lib.txt
index 60a004e1e1..913b455ed1 100644
--- a/gdb/lib.txt
+++ b/gdb/lib.txt
@@ -1,6 +1,6 @@
# GDB macros for use with Quagga.
#
-# Macros in this file are not daemon specific. E.g., OS or Quagga library
+# Macros in this file are not daemon specific. E.g., OS or FRR library
# APIs.
#
# The macro file can be loaded with 'source <filename>'. They can then be
@@ -9,7 +9,7 @@
#
# E.g.:
#
-# (gdb) source ~paul/code/quagga/gdb/lib.txt
+# (gdb) source ~paul/code/frr/gdb/lib.txt
# (gdb) break bgp_packet.c:613
# Breakpoint 3 at 0x7fa883033a32: file bgp_packet.c, line 613.
# (gdb) cont
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index 6deeebda95..fb4237f002 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -147,7 +147,7 @@ void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t isisd_signals[] = {
+struct frr_signal_t isisd_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 0956310367..55fa806d4d 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -107,7 +107,7 @@ sigint(void)
lde_shutdown();
}
-static struct quagga_signal_t lde_signals[] =
+static struct frr_signal_t lde_signals[] =
{
{
.signal = SIGHUP,
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index 0ff3238ff9..6fa0e330f8 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -180,7 +180,7 @@ sigusr1(void)
zlog_rotate();
}
-static struct quagga_signal_t ldp_signals[] =
+static struct frr_signal_t ldp_signals[] =
{
{
.signal = SIGHUP,
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c
index fff7ee7c67..31f8026e3f 100644
--- a/ldpd/ldpe.c
+++ b/ldpd/ldpe.c
@@ -82,7 +82,7 @@ sigint(void)
ldpe_shutdown();
}
-static struct quagga_signal_t ldpe_signals[] =
+static struct frr_signal_t ldpe_signals[] =
{
{
.signal = SIGHUP,
diff --git a/lib/bfd.c b/lib/bfd.c
index 9800ed4924..5b62d9ea24 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -646,32 +646,16 @@ void bfd_sess_set_vrf(struct bfd_session_params *bsp, vrf_id_t vrf_id)
bsp->args.vrf_id = vrf_id;
}
-void bfd_sess_set_mininum_ttl(struct bfd_session_params *bsp, uint8_t min_ttl)
+void bfd_sess_set_hop_count(struct bfd_session_params *bsp, uint8_t hops)
{
- assert(min_ttl != 0);
-
- if (bsp->args.ttl == ((BFD_SINGLE_HOP_TTL + 1) - min_ttl))
- return;
-
- /* If already installed, remove the old setting. */
- _bfd_sess_remove(bsp);
-
- /* Invert TTL value: protocol expects number of hops. */
- min_ttl = (BFD_SINGLE_HOP_TTL + 1) - min_ttl;
- bsp->args.ttl = min_ttl;
- bsp->args.mhop = (min_ttl > 1);
-}
-
-void bfd_sess_set_hop_count(struct bfd_session_params *bsp, uint8_t min_ttl)
-{
- if (bsp->args.ttl == min_ttl)
+ if (bsp->args.ttl == hops)
return;
/* If already installed, remove the old setting. */
_bfd_sess_remove(bsp);
- bsp->args.ttl = min_ttl;
- bsp->args.mhop = (min_ttl > 1);
+ bsp->args.ttl = hops;
+ bsp->args.mhop = (hops > 1);
}
@@ -706,11 +690,6 @@ enum bfd_session_state bfd_sess_status(const struct bfd_session_params *bsp)
return bsp->bss.state;
}
-uint8_t bfd_sess_minimum_ttl(const struct bfd_session_params *bsp)
-{
- return ((BFD_SINGLE_HOP_TTL + 1) - bsp->args.ttl);
-}
-
uint8_t bfd_sess_hop_count(const struct bfd_session_params *bsp)
{
return bsp->args.ttl;
diff --git a/lib/bfd.h b/lib/bfd.h
index cc9659ff79..05b45a1c34 100644
--- a/lib/bfd.h
+++ b/lib/bfd.h
@@ -181,39 +181,14 @@ void bfd_sess_set_vrf(struct bfd_session_params *bsp, vrf_id_t vrf_id);
* Configure the BFD session single/multi hop setting.
*
* NOTE:
- * If the TTL changed the session is removed and must be installed again
- * with `bfd_sess_install`.
+ * If the number of hops is changed the session is removed and must be
+ * installed again with `bfd_sess_install`.
*
* \param bsp BFD session parameters.
- * \param min_ttl minimum TTL value expected (255 for single hop, 254 for
- * multi hop with single hop, 253 for multi hop with two hops
- * and so on). See `BFD_SINGLE_HOP_TTL` and
- * `BFD_MULTI_HOP_MIN_TTL` for defaults.
- *
- * To simplify things if your protocol only knows the amount of hops it is
- * better to use `bfd_sess_set_hops` instead.
+ * \param hops maximum amount of hops expected (1 for single hop, 2 or
+ * more for multi hop).
*/
-void bfd_sess_set_mininum_ttl(struct bfd_session_params *bsp, uint8_t min_ttl);
-
-/** To use single hop the minimum TTL must be set to this. */
-#define BFD_SINGLE_HOP_TTL 255
-/** To use multi hop the minimum TTL must be set to this or less. */
-#define BFD_MULTI_HOP_MIN_TTL 254
-
-/**
- * This function is the inverted version of `bfd_sess_set_minimum_ttl`.
- * Instead of receiving the minimum expected TTL, it receives the amount of
- * hops the protocol will jump.
- *
- * NOTE:
- * If the TTL changed the session is removed and must be installed again
- * with `bfd_sess_install`.
- *
- * \param bsp BFD session parameters.
- * \param min_ttl minimum amount of hops expected (1 for single hop, 2 or
- * more for multi hop).
- */
-void bfd_sess_set_hop_count(struct bfd_session_params *bsp, uint8_t min_ttl);
+void bfd_sess_set_hop_count(struct bfd_session_params *bsp, uint8_t hops);
/**
* Configure the BFD session to set the Control Plane Independent bit.
@@ -278,17 +253,7 @@ void bfd_sess_uninstall(struct bfd_session_params *bsp);
enum bfd_session_state bfd_sess_status(const struct bfd_session_params *bsp);
/**
- * Get BFD session minimum TTL configured value.
- *
- * \param bsp session parameters.
- *
- * \returns configured minimum TTL.
- */
-uint8_t bfd_sess_minimum_ttl(const struct bfd_session_params *bsp);
-
-/**
- * Inverted version of `bfd_sess_minimum_ttl`. Gets the amount of hops in the
- * way to the peer.
+ * Get BFD session amount of hops configured value.
*
* \param bsp session parameters.
*
diff --git a/lib/if.h b/lib/if.h
index 506c14ff59..1012bf5557 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -399,16 +399,12 @@ struct connected {
/*
The ZEBRA_IFC_REAL flag should be set if and only if this address
exists in the kernel and is actually usable. (A case where it exists
- but
- is not yet usable would be IPv6 with DAD)
+ but is not yet usable would be IPv6 with DAD)
The ZEBRA_IFC_CONFIGURED flag should be set if and only if this
- address
- was configured by the user from inside quagga.
+ address was configured by the user from inside frr.
The ZEBRA_IFC_QUEUED flag should be set if and only if the address
- exists
- in the kernel. It may and should be set although the address might
- not be
- usable yet. (compare with ZEBRA_IFC_REAL)
+ exists in the kernel. It may and should be set although the
+ address might not be usable yet. (compare with ZEBRA_IFC_REAL)
The ZEBRA_IFC_DOWN flag is used to record that an address is
present, but down/unavailable.
*/
diff --git a/lib/libfrr.h b/lib/libfrr.h
index 3dc5d7af81..ed7e9c099e 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -94,7 +94,7 @@ struct frr_daemon_info {
const char *copyright;
char startinfo[128];
- struct quagga_signal_t *signals;
+ struct frr_signal_t *signals;
size_t n_signals;
struct zebra_privs_t *privs;
diff --git a/lib/log.c b/lib/log.c
index 8be171613e..fb12c08aae 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -64,7 +64,7 @@ const char *lookup_msg(const struct message *mz, int kz, const char *nf)
}
/* For time string format. */
-size_t quagga_timestamp(int timestamp_precision, char *buf, size_t buflen)
+size_t frr_timestamp(int timestamp_precision, char *buf, size_t buflen)
{
static struct {
time_t last;
diff --git a/lib/log.h b/lib/log.h
index 59f1742d01..3011fa9a99 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -102,9 +102,9 @@ extern void zlog_backtrace_sigsafe(int priority, void *program_counter);
It caches the most recent localtime result and can therefore
avoid multiple calls within the same second. If buflen is too small,
*buf will be set to '\0', and 0 will be returned. */
-#define QUAGGA_TIMESTAMP_LEN 40
-extern size_t quagga_timestamp(int timestamp_precision /* # subsecond digits */,
- char *buf, size_t buflen);
+#define FRR_TIMESTAMP_LEN 40
+extern size_t frr_timestamp(int timestamp_precision /* # subsecond digits */,
+ char *buf, size_t buflen);
extern void zlog_hexdump(const void *mem, size_t len);
extern const char *zlog_sanitize(char *buf, size_t bufsz, const void *in,
@@ -135,8 +135,8 @@ struct timestamp_control {
size_t len; /* length of rendered timestamp */
int precision; /* configuration parameter */
int already_rendered; /* should be initialized to 0 */
- char buf[QUAGGA_TIMESTAMP_LEN]; /* will contain the rendered timestamp
- */
+ char buf[FRR_TIMESTAMP_LEN]; /* will contain the rendered timestamp
+ */
};
/* Defines for use in command construction: */
diff --git a/lib/sigevent.c b/lib/sigevent.c
index 6710527ae9..00bc31f517 100644
--- a/lib/sigevent.c
+++ b/lib/sigevent.c
@@ -36,10 +36,10 @@
/* master signals descriptor struct */
-static struct quagga_sigevent_master_t {
+static struct frr_sigevent_master_t {
struct thread *t;
- struct quagga_signal_t *signals;
+ struct frr_signal_t *signals;
int sigc;
volatile sig_atomic_t caught;
@@ -48,10 +48,10 @@ static struct quagga_sigevent_master_t {
/* Generic signal handler
* Schedules signal event thread
*/
-static void quagga_signal_handler(int signo)
+static void frr_signal_handler(int signo)
{
int i;
- struct quagga_signal_t *sig;
+ struct frr_signal_t *sig;
for (i = 0; i < sigmaster.sigc; i++) {
sig = &(sigmaster.signals[i]);
@@ -91,9 +91,9 @@ bool frr_sigevent_check(sigset_t *setp)
}
/* check if signals have been caught and run appropriate handlers */
-int quagga_sigevent_process(void)
+int frr_sigevent_process(void)
{
- struct quagga_signal_t *sig;
+ struct frr_signal_t *sig;
int i;
#ifdef SIGEVENT_BLOCK_SIGNALS
/* shouldn't need to block signals, but potentially may be needed */
@@ -110,7 +110,7 @@ int quagga_sigevent_process(void)
if ((sigprocmask(SIG_BLOCK, &newmask, &oldmask)) < 0) {
flog_err_sys(EC_LIB_SYSTEM_CALL,
- "quagga_signal_timer: couldnt block signals!");
+ "frr_signal_timer: couldnt block signals!");
return -1;
}
#endif /* SIGEVENT_BLOCK_SIGNALS */
@@ -143,15 +143,15 @@ int quagga_sigevent_process(void)
#ifdef SIGEVENT_SCHEDULE_THREAD
/* timer thread to check signals. shouldn't be needed */
-int quagga_signal_timer(struct thread *t)
+int frr_signal_timer(struct thread *t)
{
- struct quagga_sigevent_master_t *sigm;
+ struct frr_sigevent_master_t *sigm;
sigm = THREAD_ARG(t);
sigm->t = NULL;
- thread_add_timer(sigm->t->master, quagga_signal_timer, &sigmaster,
- QUAGGA_SIGNAL_TIMER_INTERVAL, &sigm->t);
- return quagga_sigevent_process();
+ thread_add_timer(sigm->t->master, frr_signal_timer, &sigmaster,
+ FRR_SIGNAL_TIMER_INTERVAL, &sigm->t);
+ return frr_sigevent_process();
}
#endif /* SIGEVENT_SCHEDULE_THREAD */
@@ -163,7 +163,7 @@ static int signal_set(int signo)
struct sigaction sig;
struct sigaction osig;
- sig.sa_handler = &quagga_signal_handler;
+ sig.sa_handler = &frr_signal_handler;
sigfillset(&sig.sa_mask);
sig.sa_flags = 0;
if (signo == SIGALRM) {
@@ -348,11 +348,11 @@ static void trap_default_signals(void)
}
void signal_init(struct thread_master *m, int sigc,
- struct quagga_signal_t signals[])
+ struct frr_signal_t signals[])
{
int i = 0;
- struct quagga_signal_t *sig;
+ struct frr_signal_t *sig;
/* First establish some default handlers that can be overridden by
the application. */
@@ -370,7 +370,7 @@ void signal_init(struct thread_master *m, int sigc,
#ifdef SIGEVENT_SCHEDULE_THREAD
sigmaster.t = NULL;
- thread_add_timer(m, quagga_signal_timer, &sigmaster,
- QUAGGA_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
+ thread_add_timer(m, frr_signal_timer, &sigmaster,
+ FRR_SIGNAL_TIMER_INTERVAL, &sigmaster.t);
#endif /* SIGEVENT_SCHEDULE_THREAD */
}
diff --git a/lib/sigevent.h b/lib/sigevent.h
index 4a39b22889..dd1ee99587 100644
--- a/lib/sigevent.h
+++ b/lib/sigevent.h
@@ -20,8 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _QUAGGA_SIGNAL_H
-#define _QUAGGA_SIGNAL_H
+#ifndef _FRR_SIGNAL_H
+#define _FRR_SIGNAL_H
#include <thread.h>
@@ -29,9 +29,9 @@
extern "C" {
#endif
-#define QUAGGA_SIGNAL_TIMER_INTERVAL 2L
+#define FRR_SIGNAL_TIMER_INTERVAL 2L
-struct quagga_signal_t {
+struct frr_signal_t {
int signal; /* signal number */
void (*handler)(void); /* handler to call */
@@ -42,11 +42,11 @@ struct quagga_signal_t {
* takes:
* - pointer to valid struct thread_master
* - number of elements in passed in signals array
- * - array of quagga_signal_t's describing signals to handle
+ * - array of frr_signal_t's describing signals to handle
* and handlers to use for each signal
*/
extern void signal_init(struct thread_master *m, int sigc,
- struct quagga_signal_t *signals);
+ struct frr_signal_t *signals);
/*
@@ -58,10 +58,10 @@ extern void signal_init(struct thread_master *m, int sigc,
bool frr_sigevent_check(sigset_t *setp);
/* check whether there are signals to handle, process any found */
-extern int quagga_sigevent_process(void);
+extern int frr_sigevent_process(void);
#ifdef __cplusplus
}
#endif
-#endif /* _QUAGGA_SIGNAL_H */
+#endif /* _FRR_SIGNAL_H */
diff --git a/lib/subdir.am b/lib/subdir.am
index dab5fb9e83..bb10d71ed1 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -3,7 +3,7 @@
#
lib_LTLIBRARIES += lib/libfrr.la
lib_libfrr_la_LDFLAGS = $(LIB_LDFLAGS) -version-info 0:0:0 -Xlinker -e_libfrr_version
-lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBM)
+lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBCRYPT) $(LIBDL) $(LIBM)
lib_libfrr_la_SOURCES = \
lib/agg_table.c \
@@ -130,7 +130,6 @@ nodist_lib_libfrr_la_SOURCES = \
yang/ietf/ietf-interfaces.yang.c \
yang/ietf/ietf-bgp-types.yang.c \
yang/frr-module-translator.yang.c \
- yang/frr-nexthop.yang.c \
# end
vtysh_scan += \
diff --git a/lib/thread.c b/lib/thread.c
index 5dbba6363d..7b223ed6de 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1695,7 +1695,7 @@ struct thread *thread_fetch(struct thread_master *m, struct thread *fetch)
do {
/* Handle signals if any */
if (m->handle_signals)
- quagga_sigevent_process();
+ frr_sigevent_process();
pthread_mutex_lock(&m->mtx);
diff --git a/lib/vty.c b/lib/vty.c
index 388af8ebaf..b702fa7850 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -283,10 +283,10 @@ done:
/* Output current time to the vty. */
void vty_time_print(struct vty *vty, int cr)
{
- char buf[QUAGGA_TIMESTAMP_LEN];
+ char buf[FRR_TIMESTAMP_LEN];
- if (quagga_timestamp(0, buf, sizeof(buf)) == 0) {
- zlog_info("quagga_timestamp error");
+ if (frr_timestamp(0, buf, sizeof(buf)) == 0) {
+ zlog_info("frr_timestamp error");
return;
}
if (cr)
diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c
index 4c98f02e1d..d8f14a3fc0 100644
--- a/nhrpd/nhrp_main.c
+++ b/nhrpd/nhrp_main.c
@@ -101,7 +101,7 @@ static void nhrp_request_stop(void)
exit(0);
}
-static struct quagga_signal_t sighandlers[] = {
+static struct frr_signal_t sighandlers[] = {
{
.signal = SIGUSR1,
.handler = &nhrp_sigusr1,
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 54cf142ba8..165a764c38 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -148,7 +148,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t ospf6_signals[] = {
+struct frr_signal_t ospf6_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 257429ebe8..2f9787bca5 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -112,7 +112,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t ospf_signals[] = {
+struct frr_signal_t ospf_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 1ebb14f2a0..ede0ad39e6 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -398,7 +398,7 @@ static int ospf_make_md5_digest(struct ospf_interface *oi,
/* We do this here so when we dup a packet, we don't have to
waste CPU rewriting other headers.
- Note that quagga_time /deliberately/ is not used here */
+ Note that frr_time /deliberately/ is not used here */
t = (time(NULL) & 0xFFFFFFFF);
if (t > oi->crypt_seqnum)
oi->crypt_seqnum = t;
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index a1ea4e45d7..7ec3db7894 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -2090,7 +2090,7 @@ static struct ospf_neighbor *ospfNbrLookup(struct variable *v, oid *name,
return NULL;
}
-/* map internal quagga neighbor states to official MIB values:
+/* map internal frr neighbor states to official MIB values:
ospfNbrState OBJECT-TYPE
SYNTAX INTEGER {
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 1e1057dc39..dd0a49c9bc 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -192,7 +192,7 @@ void ospf_process_refresh_data(struct ospf *ospf, bool reset)
hit
asserts in ospf_refresher_unregister_lsa(). This step is
needed
- because the current quagga code does look-up for
+ because the current frr code does look-up for
self-originated LSAs
based on the self router-id alone but expects OSPF_LSA_SELF
to be
diff --git a/pathd/path_main.c b/pathd/path_main.c
index 7b702cca31..0a71c80ef0 100644
--- a/pathd/path_main.c
+++ b/pathd/path_main.c
@@ -83,7 +83,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t path_signals[] = {
+struct frr_signal_t path_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c
index c7cbbb4462..59aa3676bf 100644
--- a/pbrd/pbr_main.c
+++ b/pbrd/pbr_main.c
@@ -95,7 +95,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t pbr_signals[] = {
+struct frr_signal_t pbr_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/pimd/pim_signals.c b/pimd/pim_signals.c
index 38387d38c3..47220ccac7 100644
--- a/pimd/pim_signals.c
+++ b/pimd/pim_signals.c
@@ -57,7 +57,7 @@ static void pim_sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t pimd_signals[] = {
+struct frr_signal_t pimd_signals[] = {
{
.signal = SIGHUP,
.handler = &pim_sighup,
diff --git a/pimd/pim_signals.h b/pimd/pim_signals.h
index a82915691b..ebc5b8eb21 100644
--- a/pimd/pim_signals.h
+++ b/pimd/pim_signals.h
@@ -21,6 +21,6 @@
#define PIM_SIGNALS_H
#include "sigevent.h"
-extern struct quagga_signal_t pimd_signals[];
+extern struct frr_signal_t pimd_signals[];
#endif /* PIM_SIGNALS_H */
diff --git a/pimd/subdir.am b/pimd/subdir.am
index 9910642ffa..f8bc0ff081 100644
--- a/pimd/subdir.am
+++ b/pimd/subdir.am
@@ -3,7 +3,6 @@
#
if PIMD
-noinst_LIBRARIES += pimd/libpim.a
sbin_PROGRAMS += pimd/pimd
bin_PROGRAMS += pimd/mtracebis
noinst_PROGRAMS += pimd/test_igmpv3_join
@@ -13,7 +12,7 @@ man8 += $(MANBUILD)/frr-pimd.8
man8 += $(MANBUILD)/mtracebis.8
endif
-pimd_libpim_a_SOURCES = \
+pimd_pimd_SOURCES = \
pimd/pim_assert.c \
pimd/pim_bfd.c \
pimd/pim_br.c \
@@ -33,6 +32,7 @@ pimd_libpim_a_SOURCES = \
pimd/pim_join.c \
pimd/pim_jp_agg.c \
pimd/pim_macro.c \
+ pimd/pim_main.c \
pimd/pim_memory.c \
pimd/pim_mlag.c \
pimd/pim_mroute.c \
@@ -66,6 +66,9 @@ pimd_libpim_a_SOURCES = \
pimd/pim_vxlan.c \
pimd/pim_zpthread.c \
pimd/pimd.c \
+ # end
+
+nodist_pimd_pimd_SOURCES = \
yang/frr-pim.yang.c \
yang/frr-pim-rp.yang.c \
yang/frr-igmp.yang.c \
@@ -131,14 +134,7 @@ clippy_scan += \
pimd/pim_cmd.c \
# end
-nodist_pimd_pimd_SOURCES = \
- yang/frr-igmp.yang.c \
- yang/frr-pim.yang.c \
- yang/frr-pim-rp.yang.c \
- # end
-
-pimd_pimd_LDADD = pimd/libpim.a lib/libfrr.la $(LIBCAP)
-pimd_pimd_SOURCES = pimd/pim_main.c
+pimd_pimd_LDADD = lib/libfrr.la $(LIBCAP)
pimd_test_igmpv3_join_LDADD = lib/libfrr.la
pimd_test_igmpv3_join_SOURCES = pimd/test_igmpv3_join.c
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index 7b9146b13a..6fb5ca95a9 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -94,7 +94,7 @@ static void sigusr1(void)
zlog_rotate();
}
-static struct quagga_signal_t ripd_signals[] = {
+static struct frr_signal_t ripd_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/ripd/subdir.am b/ripd/subdir.am
index b43e369ab2..b00c375888 100644
--- a/ripd/subdir.am
+++ b/ripd/subdir.am
@@ -3,7 +3,6 @@
#
if RIPD
-noinst_LIBRARIES += ripd/librip.a
sbin_PROGRAMS += ripd/ripd
vtysh_scan += \
ripd/rip_cli.c \
@@ -18,12 +17,13 @@ endif
man8 += $(MANBUILD)/frr-ripd.8
endif
-ripd_librip_a_SOURCES = \
+ripd_ripd_SOURCES = \
ripd/rip_cli.c \
ripd/rip_debug.c \
ripd/rip_errors.c \
ripd/rip_interface.c \
ripd/rip_offset.c \
+ ripd/rip_main.c \
ripd/rip_nb.c \
ripd/rip_nb_config.c \
ripd/rip_nb_rpcs.c \
@@ -47,10 +47,7 @@ noinst_HEADERS += \
ripd/ripd.h \
# end
-ripd_ripd_LDADD = ripd/librip.a lib/libfrr.la $(LIBCAP)
-ripd_ripd_SOURCES = \
- ripd/rip_main.c \
- # end
+ripd_ripd_LDADD = lib/libfrr.la $(LIBCAP)
nodist_ripd_ripd_SOURCES = \
yang/frr-ripd.yang.c \
# end
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 34cd4ab0a7..bc169785a9 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -94,7 +94,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t ripng_signals[] = {
+struct frr_signal_t ripng_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/ripngd/subdir.am b/ripngd/subdir.am
index 9d8d27d4cc..a4db3e5a6b 100644
--- a/ripngd/subdir.am
+++ b/ripngd/subdir.am
@@ -3,7 +3,6 @@
#
if RIPNGD
-noinst_LIBRARIES += ripngd/libripng.a
sbin_PROGRAMS += ripngd/ripngd
vtysh_scan += \
ripngd/ripng_cli.c \
@@ -14,12 +13,13 @@ vtysh_daemons += ripngd
man8 += $(MANBUILD)/frr-ripngd.8
endif
-ripngd_libripng_a_SOURCES = \
+ripngd_ripngd_SOURCES = \
ripngd/ripng_cli.c \
ripngd/ripng_debug.c \
ripngd/ripng_interface.c \
ripngd/ripng_nexthop.c \
ripngd/ripng_offset.c \
+ ripngd/ripng_main.c \
ripngd/ripng_nb.c \
ripngd/ripng_nb_config.c \
ripngd/ripng_nb_rpcs.c \
@@ -43,10 +43,7 @@ noinst_HEADERS += \
ripngd/ripngd.h \
# end
-ripngd_ripngd_LDADD = ripngd/libripng.a lib/libfrr.la $(LIBCAP)
-ripngd_ripngd_SOURCES = \
- ripngd/ripng_main.c \
- # end
+ripngd_ripngd_LDADD = lib/libfrr.la $(LIBCAP)
nodist_ripngd_ripngd_SOURCES = \
yang/frr-ripngd.yang.c \
# end
diff --git a/sharpd/sharp_main.c b/sharpd/sharp_main.c
index a646c313e4..8494f479c4 100644
--- a/sharpd/sharp_main.c
+++ b/sharpd/sharp_main.c
@@ -94,7 +94,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t sharp_signals[] = {
+struct frr_signal_t sharp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/staticd/static_main.c b/staticd/static_main.c
index f7a15462a0..6051b2df1c 100644
--- a/staticd/static_main.c
+++ b/staticd/static_main.c
@@ -91,7 +91,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t static_signals[] = {
+struct frr_signal_t static_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/tests/bgpd/subdir.am b/tests/bgpd/subdir.am
new file mode 100644
index 0000000000..5148e7e440
--- /dev/null
+++ b/tests/bgpd/subdir.am
@@ -0,0 +1,82 @@
+if !BGPD
+PYTEST_IGNORE += --ignore=bgpd/
+endif
+BGP_TEST_LDADD = bgpd/libbgp.a $(RFPLDADD) $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) $(UST_LIBS) -lm
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_aspath
+endif
+tests_bgpd_test_aspath_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_aspath_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_aspath_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_aspath_SOURCES = tests/bgpd/test_aspath.c
+EXTRA_DIST += tests/bgpd/test_aspath.py
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_bgp_table
+endif
+tests_bgpd_test_bgp_table_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_bgp_table_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_bgp_table_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_bgp_table_SOURCES = tests/bgpd/test_bgp_table.c
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_capability
+endif
+tests_bgpd_test_capability_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_capability_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_capability_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_capability_SOURCES = tests/bgpd/test_capability.c
+EXTRA_DIST += tests/bgpd/test_capability.py
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_ecommunity
+endif
+tests_bgpd_test_ecommunity_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_ecommunity_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_ecommunity_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_ecommunity_SOURCES = tests/bgpd/test_ecommunity.c
+EXTRA_DIST += tests/bgpd/test_ecommunity.py
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_mp_attr
+endif
+tests_bgpd_test_mp_attr_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_mp_attr_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_mp_attr_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_mp_attr_SOURCES = tests/bgpd/test_mp_attr.c
+EXTRA_DIST += tests/bgpd/test_mp_attr.py
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_mpath
+endif
+tests_bgpd_test_mpath_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_mpath_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_mpath_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_mpath_SOURCES = tests/bgpd/test_mpath.c
+EXTRA_DIST += tests/bgpd/test_mpath.py
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_packet
+endif
+tests_bgpd_test_packet_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_packet_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_packet_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_packet_SOURCES = tests/bgpd/test_packet.c
+
+
+if BGPD
+check_PROGRAMS += tests/bgpd/test_peer_attr
+endif
+tests_bgpd_test_peer_attr_CFLAGS = $(TESTS_CFLAGS)
+tests_bgpd_test_peer_attr_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_bgpd_test_peer_attr_LDADD = $(BGP_TEST_LDADD)
+tests_bgpd_test_peer_attr_SOURCES = tests/bgpd/test_peer_attr.c
+EXTRA_DIST += tests/bgpd/test_peer_attr.py
diff --git a/tests/bgpd/test_mpath.c b/tests/bgpd/test_mpath.c
index d1ca356b94..b93cbd8e5a 100644
--- a/tests/bgpd/test_mpath.c
+++ b/tests/bgpd/test_mpath.c
@@ -330,7 +330,7 @@ static int run_bgp_path_info_mpath_update(testcase_t *t)
bgp_mp_list_add(&mp_list, &test_mp_list_info[1]);
new_best = &test_mp_list_info[3];
old_best = NULL;
- bgp_path_info_mpath_update(&test_rn, new_best, old_best, &mp_list,
+ bgp_path_info_mpath_update(NULL, &test_rn, new_best, old_best, &mp_list,
&mp_cfg);
bgp_mp_list_clear(&mp_list);
EXPECT_TRUE(bgp_path_info_mpath_count(new_best) == 2, test_result);
@@ -345,7 +345,7 @@ static int run_bgp_path_info_mpath_update(testcase_t *t)
bgp_mp_list_add(&mp_list, &test_mp_list_info[1]);
new_best = &test_mp_list_info[0];
old_best = &test_mp_list_info[3];
- bgp_path_info_mpath_update(&test_rn, new_best, old_best, &mp_list,
+ bgp_path_info_mpath_update(NULL, &test_rn, new_best, old_best, &mp_list,
&mp_cfg);
bgp_mp_list_clear(&mp_list);
EXPECT_TRUE(bgp_path_info_mpath_count(new_best) == 1, test_result);
diff --git a/tests/isisd/subdir.am b/tests/isisd/subdir.am
new file mode 100644
index 0000000000..2f9ce81f16
--- /dev/null
+++ b/tests/isisd/subdir.am
@@ -0,0 +1,66 @@
+if !ISISD
+PYTEST_IGNORE += --ignore=isisd/
+endif
+ISISD_TEST_LDADD = isisd/libisis.a $(ALL_TESTS_LDADD)
+noinst_HEADERS += \
+ tests/isisd/test_common.h \
+ # end
+
+
+if ISISD
+check_PROGRAMS += tests/isisd/test_fuzz_isis_tlv
+endif
+tests_isisd_test_fuzz_isis_tlv_CFLAGS = $(TESTS_CFLAGS) -I$(top_builddir)/tests/isisd
+tests_isisd_test_fuzz_isis_tlv_CPPFLAGS = $(TESTS_CPPFLAGS) -I$(top_builddir)/tests/isisd
+tests_isisd_test_fuzz_isis_tlv_LDADD = $(ISISD_TEST_LDADD)
+tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv.c tests/isisd/test_common.c
+nodist_tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv_tests.h
+EXTRA_DIST += \
+ tests/isisd/test_fuzz_isis_tlv.py \
+ tests/isisd/test_fuzz_isis_tlv_tests.h.gz \
+ # end
+
+tests/isisd/test_fuzz_isis_tlv_tests.h: $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
+ @mkdir -p tests/isisd
+ $(AM_V_GEN)gzip -d < $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz > "$@"
+CLEANFILES += tests/isisd/test_fuzz_isis_tlv_tests.h
+
+tests/isisd/tests_isisd_test_fuzz_isis_tlv-test_fuzz_isis_tlv.$(OBJEXT): \
+ tests/isisd/test_fuzz_isis_tlv_tests.h
+tests/isisd/test_fuzz_isis_tlv-test_fuzz_isis_tlv.$(OBJEXT): \
+ tests/isisd/test_fuzz_isis_tlv_tests.h
+
+
+if ISISD
+check_PROGRAMS += tests/isisd/test_isis_lspdb
+endif
+tests_isisd_test_isis_lspdb_CFLAGS = $(TESTS_CFLAGS)
+tests_isisd_test_isis_lspdb_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_isisd_test_isis_lspdb_LDADD = $(ISISD_TEST_LDADD)
+tests_isisd_test_isis_lspdb_SOURCES = tests/isisd/test_isis_lspdb.c tests/isisd/test_common.c
+EXTRA_DIST += tests/isisd/test_isis_lspdb.py
+
+
+if ISISD
+check_PROGRAMS += tests/isisd/test_isis_spf
+endif
+tests_isisd_test_isis_spf_CFLAGS = $(TESTS_CFLAGS)
+tests_isisd_test_isis_spf_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_isisd_test_isis_spf_LDADD = $(ISISD_TEST_LDADD)
+tests_isisd_test_isis_spf_SOURCES = tests/isisd/test_isis_spf.c tests/isisd/test_common.c tests/isisd/test_topologies.c
+nodist_tests_isisd_test_isis_spf_SOURCES = yang/frr-isisd.yang.c
+EXTRA_DIST += \
+ tests/isisd/test_isis_spf.py \
+ tests/isisd/test_isis_spf.in \
+ tests/isisd/test_isis_spf.refout \
+ # end
+
+
+if ISISD
+check_PROGRAMS += tests/isisd/test_isis_vertex_queue
+endif
+tests_isisd_test_isis_vertex_queue_CFLAGS = $(TESTS_CFLAGS)
+tests_isisd_test_isis_vertex_queue_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_isisd_test_isis_vertex_queue_LDADD = $(ISISD_TEST_LDADD)
+tests_isisd_test_isis_vertex_queue_SOURCES = tests/isisd/test_isis_vertex_queue.c tests/isisd/test_common.c
+EXTRA_DIST += tests/isisd/test_isis_vertex_queue.py
diff --git a/tests/lib/subdir.am b/tests/lib/subdir.am
new file mode 100644
index 0000000000..00fe93278b
--- /dev/null
+++ b/tests/lib/subdir.am
@@ -0,0 +1,364 @@
+##############################################################################
+if SCRIPTING
+check_PROGRAMS += tests/lib/test_frrlua
+endif
+tests_lib_test_frrlua_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_frrlua_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_frrlua_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_frrlua_SOURCES = tests/lib/test_frrlua.c
+EXTRA_DIST += tests/lib/test_frrlua.py
+
+if SCRIPTING
+check_PROGRAMS += tests/lib/test_frrscript
+endif
+tests_lib_test_frrscript_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_frrscript_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_frrscript_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_frrscript_SOURCES = tests/lib/test_frrscript.c
+EXTRA_DIST += tests/lib/test_frrscript.py
+
+
+##############################################################################
+GRPC_TESTS_LDADD = staticd/libstatic.a grpc/libfrrgrpc_pb.la -lgrpc++ -lprotobuf $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) -lm
+
+if GRPC
+check_PROGRAMS += tests/lib/test_grpc
+endif
+tests_lib_test_grpc_CXXFLAGS = $(WERROR) $(TESTS_CXXFLAGS)
+tests_lib_test_grpc_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_grpc_LDADD = $(GRPC_TESTS_LDADD)
+tests_lib_test_grpc_SOURCES = tests/lib/test_grpc.cpp
+
+
+##############################################################################
+if ZEROMQ
+check_PROGRAMS += tests/lib/test_zmq
+endif
+tests_lib_test_zmq_CFLAGS = $(TESTS_CFLAGS) $(ZEROMQ_CFLAGS)
+tests_lib_test_zmq_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_zmq_LDADD = lib/libfrrzmq.la $(ALL_TESTS_LDADD) $(ZEROMQ_LIBS)
+tests_lib_test_zmq_SOURCES = tests/lib/test_zmq.c
+
+
+##############################################################################
+if CARES
+check_PROGRAMS += tests/lib/test_resolver
+endif
+tests_lib_test_resolver_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_resolver_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_resolver_LDADD = $(ALL_TESTS_LDADD) lib/libfrrcares.la
+tests_lib_test_resolver_SOURCES = tests/lib/test_resolver.c tests/lib/cli/common_cli.c
+
+
+##############################################################################
+noinst_HEADERS += \
+ tests/helpers/c/prng.h \
+ tests/helpers/c/tests.h \
+ tests/lib/cli/common_cli.h \
+ # end
+
+
+check_PROGRAMS += tests/lib/cxxcompat
+tests_lib_cxxcompat_CFLAGS = $(TESTS_CFLAGS) $(CXX_COMPAT_CFLAGS) $(WERROR)
+tests_lib_cxxcompat_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_cxxcompat_SOURCES = tests/lib/cxxcompat.c
+tests_lib_cxxcompat_LDADD = $(ALL_TESTS_LDADD)
+
+
+check_PROGRAMS += tests/lib/cli/test_cli
+tests_lib_cli_test_cli_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_cli_test_cli_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_cli_test_cli_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_cli_test_cli_SOURCES = tests/lib/cli/test_cli.c tests/lib/cli/common_cli.c
+clippy_scan += tests/lib/cli/test_cli.c
+EXTRA_DIST += \
+ tests/lib/cli/test_cli.in \
+ tests/lib/cli/test_cli.py \
+ tests/lib/cli/test_cli.refout \
+ # end
+
+
+check_PROGRAMS += tests/lib/cli/test_commands
+tests_lib_cli_test_commands_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_cli_test_commands_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_cli_test_commands_LDADD = $(ALL_TESTS_LDADD)
+nodist_tests_lib_cli_test_commands_SOURCES = tests/lib/cli/test_commands_defun.c
+tests_lib_cli_test_commands_SOURCES = tests/lib/cli/test_commands.c tests/helpers/c/prng.c
+tests/lib/cli/test_commands_defun.c: vtysh/vtysh_cmd.c
+ @mkdir -p tests/lib/cli
+ $(AM_V_GEN)sed \
+ -e 's%"vtysh/vtysh\.h"%"tests/helpers/c/tests.h"%' \
+ -e 's/vtysh_init_cmd/test_init_cmd/' \
+ -e 's/VTYSH_[A-Z][A-Z_0-9]*/0/g' \
+ < vtysh/vtysh_cmd.c \
+ > "$@"
+CLEANFILES += tests/lib/cli/test_commands_defun.c
+EXTRA_DIST += \
+ tests/lib/cli/test_commands.in \
+ tests/lib/cli/test_commands.py \
+ tests/lib/cli/test_commands.refout \
+ # end
+
+
+check_PROGRAMS += tests/lib/northbound/test_oper_data
+tests_lib_northbound_test_oper_data_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_northbound_test_oper_data_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_northbound_test_oper_data_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_northbound_test_oper_data_SOURCES = tests/lib/northbound/test_oper_data.c
+nodist_tests_lib_northbound_test_oper_data_SOURCES = yang/frr-test-module.yang.c
+EXTRA_DIST += \
+ tests/lib/northbound/test_oper_data.in \
+ tests/lib/northbound/test_oper_data.py \
+ tests/lib/northbound/test_oper_data.refout \
+ # end
+
+
+check_PROGRAMS += tests/lib/test_assert
+tests_lib_test_assert_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_assert_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_assert_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_assert_SOURCES = tests/lib/test_assert.c
+EXTRA_DIST += tests/lib/test_assert.py
+
+
+check_PROGRAMS += tests/lib/test_atomlist
+tests_lib_test_atomlist_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_atomlist_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_atomlist_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_atomlist_SOURCES = tests/lib/test_atomlist.c
+EXTRA_DIST += tests/lib/test_atomlist.py
+
+
+check_PROGRAMS += tests/lib/test_buffer
+tests_lib_test_buffer_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_buffer_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_buffer_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_buffer_SOURCES = tests/lib/test_buffer.c
+
+
+check_PROGRAMS += tests/lib/test_checksum
+tests_lib_test_checksum_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_checksum_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_checksum_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_checksum_SOURCES = tests/lib/test_checksum.c
+
+
+check_PROGRAMS += tests/lib/test_graph
+tests_lib_test_graph_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_graph_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_graph_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_graph_SOURCES = tests/lib/test_graph.c
+EXTRA_DIST += \
+ tests/lib/test_graph.py \
+ tests/lib/test_graph.refout \
+ # end
+
+
+check_PROGRAMS += tests/lib/test_heavy
+tests_lib_test_heavy_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_heavy_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_heavy_LDADD = $(ALL_TESTS_LDADD) -lm
+tests_lib_test_heavy_SOURCES = tests/lib/test_heavy.c tests/helpers/c/main.c
+
+
+check_PROGRAMS += tests/lib/test_heavy_thread
+tests_lib_test_heavy_thread_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_heavy_thread_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_heavy_thread_LDADD = $(ALL_TESTS_LDADD) -lm
+tests_lib_test_heavy_thread_SOURCES = tests/lib/test_heavy_thread.c tests/helpers/c/main.c
+
+
+check_PROGRAMS += tests/lib/test_heavy_wq
+tests_lib_test_heavy_wq_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_heavy_wq_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_heavy_wq_LDADD = $(ALL_TESTS_LDADD) -lm
+tests_lib_test_heavy_wq_SOURCES = tests/lib/test_heavy_wq.c tests/helpers/c/main.c
+
+
+check_PROGRAMS += tests/lib/test_idalloc
+tests_lib_test_idalloc_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_idalloc_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_idalloc_SOURCES = tests/lib/test_idalloc.c
+
+
+check_PROGRAMS += tests/lib/test_memory
+tests_lib_test_memory_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_memory_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_memory_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_memory_SOURCES = tests/lib/test_memory.c
+
+
+check_PROGRAMS += tests/lib/test_nexthop_iter
+tests_lib_test_nexthop_iter_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_nexthop_iter_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_nexthop_iter_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_nexthop_iter_SOURCES = tests/lib/test_nexthop_iter.c tests/helpers/c/prng.c
+EXTRA_DIST += tests/lib/test_nexthop_iter.py
+
+
+check_PROGRAMS += tests/lib/test_nexthop
+tests_lib_test_nexthop_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_nexthop_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_nexthop_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_nexthop_SOURCES = tests/lib/test_nexthop.c
+EXTRA_DIST += tests/lib/test_nexthop.py
+
+
+check_PROGRAMS += tests/lib/test_ntop
+tests_lib_test_ntop_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_ntop_CPPFLAGS = $(CPPFLAGS_BASE) # no assert override
+tests_lib_test_ntop_LDADD = # none
+tests_lib_test_ntop_SOURCES = tests/lib/test_ntop.c tests/helpers/c/prng.c
+EXTRA_DIST += tests/lib/test_ntop.py
+
+
+check_PROGRAMS += tests/lib/test_plist
+tests_lib_test_plist_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_plist_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_plist_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_plist_SOURCES = tests/lib/test_plist.c tests/lib/cli/common_cli.c
+
+
+check_PROGRAMS += tests/lib/test_prefix2str
+tests_lib_test_prefix2str_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_prefix2str_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_prefix2str_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_prefix2str_SOURCES = tests/lib/test_prefix2str.c tests/helpers/c/prng.c
+EXTRA_DIST += tests/lib/test_prefix2str.py
+
+
+check_PROGRAMS += tests/lib/test_printfrr
+tests_lib_test_printfrr_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_printfrr_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_printfrr_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_printfrr_SOURCES = tests/lib/test_printfrr.c
+EXTRA_DIST += tests/lib/test_printfrr.py
+
+
+check_PROGRAMS += tests/lib/test_privs
+tests_lib_test_privs_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_privs_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_privs_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_privs_SOURCES = tests/lib/test_privs.c
+
+
+check_PROGRAMS += tests/lib/test_ringbuf
+tests_lib_test_ringbuf_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_ringbuf_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_ringbuf_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_ringbuf_SOURCES = tests/lib/test_ringbuf.c
+EXTRA_DIST += tests/lib/test_ringbuf.py
+
+
+check_PROGRAMS += tests/lib/test_segv
+tests_lib_test_segv_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_segv_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_segv_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_segv_SOURCES = tests/lib/test_segv.c
+
+
+check_PROGRAMS += tests/lib/test_seqlock
+tests_lib_test_seqlock_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_seqlock_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_seqlock_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_seqlock_SOURCES = tests/lib/test_seqlock.c
+
+
+check_PROGRAMS += tests/lib/test_sig
+tests_lib_test_sig_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_sig_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_sig_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_sig_SOURCES = tests/lib/test_sig.c
+
+
+check_PROGRAMS += tests/lib/test_skiplist
+tests_lib_test_skiplist_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_skiplist_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_skiplist_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_skiplist_SOURCES = tests/lib/test_skiplist.c
+
+
+check_PROGRAMS += tests/lib/test_srcdest_table
+tests_lib_test_srcdest_table_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_srcdest_table_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_srcdest_table_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_srcdest_table_SOURCES = tests/lib/test_srcdest_table.c tests/helpers/c/prng.c
+EXTRA_DIST += tests/lib/test_srcdest_table.py
+
+
+check_PROGRAMS += tests/lib/test_stream
+tests_lib_test_stream_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_stream_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_stream_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_stream_SOURCES = tests/lib/test_stream.c
+EXTRA_DIST += \
+ tests/lib/test_stream.py \
+ tests/lib/test_stream.refout \
+ # end
+
+
+check_PROGRAMS += tests/lib/test_table
+tests_lib_test_table_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_table_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_table_LDADD = $(ALL_TESTS_LDADD) -lm
+tests_lib_test_table_SOURCES = tests/lib/test_table.c
+EXTRA_DIST += tests/lib/test_table.py
+
+
+check_PROGRAMS += tests/lib/test_timer_correctness
+tests_lib_test_timer_correctness_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_timer_correctness_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_timer_correctness_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_timer_correctness_SOURCES = tests/lib/test_timer_correctness.c tests/helpers/c/prng.c
+EXTRA_DIST += tests/lib/test_timer_correctness.py
+
+
+check_PROGRAMS += tests/lib/test_timer_performance
+tests_lib_test_timer_performance_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_timer_performance_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_timer_performance_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_timer_performance_SOURCES = tests/lib/test_timer_performance.c tests/helpers/c/prng.c
+
+
+check_PROGRAMS += tests/lib/test_ttable
+tests_lib_test_ttable_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_ttable_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_ttable_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_ttable_SOURCES = tests/lib/test_ttable.c
+EXTRA_DIST += \
+ tests/lib/test_ttable.py \
+ tests/lib/test_ttable.refout \
+ # end
+
+
+check_PROGRAMS += tests/lib/test_typelist
+tests_lib_test_typelist_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_typelist_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_typelist_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_typelist_SOURCES = tests/lib/test_typelist.c tests/helpers/c/prng.c
+noinst_HEADERS += tests/lib/test_typelist.h
+EXTRA_DIST += tests/lib/test_typelist.py
+
+
+check_PROGRAMS += tests/lib/test_versioncmp
+tests_lib_test_versioncmp_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_versioncmp_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_versioncmp_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_versioncmp_SOURCES = tests/lib/test_versioncmp.c
+EXTRA_DIST += tests/lib/test_versioncmp.py
+
+
+check_PROGRAMS += tests/lib/test_xref
+tests_lib_test_xref_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_xref_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_xref_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_xref_SOURCES = tests/lib/test_xref.c
+EXTRA_DIST += tests/lib/test_xref.py
+
+
+check_PROGRAMS += tests/lib/test_zlog
+tests_lib_test_zlog_CFLAGS = $(TESTS_CFLAGS)
+tests_lib_test_zlog_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_lib_test_zlog_LDADD = $(ALL_TESTS_LDADD)
+tests_lib_test_zlog_SOURCES = tests/lib/test_zlog.c
+EXTRA_DIST += tests/lib/test_zlog.py
diff --git a/tests/lib/test_printfrr.c b/tests/lib/test_printfrr.c
index 06996a2f13..8413b7b372 100644
--- a/tests/lib/test_printfrr.c
+++ b/tests/lib/test_printfrr.c
@@ -259,8 +259,8 @@ int main(int argc, char **argv)
*
* gateway addresses only for now: interfaces require more setup
*/
- printchk("(null)", "%pNHcg", NULL);
- printchk("(null)", "%pNHci", NULL);
+ printchk("(null)", "%pNHcg", (struct nexthop *)NULL);
+ printchk("(null)", "%pNHci", (struct nexthop *)NULL);
struct nexthop nh;
diff --git a/tests/lib/test_segv.c b/tests/lib/test_segv.c
index 8133637adc..494a162a45 100644
--- a/tests/lib/test_segv.c
+++ b/tests/lib/test_segv.c
@@ -28,7 +28,7 @@
#include "lib/log.h"
#include "lib/memory.h"
-struct quagga_signal_t sigs[] = {};
+struct frr_signal_t sigs[] = {};
struct thread_master *master;
diff --git a/tests/lib/test_sig.c b/tests/lib/test_sig.c
index 2aceafb8f0..9165f1850f 100644
--- a/tests/lib/test_sig.c
+++ b/tests/lib/test_sig.c
@@ -36,18 +36,18 @@ static void sigusr2(void)
printf("processed usr2\n");
}
-struct quagga_signal_t sigs[] = {{
- .signal = SIGHUP,
- .handler = &sighup,
- },
- {
- .signal = SIGUSR1,
- .handler = &sigusr1,
- },
- {
- .signal = SIGUSR2,
- .handler = &sigusr2,
- }};
+struct frr_signal_t sigs[] = {{
+ .signal = SIGHUP,
+ .handler = &sighup,
+ },
+ {
+ .signal = SIGUSR1,
+ .handler = &sigusr1,
+ },
+ {
+ .signal = SIGUSR2,
+ .handler = &sigusr2,
+ }};
struct thread_master *master;
struct thread t;
diff --git a/tests/lib/test_zmq.c b/tests/lib/test_zmq.c
index 65195aa3e1..c411de7252 100644
--- a/tests/lib/test_zmq.c
+++ b/tests/lib/test_zmq.c
@@ -266,7 +266,7 @@ static void sigchld(void)
frrzmq_thread_cancel(&cb, &cb->write);
}
-static struct quagga_signal_t sigs[] = {
+static struct frr_signal_t sigs[] = {
{
.signal = SIGCHLD,
.handler = sigchld,
diff --git a/tests/ospf6d/subdir.am b/tests/ospf6d/subdir.am
new file mode 100644
index 0000000000..ef1f40cf08
--- /dev/null
+++ b/tests/ospf6d/subdir.am
@@ -0,0 +1,19 @@
+if !OSPF6D
+PYTEST_IGNORE += --ignore=ospf6d/
+endif
+OSPF6_TEST_LDADD = ospf6d/libospf6.a $(ALL_TESTS_LDADD)
+
+
+if OSPF6D
+check_PROGRAMS += tests/ospf6d/test_lsdb
+endif
+tests_ospf6d_test_lsdb_CFLAGS = $(TESTS_CFLAGS)
+tests_ospf6d_test_lsdb_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_ospf6d_test_lsdb_LDADD = $(OSPF6_TEST_LDADD)
+tests_ospf6d_test_lsdb_SOURCES = tests/ospf6d/test_lsdb.c tests/lib/cli/common_cli.c
+clippy_scan += tests/ospf6d/test_lsdb.c
+EXTRA_DIST += \
+ tests/ospf6d/test_lsdb.py \
+ tests/ospf6d/test_lsdb.in \
+ tests/ospf6d/test_lsdb.refout \
+ # end
diff --git a/tests/ospfd/subdir.am b/tests/ospfd/subdir.am
new file mode 100644
index 0000000000..5ed5b9deaa
--- /dev/null
+++ b/tests/ospfd/subdir.am
@@ -0,0 +1,21 @@
+if !OSPFD
+PYTEST_IGNORE += --ignore=ospfd/
+endif
+OSPFD_TEST_LDADD = ospfd/libfrrospf.a $(ALL_TESTS_LDADD)
+noinst_HEADERS += \
+ tests/ospfd/common.h \
+ # end
+
+
+if OSPFD
+check_PROGRAMS += tests/ospfd/test_ospf_spf
+endif
+tests_ospfd_test_ospf_spf_CFLAGS = $(TESTS_CFLAGS)
+tests_ospfd_test_ospf_spf_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_ospfd_test_ospf_spf_LDADD = $(OSPFD_TEST_LDADD)
+tests_ospfd_test_ospf_spf_SOURCES = tests/ospfd/test_ospf_spf.c tests/ospfd/common.c tests/ospfd/topologies.c
+EXTRA_DIST += \
+ tests/ospfd/test_ospf_spf.py \
+ tests/ospfd/test_ospf_spf.in \
+ tests/ospfd/test_ospf_spf.refout \
+ # end
diff --git a/tests/subdir.am b/tests/subdir.am
index cd6e4101dd..ab322f70d2 100644
--- a/tests/subdir.am
+++ b/tests/subdir.am
@@ -2,171 +2,6 @@
# tests
#
-if BGPD
-TESTS_BGPD = \
- tests/bgpd/test_aspath \
- tests/bgpd/test_capability \
- tests/bgpd/test_packet \
- tests/bgpd/test_peer_attr \
- tests/bgpd/test_ecommunity \
- tests/bgpd/test_mp_attr \
- tests/bgpd/test_mpath \
- tests/bgpd/test_bgp_table
-IGNORE_BGPD =
-else
-TESTS_BGPD =
-IGNORE_BGPD = --ignore=bgpd/
-endif
-
-if ISISD
-TESTS_ISISD = \
- tests/isisd/test_fuzz_isis_tlv \
- tests/isisd/test_isis_lspdb \
- tests/isisd/test_isis_spf \
- tests/isisd/test_isis_vertex_queue \
- # end
-IGNORE_ISISD =
-else
-TESTS_ISISD =
-IGNORE_ISISD = --ignore=isisd/
-endif
-
-if OSPFD
-TESTS_OSPFD = \
- tests/ospfd/test_ospf_spf \
- # end
-IGNORE_OSPFD =
-else
-TESTS_OSPFD =
-IGNORE_OSPFD = --ignore=ospfd/
-endif
-
-if OSPF6D
-TESTS_OSPF6D = \
- tests/ospf6d/test_lsdb \
- # end
-IGNORE_OSPF6D =
-else
-TESTS_OSPF6D =
-IGNORE_OSPF6D = --ignore=ospf6d/
-endif
-
-if ZEBRA
-TESTS_ZEBRA = \
- tests/zebra/test_lm_plugin \
- #end
-IGNORE_ZEBRA =
-else
-TESTS_ZEBRA =
-IGNORE_ZEBRA = --ignore=zebra/
-endif
-
-if SCRIPTING
-TESTS_SCRIPTING = \
- tests/lib/test_frrlua \
- tests/lib/test_frrscript \
- #end
-else
-TESTS_SCRIPTING =
-endif
-
-clippy_scan += \
- tests/lib/cli/test_cli.c \
- tests/ospf6d/test_lsdb.c \
- # end
-
-check_PROGRAMS = \
- tests/lib/cxxcompat \
- tests/lib/test_assert \
- tests/lib/test_atomlist \
- tests/lib/test_buffer \
- tests/lib/test_checksum \
- tests/lib/test_heavy_thread \
- tests/lib/test_heavy_wq \
- tests/lib/test_heavy \
- tests/lib/test_idalloc \
- tests/lib/test_memory \
- tests/lib/test_nexthop_iter \
- tests/lib/test_nexthop \
- tests/lib/test_ntop \
- tests/lib/test_plist \
- tests/lib/test_prefix2str \
- tests/lib/test_printfrr \
- tests/lib/test_privs \
- tests/lib/test_ringbuf \
- tests/lib/test_srcdest_table \
- tests/lib/test_segv \
- tests/lib/test_seqlock \
- tests/lib/test_sig \
- tests/lib/test_skiplist \
- tests/lib/test_stream \
- tests/lib/test_table \
- tests/lib/test_timer_correctness \
- tests/lib/test_timer_performance \
- tests/lib/test_ttable \
- tests/lib/test_typelist \
- tests/lib/test_versioncmp \
- tests/lib/test_xref \
- tests/lib/test_zlog \
- tests/lib/test_graph \
- tests/lib/cli/test_cli \
- tests/lib/cli/test_commands \
- tests/lib/northbound/test_oper_data \
- $(TESTS_BGPD) \
- $(TESTS_ISISD) \
- $(TESTS_OSPFD) \
- $(TESTS_OSPF6D) \
- $(TESTS_ZEBRA) \
- $(TESTS_SCRIPTING) \
- # end
-
-if GRPC
-check_PROGRAMS += \
- tests/lib/test_grpc \
- #end
-endif
-
-if ZEROMQ
-check_PROGRAMS += \
- tests/lib/test_zmq \
- # end
-endif
-
-if CARES
-check_PROGRAMS += \
- tests/lib/test_resolver \
- # end
-endif
-
-tests/lib/cli/test_commands_defun.c: vtysh/vtysh_cmd.c
- mkdir -p tests/lib/cli
- sed \
- -e 's%"vtysh/vtysh\.h"%"tests/helpers/c/tests.h"%' \
- -e 's/vtysh_init_cmd/test_init_cmd/' \
- -e 's/VTYSH_[A-Z][A-Z_0-9]*/0/g' \
- < vtysh/vtysh_cmd.c \
- > "$@"
-CLEANFILES += tests/lib/cli/test_commands_defun.c
-
-tests/isisd/test_fuzz_isis_tlv_tests.h: $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
- mkdir -p tests/isisd
- gzip -d < $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz > "$@"
-CLEANFILES += tests/isisd/test_fuzz_isis_tlv_tests.h
-
-tests/isisd/tests_isisd_test_fuzz_isis_tlv-test_fuzz_isis_tlv.$(OBJEXT): \
- tests/isisd/test_fuzz_isis_tlv_tests.h
-tests/isisd/test_fuzz_isis_tlv-test_fuzz_isis_tlv.$(OBJEXT): \
- tests/isisd/test_fuzz_isis_tlv_tests.h
-
-noinst_HEADERS += \
- tests/helpers/c/prng.h \
- tests/helpers/c/tests.h \
- tests/lib/cli/common_cli.h \
- tests/lib/test_typelist.h \
- tests/isisd/test_common.h \
- tests/ospfd/common.h \
- # end
-
#
# *sigh* - there is no way to get CPPFLAGS or CFLAGS for a group of files :(
#
@@ -190,323 +25,52 @@ TESTS_CXXFLAGS = \
# note no -Werror
ALL_TESTS_LDADD = lib/libfrr.la $(LIBCAP)
-BGP_TEST_LDADD = bgpd/libbgp.a $(RFPLDADD) $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) $(UST_LIBS) -lm
-ISISD_TEST_LDADD = isisd/libisis.a $(ALL_TESTS_LDADD)
-if GRPC
-GRPC_TESTS_LDADD = staticd/libstatic.a grpc/libfrrgrpc_pb.la -lgrpc++ -lprotobuf $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) -lm
-endif
-OSPFD_TEST_LDADD = ospfd/libfrrospf.a $(ALL_TESTS_LDADD)
-OSPF6_TEST_LDADD = ospf6d/libospf6.a $(ALL_TESTS_LDADD)
-ZEBRA_TEST_LDADD = zebra/label_manager.o $(ALL_TESTS_LDADD)
-
-tests_bgpd_test_aspath_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_aspath_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_aspath_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_aspath_SOURCES = tests/bgpd/test_aspath.c
-tests_bgpd_test_bgp_table_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_bgp_table_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_bgp_table_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_bgp_table_SOURCES = tests/bgpd/test_bgp_table.c
-tests_bgpd_test_capability_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_capability_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_capability_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_capability_SOURCES = tests/bgpd/test_capability.c
-tests_bgpd_test_ecommunity_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_ecommunity_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_ecommunity_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_ecommunity_SOURCES = tests/bgpd/test_ecommunity.c
-tests_bgpd_test_mp_attr_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_mp_attr_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_mp_attr_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_mp_attr_SOURCES = tests/bgpd/test_mp_attr.c
-tests_bgpd_test_mpath_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_mpath_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_mpath_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_mpath_SOURCES = tests/bgpd/test_mpath.c
-tests_bgpd_test_packet_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_packet_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_packet_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_packet_SOURCES = tests/bgpd/test_packet.c
-tests_bgpd_test_peer_attr_CFLAGS = $(TESTS_CFLAGS)
-tests_bgpd_test_peer_attr_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_bgpd_test_peer_attr_LDADD = $(BGP_TEST_LDADD)
-tests_bgpd_test_peer_attr_SOURCES = tests/bgpd/test_peer_attr.c
-
-tests_isisd_test_fuzz_isis_tlv_CFLAGS = $(TESTS_CFLAGS) -I$(top_builddir)/tests/isisd
-tests_isisd_test_fuzz_isis_tlv_CPPFLAGS = $(TESTS_CPPFLAGS) -I$(top_builddir)/tests/isisd
-tests_isisd_test_fuzz_isis_tlv_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv.c tests/isisd/test_common.c
-nodist_tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv_tests.h
-tests_isisd_test_isis_lspdb_CFLAGS = $(TESTS_CFLAGS)
-tests_isisd_test_isis_lspdb_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_isisd_test_isis_lspdb_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_isis_lspdb_SOURCES = tests/isisd/test_isis_lspdb.c tests/isisd/test_common.c
-tests_isisd_test_isis_spf_CFLAGS = $(TESTS_CFLAGS)
-tests_isisd_test_isis_spf_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_isisd_test_isis_spf_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_isis_spf_SOURCES = tests/isisd/test_isis_spf.c tests/isisd/test_common.c tests/isisd/test_topologies.c
-nodist_tests_isisd_test_isis_spf_SOURCES = yang/frr-isisd.yang.c
-tests_isisd_test_isis_vertex_queue_CFLAGS = $(TESTS_CFLAGS)
-tests_isisd_test_isis_vertex_queue_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_isisd_test_isis_vertex_queue_LDADD = $(ISISD_TEST_LDADD)
-tests_isisd_test_isis_vertex_queue_SOURCES = tests/isisd/test_isis_vertex_queue.c tests/isisd/test_common.c
-
-tests_ospfd_test_ospf_spf_CFLAGS = $(TESTS_CFLAGS)
-tests_ospfd_test_ospf_spf_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_ospfd_test_ospf_spf_LDADD = $(OSPFD_TEST_LDADD)
-tests_ospfd_test_ospf_spf_SOURCES = tests/ospfd/test_ospf_spf.c tests/ospfd/common.c tests/ospfd/topologies.c
-
-tests_lib_cxxcompat_CFLAGS = $(TESTS_CFLAGS) $(CXX_COMPAT_CFLAGS) $(WERROR)
-tests_lib_cxxcompat_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_cxxcompat_SOURCES = tests/lib/cxxcompat.c
-tests_lib_cxxcompat_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_cli_test_cli_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_cli_test_cli_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_cli_test_cli_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_cli_test_cli_SOURCES = tests/lib/cli/test_cli.c tests/lib/cli/common_cli.c
-tests_lib_cli_test_commands_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_cli_test_commands_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_cli_test_commands_LDADD = $(ALL_TESTS_LDADD)
-nodist_tests_lib_cli_test_commands_SOURCES = tests/lib/cli/test_commands_defun.c
-tests_lib_cli_test_commands_SOURCES = tests/lib/cli/test_commands.c tests/helpers/c/prng.c
-tests_lib_northbound_test_oper_data_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_northbound_test_oper_data_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_northbound_test_oper_data_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_northbound_test_oper_data_SOURCES = tests/lib/northbound/test_oper_data.c
-nodist_tests_lib_northbound_test_oper_data_SOURCES = yang/frr-test-module.yang.c
-if GRPC
-tests_lib_test_grpc_CXXFLAGS = $(WERROR) $(TESTS_CXXFLAGS)
-tests_lib_test_grpc_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_grpc_LDADD = $(GRPC_TESTS_LDADD)
-tests_lib_test_grpc_SOURCES = tests/lib/test_grpc.cpp
-endif
-tests_lib_test_assert_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_assert_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_assert_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_assert_SOURCES = tests/lib/test_assert.c
-tests_lib_test_atomlist_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_atomlist_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_atomlist_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_atomlist_SOURCES = tests/lib/test_atomlist.c
-tests_lib_test_buffer_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_buffer_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_buffer_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_buffer_SOURCES = tests/lib/test_buffer.c
-tests_lib_test_checksum_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_checksum_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_checksum_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_checksum_SOURCES = tests/lib/test_checksum.c
-if SCRIPTING
-tests_lib_test_frrlua_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_frrlua_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_frrlua_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_frrlua_SOURCES = tests/lib/test_frrlua.c
-tests_lib_test_frrscript_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_frrscript_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_frrscript_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_frrscript_SOURCES = tests/lib/test_frrscript.c
-endif
-tests_lib_test_graph_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_graph_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_graph_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_graph_SOURCES = tests/lib/test_graph.c
-tests_lib_test_heavy_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_heavy_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_heavy_LDADD = $(ALL_TESTS_LDADD) -lm
-tests_lib_test_heavy_SOURCES = tests/lib/test_heavy.c tests/helpers/c/main.c
-tests_lib_test_heavy_thread_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_heavy_thread_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_heavy_thread_LDADD = $(ALL_TESTS_LDADD) -lm
-tests_lib_test_heavy_thread_SOURCES = tests/lib/test_heavy_thread.c tests/helpers/c/main.c
-tests_lib_test_heavy_wq_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_heavy_wq_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_heavy_wq_LDADD = $(ALL_TESTS_LDADD) -lm
-tests_lib_test_heavy_wq_SOURCES = tests/lib/test_heavy_wq.c tests/helpers/c/main.c
-tests_lib_test_idalloc_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_idalloc_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_idalloc_SOURCES = tests/lib/test_idalloc.c
-tests_lib_test_memory_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_memory_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_memory_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_memory_SOURCES = tests/lib/test_memory.c
-tests_lib_test_nexthop_iter_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_nexthop_iter_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_nexthop_iter_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_nexthop_iter_SOURCES = tests/lib/test_nexthop_iter.c tests/helpers/c/prng.c
-tests_lib_test_nexthop_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_nexthop_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_nexthop_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_nexthop_SOURCES = tests/lib/test_nexthop.c
-tests_lib_test_ntop_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_ntop_CPPFLAGS = $(CPPFLAGS_BASE) # no assert override
-tests_lib_test_ntop_LDADD = # none
-tests_lib_test_ntop_SOURCES = tests/lib/test_ntop.c tests/helpers/c/prng.c
-tests_lib_test_plist_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_plist_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_plist_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_plist_SOURCES = tests/lib/test_plist.c tests/lib/cli/common_cli.c
-tests_lib_test_prefix2str_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_prefix2str_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_prefix2str_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_prefix2str_SOURCES = tests/lib/test_prefix2str.c tests/helpers/c/prng.c
-tests_lib_test_printfrr_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_printfrr_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_printfrr_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_printfrr_SOURCES = tests/lib/test_printfrr.c
-tests_lib_test_privs_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_privs_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_privs_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_privs_SOURCES = tests/lib/test_privs.c
-tests_lib_test_resolver_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_resolver_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_resolver_LDADD = $(ALL_TESTS_LDADD) lib/libfrrcares.la
-tests_lib_test_resolver_SOURCES = tests/lib/test_resolver.c tests/lib/cli/common_cli.c
-tests_lib_test_ringbuf_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_ringbuf_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_ringbuf_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_ringbuf_SOURCES = tests/lib/test_ringbuf.c
-tests_lib_test_segv_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_segv_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_segv_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_segv_SOURCES = tests/lib/test_segv.c
-tests_lib_test_seqlock_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_seqlock_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_seqlock_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_seqlock_SOURCES = tests/lib/test_seqlock.c
-tests_lib_test_sig_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_sig_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_sig_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_sig_SOURCES = tests/lib/test_sig.c
-tests_lib_test_skiplist_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_skiplist_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_skiplist_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_skiplist_SOURCES = tests/lib/test_skiplist.c
-tests_lib_test_srcdest_table_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_srcdest_table_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_srcdest_table_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_srcdest_table_SOURCES = tests/lib/test_srcdest_table.c tests/helpers/c/prng.c
-tests_lib_test_stream_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_stream_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_stream_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_stream_SOURCES = tests/lib/test_stream.c
-tests_lib_test_table_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_table_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_table_LDADD = $(ALL_TESTS_LDADD) -lm
-tests_lib_test_table_SOURCES = tests/lib/test_table.c
-tests_lib_test_timer_correctness_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_timer_correctness_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_timer_correctness_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_timer_correctness_SOURCES = tests/lib/test_timer_correctness.c tests/helpers/c/prng.c
-tests_lib_test_timer_performance_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_timer_performance_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_timer_performance_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_timer_performance_SOURCES = tests/lib/test_timer_performance.c tests/helpers/c/prng.c
-tests_lib_test_ttable_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_ttable_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_ttable_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_ttable_SOURCES = tests/lib/test_ttable.c
-tests_lib_test_typelist_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_typelist_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_typelist_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_typelist_SOURCES = tests/lib/test_typelist.c tests/helpers/c/prng.c
-tests_lib_test_versioncmp_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_versioncmp_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_versioncmp_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_versioncmp_SOURCES = tests/lib/test_versioncmp.c
-tests_lib_test_xref_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_xref_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_xref_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_xref_SOURCES = tests/lib/test_xref.c
-tests_lib_test_zlog_CFLAGS = $(TESTS_CFLAGS)
-tests_lib_test_zlog_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_zlog_LDADD = $(ALL_TESTS_LDADD)
-tests_lib_test_zlog_SOURCES = tests/lib/test_zlog.c
-tests_lib_test_zmq_CFLAGS = $(TESTS_CFLAGS) $(ZEROMQ_CFLAGS)
-tests_lib_test_zmq_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_lib_test_zmq_LDADD = lib/libfrrzmq.la $(ALL_TESTS_LDADD) $(ZEROMQ_LIBS)
-tests_lib_test_zmq_SOURCES = tests/lib/test_zmq.c
-
-tests_ospf6d_test_lsdb_CFLAGS = $(TESTS_CFLAGS)
-tests_ospf6d_test_lsdb_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_ospf6d_test_lsdb_LDADD = $(OSPF6_TEST_LDADD)
-tests_ospf6d_test_lsdb_SOURCES = tests/ospf6d/test_lsdb.c tests/lib/cli/common_cli.c
-
-tests_zebra_test_lm_plugin_CFLAGS = $(TESTS_CFLAGS)
-tests_zebra_test_lm_plugin_CPPFLAGS = $(TESTS_CPPFLAGS)
-tests_zebra_test_lm_plugin_LDADD = $(ZEBRA_TEST_LDADD)
-tests_zebra_test_lm_plugin_SOURCES = tests/zebra/test_lm_plugin.c
EXTRA_DIST += \
tests/runtests.py \
- tests/bgpd/test_aspath.py \
- tests/bgpd/test_capability.py \
- tests/bgpd/test_ecommunity.py \
- tests/bgpd/test_mp_attr.py \
- tests/bgpd/test_mpath.py \
- tests/bgpd/test_peer_attr.py \
tests/helpers/python/frrsix.py \
tests/helpers/python/frrtest.py \
- tests/isisd/test_fuzz_isis_tlv.py \
- tests/isisd/test_fuzz_isis_tlv_tests.h.gz \
- tests/isisd/test_isis_lspdb.py \
- tests/isisd/test_isis_spf.py \
- tests/isisd/test_isis_spf.in \
- tests/isisd/test_isis_spf.refout \
- tests/isisd/test_isis_vertex_queue.py \
- tests/ospfd/test_ospf_spf.py \
- tests/ospfd/test_ospf_spf.in \
- tests/ospfd/test_ospf_spf.refout \
- tests/lib/cli/test_commands.in \
- tests/lib/cli/test_commands.py \
- tests/lib/cli/test_commands.refout \
- tests/lib/cli/test_cli.in \
- tests/lib/cli/test_cli.py \
- tests/lib/cli/test_cli.refout \
- tests/lib/northbound/test_oper_data.in \
- tests/lib/northbound/test_oper_data.py \
- tests/lib/northbound/test_oper_data.refout \
- tests/lib/test_assert.py \
- tests/lib/test_atomlist.py \
- tests/lib/test_nexthop_iter.py \
- tests/lib/test_nexthop.py \
- tests/lib/test_ntop.py \
- tests/lib/test_prefix2str.py \
- tests/lib/test_printfrr.py \
- tests/lib/test_ringbuf.py \
- tests/lib/test_srcdest_table.py \
- tests/lib/test_stream.py \
- tests/lib/test_stream.refout \
- tests/lib/test_table.py \
- tests/lib/test_timer_correctness.py \
- tests/lib/test_ttable.py \
- tests/lib/test_ttable.refout \
- tests/lib/test_typelist.py \
- tests/lib/test_versioncmp.py \
- tests/lib/test_xref.py \
- tests/lib/test_zlog.py \
- tests/lib/test_graph.py \
- tests/lib/test_graph.refout \
- tests/ospf6d/test_lsdb.py \
- tests/ospf6d/test_lsdb.in \
- tests/ospf6d/test_lsdb.refout \
- tests/zebra/test_lm_plugin.py \
- tests/zebra/test_lm_plugin.refout \
# end
-
-if SCRIPTING
-EXTRA_DIST += \
- tests/lib/test_frrscript.py \
- tests/lib/test_frrlua.py \
- #end
-endif
+check_PROGRAMS =
+PYTEST_IGNORE =
.PHONY: tests/tests.xml
tests/tests.xml: $(check_PROGRAMS)
- ( cd tests; $(PYTHON) ../$(srcdir)/tests/runtests.py --junitxml=tests.xml -v ../$(srcdir)/tests $(IGNORE_BGPD) $(IGNORE_ISISD) $(IGNORE_OSPFD) $(IGNORE_OSPF6D); )
+ ( cd tests; $(PYTHON) ../$(srcdir)/tests/runtests.py --junitxml=tests.xml -v ../$(srcdir)/tests $(PYTEST_IGNORE); )
check: tests/tests.xml
clean-local: clean-tests
.PHONY: clean-tests
clean-tests:
-rm -f tests/tests.xml
+
+
+# CHEAT SHEET:
+#
+### conditional (if needed) - ONLY for "check_PROGRAMS +=" line!
+# if DAEMON
+# check_PROGRAMS += tests/daemon/test_foo
+# endif
+### CFLAGS/CPPFLAGS/LDADD as usual, extend on top of TESTS_XYZFLAGS
+# tests_daemon_test_foo_CFLAGS = $(TESTS_CFLAGS)
+# tests_daemon_test_foo_CPPFLAGS = $(TESTS_CPPFLAGS)
+# tests_daemon_test_foo_LDADD = $(ALL_TESTS_LDADD)
+# tests_daemon_test_foo_SOURCES = tests/daemon/test_foo.c
+### don't forget "nodist_" for autogenerated source files, & add to CLEANFILES
+# nodist_tests_daemon_test_foo_SOURCES = tests/daemon/test_foo_autogen.c
+# CLEANFILES += tests/daemon/test_foo_autogen.c
+### clippy_scan works normally
+# clippy_scan += tests/daemon/test_foo.c
+### header files for tests go into "noinst_HEADERS"
+# noinst_HEADERS += tests/daemon/foo.h
+### all python scripts & auxiliary files are added into EXTRA_DIST
+# EXTRA_DIST += tests/daemon/test_foo.py
+#
+
+include tests/bgpd/subdir.am
+include tests/isisd/subdir.am
+include tests/ospfd/subdir.am
+include tests/ospf6d/subdir.am
+include tests/zebra/subdir.am
+include tests/lib/subdir.am
diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
index c8c03025c2..c1a9499cbe 100644
--- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
+++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
@@ -281,10 +281,29 @@ bgpribRequireVpnRoutes(
# r1 vtysh -c "show bgp vrf r1-cust1 ipv4"
-
########################################################################
# PE routers: VRFs contain routes from remote customer nets
########################################################################
+# First let's spot check and ensure that some of the routes
+# have showed up and been best path'd
+# After the first two are good. It's probably ok
+# to look at the rest of the routes in the vrf
+luCommand(
+ "r1",
+ 'vtysh -c "show bgp vrf r1-cust1 ipv4 uni 99.0.0.4/32"',
+ "1 available, best",
+ "wait",
+ "Ensure 99.0.0.4 shows up",
+ 10
+ )
+luCommand(
+ "r1",
+ 'vtysh -c "show bgp vrf r1-cust1 ipv4 uni 5.1.0.0/24"',
+ "2 available, best",
+ "wait",
+ "Ensure 5.1.0.0 shows up",
+ 10
+ )
want_r1_remote_cust1_routes = [
{"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
{"p": "5.1.0.0/24", "n": "99.0.0.1", "bp": True},
@@ -313,7 +332,22 @@ bgpribRequireUnicastRoutes(
want_r1_remote_cust1_routes,
debug=False,
)
-
+luCommand(
+ "r3",
+ 'vtysh -c "show bgp vrf r3-cust1 ipv4 uni 99.0.0.4/32"',
+ "1 available, best",
+ "wait",
+ "Ensure 99.0.0.4 shows up",
+ 10
+ )
+luCommand(
+ "r3",
+ 'vtysh -c "show bgp vrf r3-cust1 ipv4 uni 5.1.0.0/24"',
+ "2 available, best",
+ "wait",
+ "Ensure 5.1.0.0 shows up",
+ 10
+ )
want_r3_remote_cust1_routes = [
{"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.0.0/24", "n": "99.0.0.2", "bp": False},
@@ -342,6 +376,30 @@ bgpribRequireUnicastRoutes(
debug=False,
)
+luCommand(
+ "r4",
+ 'vtysh -c "show bgp vrf r4-cust1 ipv4 uni 99.0.0.4/32"',
+ "1 available, best",
+ "wait",
+ "Ensure 99.0.0.4 shows up",
+ 10
+ )
+luCommand(
+ "r4",
+ 'vtysh -c "show bgp vrf r4-cust1 ipv4 uni 5.1.0.0/24"',
+ "2 available, best",
+ "wait",
+ "Ensure 5.1.0.0 shows up",
+ 10
+ )
+luCommand(
+ "r4",
+ 'vtysh -c "show bgp vrf r4-cust1 ipv4 uni 99.0.0.2/32"',
+ "1 available, best",
+ "wait",
+ "Ensure 99.0.0.2 shows up",
+ 10
+ )
want_r4_remote_cust1_routes = [
{"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
{"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
diff --git a/tests/zebra/subdir.am b/tests/zebra/subdir.am
new file mode 100644
index 0000000000..d9fcde80a9
--- /dev/null
+++ b/tests/zebra/subdir.am
@@ -0,0 +1,17 @@
+if !ZEBRA
+PYTEST_IGNORE += --ignore=zebra/
+endif
+ZEBRA_TEST_LDADD = zebra/label_manager.o $(ALL_TESTS_LDADD)
+
+
+if ZEBRA
+check_PROGRAMS += tests/zebra/test_lm_plugin
+endif
+tests_zebra_test_lm_plugin_CFLAGS = $(TESTS_CFLAGS)
+tests_zebra_test_lm_plugin_CPPFLAGS = $(TESTS_CPPFLAGS)
+tests_zebra_test_lm_plugin_LDADD = $(ZEBRA_TEST_LDADD)
+tests_zebra_test_lm_plugin_SOURCES = tests/zebra/test_lm_plugin.c
+EXTRA_DIST += \
+ tests/zebra/test_lm_plugin.py \
+ tests/zebra/test_lm_plugin.refout \
+ # end
diff --git a/vrrpd/subdir.am b/vrrpd/subdir.am
index dfa9b261c3..02e0497eef 100644
--- a/vrrpd/subdir.am
+++ b/vrrpd/subdir.am
@@ -3,17 +3,17 @@
#
if VRRPD
-noinst_LIBRARIES += vrrpd/libvrrp.a
sbin_PROGRAMS += vrrpd/vrrpd
vtysh_scan += vrrpd/vrrp_vty.c
vtysh_daemons += vrrpd
man8 += $(MANBUILD)/frr-vrrpd.8
endif
-vrrpd_libvrrp_a_SOURCES = \
+vrrpd_vrrpd_SOURCES = \
vrrpd/vrrp.c \
vrrpd/vrrp_arp.c \
vrrpd/vrrp_debug.c \
+ vrrpd/vrrp_main.c \
vrrpd/vrrp_ndisc.c \
vrrpd/vrrp_northbound.c \
vrrpd/vrrp_packet.c \
@@ -35,8 +35,7 @@ clippy_scan += \
vrrpd/vrrp_vty.c \
# end
-vrrpd_vrrpd_SOURCES = vrrpd/vrrp_main.c
-vrrpd_vrrpd_LDADD = vrrpd/libvrrp.a lib/libfrr.la @LIBCAP@
+vrrpd_vrrpd_LDADD = lib/libfrr.la @LIBCAP@
nodist_vrrpd_vrrpd_SOURCES = \
yang/frr-vrrpd.yang.c \
# end
diff --git a/vrrpd/vrrp_main.c b/vrrpd/vrrp_main.c
index 990fa9e382..59769788e7 100644
--- a/vrrpd/vrrp_main.c
+++ b/vrrpd/vrrp_main.c
@@ -93,7 +93,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t vrrp_signals[] = {
+struct frr_signal_t vrrp_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 53349452e6..2537ff4571 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -484,7 +484,7 @@ static int vtysh_execute_func(const char *line, int pager)
if (vtysh_add_timestamp && strncmp(line, "exit", 4)) {
char ts[48];
- (void)quagga_timestamp(3, ts, sizeof(ts));
+ (void)frr_timestamp(3, ts, sizeof(ts));
vty_out(vty, "%% %s\n\n", ts);
}
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c
index b09d092458..0d9734a756 100644
--- a/watchfrr/watchfrr.c
+++ b/watchfrr/watchfrr.c
@@ -1301,7 +1301,7 @@ struct zebra_privs_t watchfrr_privs = {
#endif
};
-static struct quagga_signal_t watchfrr_signals[] = {
+static struct frr_signal_t watchfrr_signals[] = {
{
.signal = SIGINT,
.handler = sigint,
diff --git a/zebra/interface.c b/zebra/interface.c
index 6479dbb58a..49a1e49175 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1026,7 +1026,7 @@ void if_up(struct interface *ifp)
zif = ifp->info;
zif->up_count++;
- quagga_timestamp(2, zif->up_last, sizeof(zif->up_last));
+ frr_timestamp(2, zif->up_last, sizeof(zif->up_last));
/* Notify the protocol daemons. */
if (ifp->ptm_enable && (ifp->ptm_status == ZEBRA_PTM_STATUS_DOWN)) {
@@ -1090,7 +1090,7 @@ void if_down(struct interface *ifp)
zif = ifp->info;
zif->down_count++;
- quagga_timestamp(2, zif->down_last, sizeof(zif->down_last));
+ frr_timestamp(2, zif->down_last, sizeof(zif->down_last));
if_down_nhg_dependents(ifp);
diff --git a/zebra/interface.h b/zebra/interface.h
index 23e22bdda8..771398b547 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -340,9 +340,9 @@ struct zebra_if {
/* Information about up/down changes */
unsigned int up_count;
- char up_last[QUAGGA_TIMESTAMP_LEN];
+ char up_last[FRR_TIMESTAMP_LEN];
unsigned int down_count;
- char down_last[QUAGGA_TIMESTAMP_LEN];
+ char down_last[FRR_TIMESTAMP_LEN];
#if defined(HAVE_RTADV)
struct rtadvconf rtadv;
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 2db3e6e904..5ff66f7c63 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -61,7 +61,7 @@ extern struct zebra_privs_t zserv_privs;
* Alignment of zero-sized sockaddrs is nonsensical, but historically
* BSD defines RT_ROUNDUP(0) to be the alignment interval (rather than
* 0). We follow this practice without questioning it, but it is a
- * bug if quagga calls ROUNDUP with 0.
+ * bug if frr calls ROUNDUP with 0.
*/
#ifdef __APPLE__
#define ROUNDUP_TYPE int
diff --git a/zebra/main.c b/zebra/main.c
index cca7b49962..038022ceb2 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -71,7 +71,7 @@ struct thread_master *master;
/* Route retain mode flag. */
int retain_mode = 0;
-/* Allow non-quagga entities to delete quagga routes */
+/* Allow non-frr entities to delete frr routes */
int allow_delete = 0;
int graceful_restart;
@@ -233,7 +233,7 @@ static void sigusr1(void)
zlog_rotate();
}
-struct quagga_signal_t zebra_signals[] = {
+struct frr_signal_t zebra_signals[] = {
{
.signal = SIGHUP,
.handler = &sighup,