tests: add testcli reference in/out & do DejaGNU
This adds reference in & output for the previously added testcli tool,
to check basic CLI parsing/help functions. Unlike "testcommands", this
one doesn't depend on compile-time system details.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/tests/libzebra.tests/Makefile.am b/tests/libzebra.tests/Makefile.am
index 819cce2..4b74e2d 100644
--- a/tests/libzebra.tests/Makefile.am
+++ b/tests/libzebra.tests/Makefile.am
@@ -2,4 +2,5 @@
tabletest.exp \
test-timer-correctness.exp \
testcommands.exp \
+ testcli.exp \
testnexthopiter.exp
diff --git a/tests/libzebra.tests/testcli.exp b/tests/libzebra.tests/testcli.exp
new file mode 100644
index 0000000..778bd0c
--- /dev/null
+++ b/tests/libzebra.tests/testcli.exp
@@ -0,0 +1,23 @@
+set timeout 30
+set test_name "testcli"
+
+spawn sh -c "./testcli < $env(srcdir)/testcli.in | diff -au $env(srcdir)/testcli.refout -"
+
+expect {
+ eof {
+ }
+ timeout {
+ exp_close
+ fail "$test_name: timeout"
+ }
+}
+
+catch wait result
+set os_error [lindex $result 2]
+set exit_status [lindex $result 3]
+
+if { $os_error == 0 && $exit_status == 0 } {
+ pass "$test_name"
+} else {
+ fail "$test_name"
+}