mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 12:35:48 +00:00
tests: DejaGNU libzebra
Wrap the few libzebra test programs we have up for DejaGNU. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
5bb7e4d12b
commit
c69905b673
@ -1705,6 +1705,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
|
||||
ospf6d/Makefile isisd/Makefile babeld/Makefile vtysh/Makefile
|
||||
doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
|
||||
tests/bgpd.tests/Makefile
|
||||
tests/libzebra.tests/Makefile
|
||||
redhat/Makefile
|
||||
pkgsrc/Makefile
|
||||
redhat/quagga.spec
|
||||
|
@ -1,12 +1,15 @@
|
||||
AUTOMAKE_OPTIONS = dejagnu
|
||||
export DEJAGNU
|
||||
DEJATOOL =
|
||||
DEJATOOL = libzebra
|
||||
|
||||
SUBDIRS = bgpd.tests
|
||||
SUBDIRS = \
|
||||
bgpd.tests \
|
||||
libzebra.tests
|
||||
|
||||
EXTRA_DIST = \
|
||||
config/unix.exp \
|
||||
lib/bgpd.exp \
|
||||
lib/libzebra.exp \
|
||||
global-conf.exp
|
||||
|
||||
INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
|
||||
|
@ -20,6 +20,24 @@ if { $i >= 0 } {
|
||||
send_user "IPv6 enabled: $have_ipv6\n"
|
||||
set xfail 0
|
||||
|
||||
proc onesimple { test_name match } {
|
||||
global verbose
|
||||
global aborted
|
||||
global testprefix
|
||||
if { $aborted > 0 } {
|
||||
untested "$testprefix$test_name"
|
||||
return
|
||||
}
|
||||
if { $verbose > 0 } {
|
||||
send_user "$testprefix$test_name$note\n"
|
||||
}
|
||||
expect {
|
||||
"$match" { pass "$testprefix$test_name"; }
|
||||
eof { fail "$testprefix$test_name"; set aborted 1; }
|
||||
timeout { unresolved "$testprefix$test_name"; set aborted 1; }
|
||||
}
|
||||
}
|
||||
|
||||
proc onetest { test_name note start } {
|
||||
global aborted
|
||||
global testprefix
|
||||
|
0
tests/lib/libzebra.exp
Normal file
0
tests/lib/libzebra.exp
Normal file
2
tests/libzebra.tests/Makefile.am
Normal file
2
tests/libzebra.tests/Makefile.am
Normal file
@ -0,0 +1,2 @@
|
||||
EXTRA_DIST = \
|
||||
tabletest.exp
|
9
tests/libzebra.tests/tabletest.exp
Normal file
9
tests/libzebra.tests/tabletest.exp
Normal file
@ -0,0 +1,9 @@
|
||||
set timeout 10
|
||||
set testprefix "tabletest "
|
||||
set aborted 0
|
||||
|
||||
spawn "./tabletest"
|
||||
|
||||
for {set i 0} {$i < 6} {incr i 1} { onesimple "cmp $i" "Verifying cmp"; }
|
||||
for {set i 0} {$i < 11} {incr i 1} { onesimple "succ $i" "Verifying successor"; }
|
||||
onesimple "pause" "Verified pausing"
|
28
tests/libzebra.tests/teststream.exp
Normal file
28
tests/libzebra.tests/teststream.exp
Normal file
@ -0,0 +1,28 @@
|
||||
set timeout 10
|
||||
spawn "./teststream"
|
||||
|
||||
expect {
|
||||
"endp: 15, readable: 15, writeable: 1009" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"0xef 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"endp: 15, readable: 15, writeable: 0" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"0xef 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef 0xde 0xad 0xbe 0xef" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"c: 0xef" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"w: 0xbeef" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"l: 0xdeadbeef" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
expect {
|
||||
"q: 0xdeadbeefdeadbeef" { }
|
||||
eof { fail "teststream"; exit; } timeout { fail "teststream"; exit; } }
|
||||
pass "teststream"
|
Loading…
Reference in New Issue
Block a user