tests: add CLI dummy command-exec tool
This adds some common CLI testtool code as well as a tool that has a
bunch of commands to be poked for their correct processing.
The tool doesn't work correctly from a script at stdin at this point
because the vty code will throw away all buffered when it sees EOF, so
the tail end of the input file is lost.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b542071..cdd5d02 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,6 +29,7 @@
check_PROGRAMS = testsig testsegv testbuffer testmemory heavy heavywq heavythread \
testprivs teststream testchecksum tabletest testnexthopiter \
testcommands test-timer-correctness test-timer-performance \
+ testcli \
$(TESTS_BGPD)
../vtysh/vtysh_cmd.c:
@@ -43,8 +44,9 @@
> test-commands-defun.c
BUILT_SOURCES = test-commands-defun.c
-noinst_HEADERS = prng.h tests.h
+noinst_HEADERS = prng.h tests.h common-cli.h
+testcli_SOURCES = test-cli.c common-cli.c
testsig_SOURCES = test-sig.c
testsegv_SOURCES = test-segv.c
testbuffer_SOURCES = test-buffer.c
@@ -66,6 +68,7 @@
test_timer_correctness_SOURCES = test-timer-correctness.c prng.c
test_timer_performance_SOURCES = test-timer-performance.c prng.c
+testcli_LDADD = ../lib/libzebra.la @LIBCAP@
testsig_LDADD = ../lib/libzebra.la @LIBCAP@
testsegv_LDADD = ../lib/libzebra.la @LIBCAP@
testbuffer_LDADD = ../lib/libzebra.la @LIBCAP@