mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 17:01:51 +00:00
tests: reorganize tests hierarchically
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
This commit is contained in:
parent
5a1218aa53
commit
30c4877560
46
tests/.gitignore
vendored
46
tests/.gitignore
vendored
@ -16,26 +16,26 @@ TAGS
|
||||
*.xml
|
||||
.arch-inventory
|
||||
.arch-ids
|
||||
aspathtest
|
||||
ecommtest
|
||||
heavy
|
||||
heavythread
|
||||
heavywq
|
||||
tabletest
|
||||
test-timer-correctness
|
||||
test-timer-performance
|
||||
testbgpcap
|
||||
testbgpmpath
|
||||
testbgpmpattr
|
||||
testbuffer
|
||||
testchecksum
|
||||
testcli
|
||||
testmemory
|
||||
testprivs
|
||||
testsegv
|
||||
testsig
|
||||
teststream
|
||||
testnexthopiter
|
||||
testcommands
|
||||
test-commands-defun.c
|
||||
site.exp
|
||||
/bgpd/test_aspath
|
||||
/bgpd/test_capability
|
||||
/bgpd/test_ecommunity
|
||||
/bgpd/test_mp_attr
|
||||
/bgpd/test_mpath
|
||||
/lib/cli/test_cli
|
||||
/lib/cli/test_commands
|
||||
/lib/cli/test_commands_defun.c
|
||||
/lib/test_buffer
|
||||
/lib/test_checksum
|
||||
/lib/test_heavy
|
||||
/lib/test_heavy_thread
|
||||
/lib/test_heavy_wq
|
||||
/lib/test_memory
|
||||
/lib/test_nexthop_iter
|
||||
/lib/test_privs
|
||||
/lib/test_srcdest_table
|
||||
/lib/test_segv
|
||||
/lib/test_sig
|
||||
/lib/test_stream
|
||||
/lib/test_table
|
||||
/lib/test_timer_correctness
|
||||
/lib/test_timer_performance
|
||||
|
@ -1,96 +1,115 @@
|
||||
AUTOMAKE_OPTIONS = dejagnu
|
||||
DEJATOOL = libfrr
|
||||
|
||||
SUBDIRS = \
|
||||
bgpd.tests \
|
||||
libfrr.tests
|
||||
|
||||
EXTRA_DIST = \
|
||||
config/unix.exp \
|
||||
lib/bgpd.exp \
|
||||
lib/libfrr.exp \
|
||||
global-conf.exp \
|
||||
testcommands.in \
|
||||
testcommands.refout \
|
||||
testcli.in \
|
||||
testcli.refout
|
||||
|
||||
AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
|
||||
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 = aspathtest testbgpcap ecommtest testbgpmpattr testbgpmpath
|
||||
DEJATOOL += bgpd
|
||||
TESTS_BGPD = \
|
||||
bgpd/test_aspath \
|
||||
bgpd/test_capability \
|
||||
bgpd/test_ecommunity \
|
||||
bgpd/test_mp_attr \
|
||||
bgpd/test_mpath
|
||||
else
|
||||
TESTS_BGPD =
|
||||
endif
|
||||
|
||||
if ENABLE_BGP_VNC
|
||||
BGP_VNC_RFP_LIB=@top_builddir@/$(LIBRFP)/librfp.a
|
||||
BGP_VNC_RFP_LIB=@top_builddir@/$(LIBRFP)/librfp.a
|
||||
else
|
||||
BGP_VNC_RFP_LIB =
|
||||
endif
|
||||
|
||||
check_PROGRAMS = testsig testsegv testbuffer testmemory heavy heavywq heavythread \
|
||||
testprivs teststream testchecksum tabletest testnexthopiter \
|
||||
testcommands test-timer-correctness test-timer-performance \
|
||||
testcli \
|
||||
$(TESTS_BGPD)
|
||||
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_segv \
|
||||
lib/test_sig \
|
||||
lib/test_stream \
|
||||
lib/test_table \
|
||||
lib/test_timer_correctness \
|
||||
lib/test_timer_performance \
|
||||
lib/cli/test_cli \
|
||||
lib/cli/test_commands \
|
||||
$(TESTS_BGPD)
|
||||
|
||||
../vtysh/vtysh_cmd.c:
|
||||
$(MAKE) -C ../vtysh vtysh_cmd.c
|
||||
|
||||
test-commands-defun.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 \
|
||||
> test-commands-defun.c
|
||||
> "$@"
|
||||
|
||||
BUILT_SOURCES = test-commands-defun.c
|
||||
noinst_HEADERS = prng.h tests.h common-cli.h
|
||||
BUILT_SOURCES = lib/cli/test_commands_defun.c
|
||||
|
||||
testcli_SOURCES = test-cli.c common-cli.c
|
||||
testsig_SOURCES = test-sig.c
|
||||
testsegv_SOURCES = test-segv.c
|
||||
testbuffer_SOURCES = test-buffer.c
|
||||
testmemory_SOURCES = test-memory.c
|
||||
testprivs_SOURCES = test-privs.c
|
||||
teststream_SOURCES = test-stream.c
|
||||
heavy_SOURCES = heavy.c main.c
|
||||
heavywq_SOURCES = heavy-wq.c main.c
|
||||
heavythread_SOURCES = heavy-thread.c main.c
|
||||
aspathtest_SOURCES = aspath_test.c
|
||||
testbgpcap_SOURCES = bgp_capability_test.c
|
||||
ecommtest_SOURCES = ecommunity_test.c
|
||||
testbgpmpattr_SOURCES = bgp_mp_attr_test.c
|
||||
testchecksum_SOURCES = test-checksum.c
|
||||
testbgpmpath_SOURCES = bgp_mpath_test.c
|
||||
tabletest_SOURCES = table_test.c
|
||||
testnexthopiter_SOURCES = test-nexthop-iter.c prng.c
|
||||
testcommands_SOURCES = test-commands-defun.c test-commands.c prng.c
|
||||
test_timer_correctness_SOURCES = test-timer-correctness.c prng.c
|
||||
test_timer_performance_SOURCES = test-timer-performance.c prng.c
|
||||
noinst_HEADERS = \
|
||||
./helpers/c/prng.h \
|
||||
./helpers/c/tests.h \
|
||||
./lib/cli/common_cli.h
|
||||
|
||||
testcli_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testsig_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testsegv_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testbuffer_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testmemory_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testprivs_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
teststream_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
heavy_LDADD = ../lib/libfrr.la @LIBCAP@ -lm
|
||||
heavywq_LDADD = ../lib/libfrr.la @LIBCAP@ -lm
|
||||
heavythread_LDADD = ../lib/libfrr.la @LIBCAP@ -lm
|
||||
aspathtest_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ -lm
|
||||
testbgpcap_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ -lm
|
||||
ecommtest_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ -lm
|
||||
testbgpmpattr_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ -lm
|
||||
testchecksum_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testbgpmpath_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ -lm
|
||||
tabletest_LDADD = ../lib/libfrr.la @LIBCAP@ -lm
|
||||
testnexthopiter_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
testcommands_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
test_timer_correctness_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
test_timer_performance_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
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_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_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_ecommunity_SOURCES = bgpd/test_ecommunity.c
|
||||
bgpd_test_mp_attr_SOURCES = bgpd/test_mp_attr.c
|
||||
bgpd_test_mpath_SOURCES = bgpd/test_mpath.c
|
||||
|
||||
ALL_TESTS_LDADD = ../lib/libfrr.la @LIBCAP@
|
||||
BGP_TEST_LDADD = ../bgpd/libbgp.a $(BGP_VNC_RFP_LIB) $(ALL_TESTS_LDADD) -lm
|
||||
|
||||
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_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_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_ecommunity_LDADD = $(BGP_TEST_LDADD)
|
||||
bgpd_test_mp_attr_LDADD = $(BGP_TEST_LDADD)
|
||||
bgpd_test_mpath_LDADD = $(BGP_TEST_LDADD)
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "memory_vty.h"
|
||||
#include "log.h"
|
||||
|
||||
#include "common-cli.h"
|
||||
#include "common_cli.h"
|
||||
|
||||
struct thread_master *master;
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include <zebra.h>
|
||||
|
||||
#include "common-cli.h"
|
||||
#include "common_cli.h"
|
||||
|
||||
DUMMY_DEFUN(cmd0, "arg ipv4 A.B.C.D");
|
||||
DUMMY_DEFUN(cmd1, "arg ipv4m A.B.C.D/M");
|
8
tests/lib/test_stream.refout
Normal file
8
tests/lib/test_stream.refout
Normal file
@ -0,0 +1,8 @@
|
||||
endp: 15, readable: 15, writeable: 1009
|
||||
0xef 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef
|
||||
endp: 15, readable: 15, writeable: 0
|
||||
0xef 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef
|
||||
c: 0xef
|
||||
w: 0xbeef
|
||||
l: 0xdeadbeef
|
||||
q: 0xdeadbeefdeadbeef
|
Loading…
Reference in New Issue
Block a user