]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a test of normal TCP query behavior before and after high-water test
authorEvan Hunt <each@isc.org>
Fri, 28 Feb 2020 22:47:10 +0000 (14:47 -0800)
committerWitold Krecicki <wpk@isc.org>
Thu, 5 Mar 2020 18:02:27 +0000 (18:02 +0000)
bin/tests/system/tcp/ans6/ans.py
bin/tests/system/tcp/tests.sh

index 331ac7fbd17cb6db1c9f841e78938d704b4fdc77..85339dc4b5ce0755b06615883079a6688939c318 100644 (file)
@@ -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()
index 8606efd7e50f296d9e710537ffb625b3d6d61947..7e78d634affe8a1c7d597b1249f3746c513ad5e4 100644 (file)
@@ -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