From: Evan Hunt Date: Fri, 28 Feb 2020 22:47:10 +0000 (-0800) Subject: add a test of normal TCP query behavior before and after high-water test X-Git-Tag: v9.17.1~76^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1383804597395283ccb5263380511e92b241c689;p=thirdparty%2Fbind9.git add a test of normal TCP query behavior before and after high-water test --- diff --git a/bin/tests/system/tcp/ans6/ans.py b/bin/tests/system/tcp/ans6/ans.py index 331ac7fbd17..85339dc4b5c 100644 --- a/bin/tests/system/tcp/ans6/ans.py +++ b/bin/tests/system/tcp/ans6/ans.py @@ -98,7 +98,9 @@ def open_connections(active_conns, count, host, port): def close_connections(active_conns, count): - log('Closing %d connections...' % count) + log('Closing %s connections...' % "all" if count == 0 else str(count)) + if count == 0: + count = len(active_conns) for _ in range(count): sock = active_conns.pop(0) sock.close() diff --git a/bin/tests/system/tcp/tests.sh b/bin/tests/system/tcp/tests.sh index 8606efd7e50..7e78d634aff 100644 --- a/bin/tests/system/tcp/tests.sh +++ b/bin/tests/system/tcp/tests.sh @@ -98,6 +98,16 @@ close_connections() { send_command "close" "${1}" || return 1 } +# Check TCP connections are working normally before opening +# multiple connections +n=$((n + 1)) +echo_i "checking TCP query repsonse ($n)" +ret=0 +dig_with_opts +tcp @10.53.0.5 txt.example > dig.out.test$n +grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + # Check TCP statistics after server startup before using them as a baseline for # subsequent checks. n=$((n + 1)) @@ -162,5 +172,17 @@ retry 2 check_stats_limit || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) +# Check TCP connections are working normally before opening +# multiple connections +n=$((n + 1)) +echo_i "checking TCP response recovery ($n)" +ret=0 +# "0" closes all connections +close_connections 0 || ret=1 +dig_with_opts +tcp @10.53.0.5 txt.example > dig.out.test$n || ret=1 +grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1