tests: ignore stderr for expect

expect redirects both stdout and stderr to its input.  This causes
serious problems when libzebra prints log messages to stderr, which are
then asynchronously inserted in the middle of lines of stdout test
output.  Ultimately this makes testbgpmpattr fail on FreeBSD.

(The stdio buffering seems to be slightly different on FreeBSD,
triggering the bug.)

Just ignore stderr for expect.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2017-01-13 11:23:18 +01:00
parent dc54fc5360
commit 2f9a659926
9 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@ set testprefix "aspathtest "
set aborted 0 set aborted 0
set color 1 set color 1
spawn "./aspathtest" spawn sh -c "exec ./aspathtest 2>/dev/null"
# proc onetest { test_name note start } { # proc onetest { test_name note start } {
# proc headerline { line } { # proc headerline { line } {

View File

@ -3,7 +3,7 @@ set testprefix "ecommtest "
set aborted 0 set aborted 0
set color 0 set color 0
spawn "./ecommtest" spawn sh -c "exec ./ecommtest 2>/dev/null"
# proc simpletest { start } { # proc simpletest { start } {

View File

@ -3,7 +3,7 @@ set testprefix "testbgpcap "
set aborted 0 set aborted 0
set color 1 set color 1
spawn "./testbgpcap" spawn sh -c "exec ./testbgpcap 2>/dev/null"
# proc simpletest { start } { # proc simpletest { start } {

View File

@ -3,7 +3,7 @@ set testprefix "testbgpmpath "
set aborted 0 set aborted 0
set color 1 set color 1
spawn "./testbgpmpath" spawn sh -c "exec ./testbgpmpath 2>/dev/null"
# proc simpletest { start } { # proc simpletest { start } {

View File

@ -3,7 +3,7 @@ set testprefix "testbgpmpattr "
set aborted 0 set aborted 0
set color 1 set color 1
spawn "./testbgpmpattr" spawn sh -c "exec ./testbgpmpattr 2>/dev/null"
# proc simpletest { start } { # proc simpletest { start } {

View File

@ -2,7 +2,7 @@ set timeout 10
set testprefix "tabletest " set testprefix "tabletest "
set aborted 0 set aborted 0
spawn "./tabletest" spawn sh -c "exec ./tabletest 2>/dev/null"
for {set i 0} {$i < 6} {incr i 1} { onesimple "cmp $i" "Verifying cmp"; } 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"; } for {set i 0} {$i < 11} {incr i 1} { onesimple "succ $i" "Verifying successor"; }

View File

@ -2,6 +2,6 @@ set timeout 10
set testprefix "test-timer-correctness" set testprefix "test-timer-correctness"
set aborted 0 set aborted 0
spawn "./test-timer-correctness" spawn sh -c "exec ./test-timer-correctness 2>/dev/null"
onesimple "" "Expected output and actual output match." onesimple "" "Expected output and actual output match."

View File

@ -2,7 +2,7 @@ set timeout 10
set testprefix "testnexthopiter " set testprefix "testnexthopiter "
set aborted 0 set aborted 0
spawn "./testnexthopiter" spawn sh -c "exec ./testnexthopiter 2>/dev/null"
onesimple "simple" "Simple test passed." onesimple "simple" "Simple test passed."
onesimple "prng" "PRNG test passed." onesimple "prng" "PRNG test passed."

View File

@ -1,5 +1,5 @@
set timeout 10 set timeout 10
spawn "./teststream" spawn sh -c "exec ./teststream 2>/dev/null"
expect { expect {
"endp: 15, readable: 15, writeable: 1009" { } "endp: 15, readable: 15, writeable: 1009" { }