shorten the tcp system test

the tcp system test uses the 'packet.pl' test tool to send a packet
thousands of times. this took a long time because the tool was waiting
for replies and parsing them; however, for that particular test the
replies aren't relevant.

this commit uses non-blocking sockets and moves the reply parsing
outside the send loop, which speeds the system test up substantially.

(cherry picked from commit 1ceea908b6)
This commit is contained in:
Evan Hunt
2020-09-04 10:58:47 -07:00
parent b0e1d19599
commit 267c154a63
2 changed files with 46 additions and 41 deletions

View File

@@ -187,13 +187,9 @@ status=$((status + ret))
n=$((n + 1))
echo_i "checking that BIND 9 doesn't crash on long TCP messages ($n)"
ret=0
if [ -z "$CI" ]; then
$PERL ../packet.pl -a "10.53.0.1" -p "${PORT}" -t tcp -r 300000 1996-alloc_dnsbuf-crash-test.pkt || ret=1
dig_with_opts +tcp @10.53.0.1 txt.example > dig.out.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
else
echo_i "skipped";
fi
{ $PERL ../packet.pl -a "10.53.0.1" -p "${PORT}" -t tcp -r 300000 1996-alloc_dnsbuf-crash-test.pkt || ret=1 ; } | cat_i
dig_with_opts +tcp @10.53.0.1 txt.example > dig.out.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"