1 # #-- tcp_idle_timeout.test --#
2 # source the master var file when it's there
3 [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
4 # use .tpkg.var.test for in test variable passing
5 [ -f .tpkg.var.test ] && source .tpkg.var.test
8 # Run up unbound with a 2s idle timeout. Try a normal TCP query, check it works, and then check that a connection with a 4s send delay fails.
11 if uname | grep MINGW >/dev/null; then
12 echo "no job control in shell on windows. end test"
19 (cd $PRE; $MAKE streamtcp)
21 # first test a single TCP query with no delay.
22 echo "> query www.example.com."
23 $PRE/streamtcp -f 127.0.0.1@$UNBOUND_PORT www.example.com. A IN >outfile 2>&1
24 if test "$?" -ne 0; then
25 echo "exit status not OK"
40 if grep "10.20.30.40" outfile; then
47 # now test query with delay should fail.
48 echo "> query www.example.com."
49 $PRE/streamtcp -d 4 -f 127.0.0.1@$UNBOUND_PORT www.example.com. A IN >outfile 2>&1
50 if test "$?" -eq 0; then
59 echo "exit status not OK"