unbound/testdata/tcp_conn_limit.tdir/tcp_conn_limit.test
Wouter Wijngaards 586b811b87 - Patch to implement tcp-connection-limit from Jim Hague (Sinodun).
This limits the number of simultaneous TCP client connections
  from a nominated netblock.
And a simple test for TCP connection limit.


git-svn-id: file:///svn/unbound/trunk@4835 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-08-07 11:57:42 +00:00

42 lines
885 B
Text

# #-- tcp_conn_limit.test --#
# source the master var file when it's there
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test
# Set unbound to limit all IPv4 addresses to 0 connections.
# Make sure TCP connection fails.
if uname | grep MINGW >/dev/null; then
echo "no job control in shell on windows. end test"
exit 0
fi
PRE="../.."
. ../common.sh
get_make
(cd $PRE; $MAKE streamtcp)
# test query should fail.
echo "> query www.example.com."
$PRE/streamtcp -f 127.0.0.1@$UNBOUND_PORT www.example.com. A IN >outfile 2>&1
if test "$?" -eq 0; then
echo "exit status OK"
echo "> cat logfiles"
cat outfile
cat fwd.log
cat unbound.log
echo "Not OK"
exit 1
else
echo "exit status not OK"
fi
echo "> cat logfiles"
cat outfile
cat fwd.log
cat unbound.log
echo "OK"
exit 0