summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore18
-rw-r--r--tests/Makefile10
-rw-r--r--tests/Makefile.am235
-rw-r--r--tests/bgpd/test_peer_attr.c2
-rw-r--r--tests/helpers/python/frrtest.py10
-rw-r--r--tests/isisd/test_fuzz_isis_tlv.c8
-rw-r--r--tests/isisd/test_fuzz_isis_tlv_tests.h.gzbin233035 -> 222030 bytes
-rw-r--r--tests/isisd/test_isis_vertex_queue.c44
-rw-r--r--tests/lib/cli/test_cli.c2
-rw-r--r--tests/lib/cli/test_cli.py1
-rw-r--r--tests/lib/cli/test_commands.c6
-rw-r--r--tests/lib/test_srcdest_table.c1
-rw-r--r--tests/ospf6d/test_lsdb.c2
-rw-r--r--tests/subdir.am295
-rw-r--r--tests/test_lblmgr.c6
15 files changed, 357 insertions, 283 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index c8368b39b6..37cd245de0 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,24 +1,6 @@
-Makefile
-Makefile.in
-*.o
-tags
-TAGS
-.cache
-.deps
-.nfs*
-*~
-*.loT
-*.lo
-*.la
-*.libs
-*.bak
*.log
*.sum
*.xml
-*.pyc
-.arch-inventory
-.arch-ids
-__pycache__
.pytest_cache
/bgpd/test_aspath
/bgpd/test_bgp_table
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000000..dd4594febe
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,10 @@
+all: ALWAYS
+ @$(MAKE) -s -C .. check
+%: ALWAYS
+ @$(MAKE) -s -C .. tests/$@
+
+Makefile:
+ #nothing
+ALWAYS:
+.PHONY: ALWAYS makefiles
+.SUFFIXES:
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index a7dec67348..0000000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,235 +0,0 @@
-include ../common.am
-
-PYTHON ?= python
-
-AUTOMAKE_OPTIONS = subdir-objects
-AM_CPPFLAGS += \
- -I.. \
- -I$(top_srcdir) \
- -I$(top_srcdir)/lib \
- -I$(top_builddir)/lib \
- -I$(top_srcdir)/tests/helpers/c \
- -I$(top_builddir)/tests/helpers/c \
- -O
-DEFS = @DEFS@ $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
-
-if BGPD
-TESTS_BGPD = \
- bgpd/test_aspath \
- bgpd/test_capability \
- bgpd/test_packet \
- bgpd/test_peer_attr \
- bgpd/test_ecommunity \
- bgpd/test_mp_attr \
- bgpd/test_mpath \
- bgpd/test_bgp_table
-else
-TESTS_BGPD =
-endif
-
-if ISISD
-if SOLARIS
-TESTS_ISISD =
-else
-TESTS_ISISD = \
- isisd/test_fuzz_isis_tlv \
- isisd/test_isis_vertex_queue \
- # end
-endif
-else
-TESTS_ISISD =
-endif
-
-if OSPF6D
-TESTS_OSPF6D = \
- ospf6d/test_lsdb \
- # end
-else
-TESTS_OSPF6D =
-endif
-
-if ENABLE_BGP_VNC
-BGP_VNC_RFP_LIB=@top_builddir@/$(LIBRFP)/librfp.a
-else
-BGP_VNC_RFP_LIB =
-endif
-
-lib/cli/test_cli.o: lib/cli/test_cli_clippy.c
-ospf6d/test_lsdb.o: ospf6d/test_lsdb_clippy.c
-
-check_PROGRAMS = \
- lib/test_buffer \
- lib/test_checksum \
- lib/test_heavy_thread \
- lib/test_heavy_wq \
- lib/test_heavy \
- lib/test_memory \
- lib/test_nexthop_iter \
- lib/test_privs \
- lib/test_ringbuf \
- lib/test_srcdest_table \
- lib/test_segv \
- lib/test_sig \
- lib/test_stream \
- lib/test_table \
- lib/test_timer_correctness \
- lib/test_timer_performance \
- lib/test_ttable \
- lib/test_zlog \
- lib/test_graph \
- lib/cli/test_cli \
- lib/cli/test_commands \
- $(TESTS_BGPD) \
- $(TESTS_ISISD) \
- $(TESTS_OSPF6D) \
- # end
-
-if ZEROMQ
-check_PROGRAMS += \
- lib/test_zmq \
- # end
-endif
-
-../vtysh/vtysh_cmd.c:
- $(MAKE) -C ../vtysh vtysh_cmd.c
-
-lib/cli/test_commands_defun.c: ../vtysh/vtysh_cmd.c
- sed \
- -e 's/"vtysh\.h"/"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 \
- > "$@"
-
-isisd/test_fuzz_isis_tlv_tests.h: $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
- gzip -d < $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz > "$@"
-
-noinst_HEADERS = \
- ./helpers/c/prng.h \
- ./helpers/c/tests.h \
- ./lib/cli/common_cli.h
-
-lib_test_buffer_SOURCES = lib/test_buffer.c
-lib_test_checksum_SOURCES = lib/test_checksum.c
-lib_test_heavy_thread_SOURCES = lib/test_heavy_thread.c helpers/c/main.c
-lib_test_heavy_wq_SOURCES = lib/test_heavy_wq.c helpers/c/main.c
-lib_test_heavy_SOURCES = lib/test_heavy.c helpers/c/main.c
-lib_test_memory_SOURCES = lib/test_memory.c
-lib_test_nexthop_iter_SOURCES = lib/test_nexthop_iter.c helpers/c/prng.c
-lib_test_privs_SOURCES = lib/test_privs.c
-lib_test_ringbuf_SOURCES = lib/test_ringbuf.c
-lib_test_srcdest_table_SOURCES = lib/test_srcdest_table.c \
- helpers/c/prng.c
-lib_test_segv_SOURCES = lib/test_segv.c
-lib_test_sig_SOURCES = lib/test_sig.c
-lib_test_stream_SOURCES = lib/test_stream.c
-lib_test_table_SOURCES = lib/test_table.c
-lib_test_timer_correctness_SOURCES = lib/test_timer_correctness.c \
- helpers/c/prng.c
-lib_test_timer_performance_SOURCES = lib/test_timer_performance.c \
- helpers/c/prng.c
-lib_test_ttable_SOURCES = lib/test_ttable.c
-lib_test_zlog_SOURCES = lib/test_zlog.c
-lib_test_graph_SOURCES = lib/test_graph.c
-lib_test_zmq_SOURCES = lib/test_zmq.c
-lib_test_zmq_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
-lib_cli_test_cli_SOURCES = lib/cli/test_cli.c lib/cli/common_cli.c
-lib_cli_test_commands_SOURCES = lib/cli/test_commands_defun.c \
- lib/cli/test_commands.c \
- helpers/c/prng.c
-bgpd_test_aspath_SOURCES = bgpd/test_aspath.c
-bgpd_test_capability_SOURCES = bgpd/test_capability.c
-bgpd_test_packet_SOURCES = bgpd/test_packet.c
-bgpd_test_peer_attr_SOURCES = bgpd/test_peer_attr.c
-bgpd_test_ecommunity_SOURCES = bgpd/test_ecommunity.c
-bgpd_test_mp_attr_SOURCES = bgpd/test_mp_attr.c
-bgpd_test_mpath_SOURCES = bgpd/test_mpath.c
-bgpd_test_bgp_table_SOURCES = bgpd/test_bgp_table.c
-isisd_test_fuzz_isis_tlv_SOURCES = isisd/test_fuzz_isis_tlv.c
-nodist_isisd_test_fuzz_isis_tlv_SOURCES = isisd/test_fuzz_isis_tlv_tests.h
-BUILT_SOURCES=isisd/test_fuzz_isis_tlv_tests.h
-CLEANFILES=isisd/test_fuzz_isis_tlv_tests.h
-isisd_test_fuzz_isis_tlv_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/tests/isisd
-isisd_test_isis_vertex_queue_SOURCES = isisd/test_isis_vertex_queue.c
-
-ospf6d_test_lsdb_SOURCES = ospf6d/test_lsdb.c lib/cli/common_cli.c
-
-ALL_TESTS_LDADD = ../lib/libfrr.la @LIBCAP@
-BGP_TEST_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) $(ALL_TESTS_LDADD) -lm
-ISISD_TEST_LDADD = ../isisd/libisis.a $(ALL_TESTS_LDADD)
-OSPF6_TEST_LDADD = ../ospf6d/libospf6.a $(ALL_TESTS_LDADD)
-
-lib_test_buffer_LDADD = $(ALL_TESTS_LDADD)
-lib_test_checksum_LDADD = $(ALL_TESTS_LDADD)
-lib_test_heavy_thread_LDADD = $(ALL_TESTS_LDADD) -lm
-lib_test_heavy_wq_LDADD = $(ALL_TESTS_LDADD) -lm
-lib_test_heavy_LDADD = $(ALL_TESTS_LDADD) -lm
-lib_test_memory_LDADD = $(ALL_TESTS_LDADD)
-lib_test_nexthop_iter_LDADD = $(ALL_TESTS_LDADD)
-lib_test_privs_LDADD = $(ALL_TESTS_LDADD)
-lib_test_ringbuf_LDADD = $(ALL_TESTS_LDADD)
-lib_test_srcdest_table_LDADD = $(ALL_TESTS_LDADD)
-lib_test_segv_LDADD = $(ALL_TESTS_LDADD)
-lib_test_sig_LDADD = $(ALL_TESTS_LDADD)
-lib_test_stream_LDADD = $(ALL_TESTS_LDADD)
-lib_test_table_LDADD = $(ALL_TESTS_LDADD) -lm
-lib_test_timer_correctness_LDADD = $(ALL_TESTS_LDADD)
-lib_test_timer_performance_LDADD = $(ALL_TESTS_LDADD)
-lib_test_ttable_LDADD = $(ALL_TESTS_LDADD)
-lib_test_zlog_LDADD = $(ALL_TESTS_LDADD)
-lib_test_graph_LDADD = $(ALL_TESTS_LDADD)
-lib_test_zmq_LDADD = ../lib/libfrrzmq.la $(ALL_TESTS_LDADD) $(ZEROMQ_LIBS)
-lib_cli_test_cli_LDADD = $(ALL_TESTS_LDADD)
-lib_cli_test_commands_LDADD = $(ALL_TESTS_LDADD)
-bgpd_test_aspath_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_capability_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_packet_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_peer_attr_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_ecommunity_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_mp_attr_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_mpath_LDADD = $(BGP_TEST_LDADD)
-bgpd_test_bgp_table_LDADD = $(BGP_TEST_LDADD)
-isisd_test_fuzz_isis_tlv_LDADD = $(ISISD_TEST_LDADD)
-isisd_test_isis_vertex_queue_LDADD = $(ISISD_TEST_LDADD)
-ospf6d_test_lsdb_LDADD = $(OSPF6_TEST_LDADD)
-
-EXTRA_DIST = \
- runtests.py \
- bgpd/test_aspath.py \
- bgpd/test_capability.py \
- bgpd/test_ecommunity.py \
- bgpd/test_mp_attr.py \
- bgpd/test_mpath.py \
- bgpd/test_peer_attr.py \
- helpers/python/frrsix.py \
- helpers/python/frrtest.py \
- isisd/test_fuzz_isis_tlv.py \
- isisd/test_fuzz_isis_tlv_tests.h.gz \
- isisd/test_isis_vertex_queue.py \
- lib/cli/test_commands.in \
- lib/cli/test_commands.py \
- lib/cli/test_commands.refout \
- lib/cli/test_cli.in \
- lib/cli/test_cli.py \
- lib/cli/test_cli.refout \
- lib/test_nexthop_iter.py \
- lib/test_ringbuf.py \
- lib/test_srcdest_table.py \
- lib/test_stream.py \
- lib/test_stream.refout \
- lib/test_table.py \
- lib/test_timer_correctness.py \
- lib/test_ttable.py \
- lib/test_ttable.refout \
- lib/test_zlog.py \
- lib/test_graph.py \
- lib/test_graph.refout \
- ospf6d/test_lsdb.py \
- ospf6d/test_lsdb.in \
- ospf6d/test_lsdb.refout \
- # end
-
-.PHONY: tests.xml
-tests.xml: $(check_PROGRAMS)
- $(PYTHON) $(srcdir)/runtests.py --junitxml=$@ -v $(srcdir)
-check: tests.xml
diff --git a/tests/bgpd/test_peer_attr.c b/tests/bgpd/test_peer_attr.c
index 452245ec16..e40fba2457 100644
--- a/tests/bgpd/test_peer_attr.c
+++ b/tests/bgpd/test_peer_attr.c
@@ -1388,7 +1388,7 @@ static void bgp_startup(void)
bgp_master_init(master);
bgp_option_set(BGP_OPT_NO_LISTEN);
vrf_init(NULL, NULL, NULL, NULL, NULL);
- bgp_init();
+ bgp_init(0);
bgp_pthreads_run();
}
diff --git a/tests/helpers/python/frrtest.py b/tests/helpers/python/frrtest.py
index da9e447fc0..60bee5c88c 100644
--- a/tests/helpers/python/frrtest.py
+++ b/tests/helpers/python/frrtest.py
@@ -176,8 +176,14 @@ class TestRefOut(object):
basedir = os.path.dirname(inspect.getsourcefile(type(self)))
program = os.path.join(basedir, self.program)
- refin = program + '.in'
- refout = program + '.refout'
+ if getattr(self, 'built_refin', False):
+ refin = binpath(program) + '.in'
+ else:
+ refin = program + '.in'
+ if getattr(self, 'built_refout', False):
+ refout = binpath(program) + '.refout'
+ else:
+ refout = program + '.refout'
intext = ''
if os.path.exists(refin):
diff --git a/tests/isisd/test_fuzz_isis_tlv.c b/tests/isisd/test_fuzz_isis_tlv.c
index 67a1593500..b75c1002d4 100644
--- a/tests/isisd/test_fuzz_isis_tlv.c
+++ b/tests/isisd/test_fuzz_isis_tlv.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "test_fuzz_isis_tlv_tests.h"
#include <zebra.h>
@@ -114,7 +118,11 @@ static int test(FILE *input, FILE *output)
const char *s_tlvs = isis_format_tlvs(tlvs);
fprintf(output, "Unpacked TLVs:\n%s", s_tlvs);
+ struct isis_item *orig_auth = tlvs->isis_auth.head;
+ tlvs->isis_auth.head = NULL;
+ s_tlvs = isis_format_tlvs(tlvs);
struct isis_tlvs *tlv_copy = isis_copy_tlvs(tlvs);
+ tlvs->isis_auth.head = orig_auth;
isis_free_tlvs(tlvs);
struct stream *s2 = stream_new(TEST_STREAM_SIZE);
diff --git a/tests/isisd/test_fuzz_isis_tlv_tests.h.gz b/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
index 4abbe81499..4a89bda84e 100644
--- a/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
+++ b/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
Binary files differ
diff --git a/tests/isisd/test_isis_vertex_queue.c b/tests/isisd/test_isis_vertex_queue.c
index 3e31b83351..869dd732eb 100644
--- a/tests/isisd/test_isis_vertex_queue.c
+++ b/tests/isisd/test_isis_vertex_queue.c
@@ -16,42 +16,46 @@ static size_t vertex_count;
static void setup_test_vertices(void)
{
- union isis_N nid, nip = {
- .ip.dest.family = AF_UNSPEC
+ struct isis_spftree t = {
};
+ struct prefix_pair p = {
+ };
+ uint8_t node_id[7];
vertices = XMALLOC(MTYPE_TMP, sizeof(*vertices) * 16);
- nip.ip.dest.family = AF_INET;
- nip.ip.dest.prefixlen = 24;
- inet_pton(AF_INET, "192.168.1.0", &nip.ip.dest.u.prefix4);
- vertices[vertex_count] = isis_vertex_new(&nip, VTYPE_IPREACH_TE);
+ p.dest.family = AF_INET;
+ p.dest.prefixlen = 24;
+ inet_pton(AF_INET, "192.168.1.0", &p.dest.u.prefix4);
+ vertices[vertex_count] = isis_vertex_new(&t, &p, VTYPE_IPREACH_TE);
vertices[vertex_count]->d_N = 20;
vertex_count++;
- nip.ip.dest.family = AF_INET;
- nip.ip.dest.prefixlen = 24;
- inet_pton(AF_INET, "192.168.2.0", &nip.ip.dest.u.prefix4);
- vertices[vertex_count] = isis_vertex_new(&nip, VTYPE_IPREACH_TE);
+ p.dest.family = AF_INET;
+ p.dest.prefixlen = 24;
+ inet_pton(AF_INET, "192.168.2.0", &p.dest.u.prefix4);
+ vertices[vertex_count] = isis_vertex_new(&t, &p, VTYPE_IPREACH_TE);
vertices[vertex_count]->d_N = 20;
vertex_count++;
- memset(nid.id, 0, sizeof(nid.id));
- nid.id[6] = 1;
- vertices[vertex_count] = isis_vertex_new(&nid, VTYPE_PSEUDO_TE_IS);
+ memset(node_id, 0, sizeof(node_id));
+ node_id[6] = 1;
+ vertices[vertex_count] = isis_vertex_new(&t, node_id,
+ VTYPE_PSEUDO_TE_IS);
vertices[vertex_count]->d_N = 15;
vertex_count++;
- memset(nid.id, 0, sizeof(nid.id));
- nid.id[5] = 2;
- vertices[vertex_count] = isis_vertex_new(&nid, VTYPE_NONPSEUDO_TE_IS);
+ memset(node_id, 0, sizeof(node_id));
+ node_id[5] = 2;
+ vertices[vertex_count] = isis_vertex_new(&t, node_id,
+ VTYPE_NONPSEUDO_TE_IS);
vertices[vertex_count]->d_N = 15;
vertex_count++;
- nip.ip.dest.family = AF_INET;
- nip.ip.dest.prefixlen = 24;
- inet_pton(AF_INET, "192.168.3.0", &nip.ip.dest.u.prefix4);
- vertices[vertex_count] = isis_vertex_new(&nip, VTYPE_IPREACH_TE);
+ p.dest.family = AF_INET;
+ p.dest.prefixlen = 24;
+ inet_pton(AF_INET, "192.168.3.0", &p.dest.u.prefix4);
+ vertices[vertex_count] = isis_vertex_new(&t, &p, VTYPE_IPREACH_TE);
vertices[vertex_count]->d_N = 20;
vertex_count++;
};
diff --git a/tests/lib/cli/test_cli.c b/tests/lib/cli/test_cli.c
index 4cc15ba23f..8f062d8b5e 100644
--- a/tests/lib/cli/test_cli.c
+++ b/tests/lib/cli/test_cli.c
@@ -41,7 +41,7 @@ DUMMY_DEFUN(cmd13, "alt a X:X::X:X");
DUMMY_DEFUN(cmd14,
"pat g { foo A.B.C.D$foo|foo|bar X:X::X:X$bar| baz } [final]");
-#include "lib/cli/test_cli_clippy.c"
+#include "tests/lib/cli/test_cli_clippy.c"
DEFPY(magic_test, magic_test_cmd,
"magic (0-100) {ipv4net A.B.C.D/M|X:X::X:X$ipv6}",
diff --git a/tests/lib/cli/test_cli.py b/tests/lib/cli/test_cli.py
index e3c31c2d91..7371db283a 100644
--- a/tests/lib/cli/test_cli.py
+++ b/tests/lib/cli/test_cli.py
@@ -2,3 +2,4 @@ import frrtest
class TestCli(frrtest.TestRefOut):
program = './test_cli'
+ built_refout = True
diff --git a/tests/lib/cli/test_commands.c b/tests/lib/cli/test_commands.c
index 2a8d263175..a8b42ba789 100644
--- a/tests/lib/cli/test_commands.c
+++ b/tests/lib/cli/test_commands.c
@@ -265,10 +265,10 @@ static void test_run(struct prng *prng, struct vty *vty, const char *cmd,
if (descriptions != NULL) {
for (j = 0; j < vector_active(descriptions);
j++) {
- struct cmd_token *cmd =
+ struct cmd_token *ct =
vector_slot(descriptions, j);
- printf(" '%s' '%s'\n", cmd->text,
- cmd->desc);
+ printf(" '%s' '%s'\n", ct->text,
+ ct->desc);
}
vector_free(descriptions);
}
diff --git a/tests/lib/test_srcdest_table.c b/tests/lib/test_srcdest_table.c
index e717da15b3..70db69aadf 100644
--- a/tests/lib/test_srcdest_table.c
+++ b/tests/lib/test_srcdest_table.c
@@ -289,7 +289,6 @@ static void test_state_verify(struct test_state *test)
expected_lock++;
if (rn->lock != expected_lock) {
- const struct prefix_ipv6 *dst_p, *src_p;
srcdest_rnode_prefixes(
rn, (const struct prefix **)&dst_p,
(const struct prefix **)&src_p);
diff --git a/tests/ospf6d/test_lsdb.c b/tests/ospf6d/test_lsdb.c
index ec0835c719..24821febe6 100644
--- a/tests/ospf6d/test_lsdb.c
+++ b/tests/ospf6d/test_lsdb.c
@@ -29,7 +29,7 @@
#include "ospf6d/ospf6_lsdb.h"
#include "tests/lib/cli/common_cli.h"
-#include "ospf6d/test_lsdb_clippy.c"
+#include "tests/ospf6d/test_lsdb_clippy.c"
static struct ospf6_lsdb *lsdb;
diff --git a/tests/subdir.am b/tests/subdir.am
new file mode 100644
index 0000000000..739a0e86fe
--- /dev/null
+++ b/tests/subdir.am
@@ -0,0 +1,295 @@
+#
+# tests
+#
+
+PYTHON ?= python
+
+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
+else
+TESTS_BGPD =
+endif
+
+if ISISD
+if SOLARIS
+TESTS_ISISD =
+else
+TESTS_ISISD = \
+ tests/isisd/test_fuzz_isis_tlv \
+ tests/isisd/test_isis_vertex_queue \
+ # end
+endif
+else
+TESTS_ISISD =
+endif
+
+if OSPF6D
+TESTS_OSPF6D = \
+ tests/ospf6d/test_lsdb \
+ # end
+else
+TESTS_OSPF6D =
+endif
+
+tests/lib/cli/tests_lib_cli_test_cli-test_cli.$(OBJEXT): tests/lib/cli/test_cli_clippy.c
+tests/lib/cli/test_cli-test_cli.$(OBJEXT): tests/lib/cli/test_cli_clippy.c
+tests/ospf6d/tests_ospf6d_test_lsdb-test_lsdb.$(OBJEXT): tests/ospf6d/test_lsdb_clippy.c
+tests/ospf6d/test_lsdb-test_lsdb.$(OBJEXT): tests/ospf6d/test_lsdb_clippy.c
+
+check_PROGRAMS = \
+ 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_memory \
+ tests/lib/test_nexthop_iter \
+ tests/lib/test_privs \
+ tests/lib/test_ringbuf \
+ tests/lib/test_srcdest_table \
+ tests/lib/test_segv \
+ tests/lib/test_sig \
+ 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_zlog \
+ tests/lib/test_graph \
+ tests/lib/cli/test_cli \
+ tests/lib/cli/test_commands \
+ $(TESTS_BGPD) \
+ $(TESTS_ISISD) \
+ $(TESTS_OSPF6D) \
+ # end
+
+if ZEROMQ
+check_PROGRAMS += \
+ tests/lib/test_zmq \
+ # end
+endif
+
+tests/lib/cli/test_commands_defun.c: vtysh/vtysh_cmd.c
+ 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 \
+ > "$@"
+
+tests/isisd/test_fuzz_isis_tlv_tests.h: $(top_srcdir)/tests/isisd/test_fuzz_isis_tlv_tests.h.gz
+ 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 \
+ # end
+
+#
+# *sigh* - there is no way to get CPPFLAGS or CFLAGS for a group of files :(
+#
+
+TESTS_CPPFLAGS = $(AM_CPPFLAGS) \
+ -I$(top_srcdir)/tests/helpers/c \
+ -I$(top_builddir)/tests/helpers/c \
+ # end
+TESTS_CFLAGS = $(SAN_FLAGS)
+# note no -Werror
+
+ALL_TESTS_LDADD = lib/libfrr.la @LIBCAP@
+BGP_TEST_LDADD = bgpd/libbgp.a $(RFPLDADD) $(ALL_TESTS_LDADD) -lm
+ISISD_TEST_LDADD = isisd/libisis.a $(ALL_TESTS_LDADD)
+OSPF6_TEST_LDADD = ospf6d/libospf6.a $(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
+nodist_tests_isisd_test_fuzz_isis_tlv_SOURCES = tests/isisd/test_fuzz_isis_tlv_tests.h
+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_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)
+tests_lib_cli_test_commands_SOURCES = tests/lib/cli/test_commands_defun.c tests/lib/cli/test_commands.c tests/helpers/c/prng.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
+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_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_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_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_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_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_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
+
+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_vertex_queue.py \
+ 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/test_nexthop_iter.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_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 \
+ # end
+
+.PHONY: tests/tests.xml
+tests/tests.xml: $(check_PROGRAMS)
+ ( cd tests; $(PYTHON) ../$(srcdir)/tests/runtests.py --junitxml=tests.xml -v ../$(srcdir)/tests; )
+check: tests/tests.xml
diff --git a/tests/test_lblmgr.c b/tests/test_lblmgr.c
index c751c0b12d..9d1c05436c 100644
--- a/tests/test_lblmgr.c
+++ b/tests/test_lblmgr.c
@@ -21,6 +21,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "lib/stream.h"
#include "lib/zclient.h"
@@ -55,7 +59,7 @@ static int zebra_send_label_manager_connect()
printf("Connect to Label Manager\n");
- ret = lm_label_manager_connect(zclient);
+ ret = lm_label_manager_connect(zclient, 0);
printf("Label Manager connection result: %u \n", ret);
if (ret != 0) {
fprintf(stderr, "Error %d connecting to Label Manager %s\n",