]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
stream reuse, add a test for close by upstream server after timeout.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 30 Jul 2020 14:41:28 +0000 (16:41 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 30 Jul 2020 14:41:28 +0000 (16:41 +0200)
testdata/tcp_reuse.tdir/tcp_reuse.conf2
testdata/tcp_reuse.tdir/tcp_reuse.pre
testdata/tcp_reuse.tdir/tcp_reuse.test

index 6cb1e612260e549b3c99f3672fe26f91b1012e53..55985c83fe13c2946f3dd9d58faba9801e10c1b2 100644 (file)
@@ -10,6 +10,7 @@ server:
        chroot: ""
        username: ""
        do-not-query-localhost: no
+       tcp-idle-timeout: 10000
 
        log-queries: yes
        log-replies: yes
@@ -24,6 +25,7 @@ server:
        local-data: "www4.example.com  A 10.20.30.44"
        local-data: "www5.example.com  A 10.20.30.45"
        local-data: "www6.example.com  A 10.20.30.46"
+       local-data: "www7.example.com  A 10.20.30.47"
 
        local-zone: "drop.net" deny
        local-zone: "refuse.net" refuse
index 30dbdc96f4226ed0f402bbf5c27339268720f8ed..ada38271a73daf3d16a69f437e3664917d4e133a 100644 (file)
@@ -25,7 +25,7 @@ wait_unbound_up unbound.log
 sed -e 's/@PORT\@/'$UPSTREAM_PORT'/' -e 's/@TOPORT\@/'$UPSTREAM_PORT'/' < tcp_reuse.conf2 > ub2.conf
 # start upstream unbound in the background
 #$PRE/unbound -d -c ub2.conf >unbound2.log 2>&1 &
-$PRE/unbound -d -c ub2.conf 2>&1 | tee unbound2.log &
+valgrind $PRE/unbound -d -c ub2.conf 2>&1 | tee unbound2.log &
 UPSTREAM_PID=$!
 echo "UPSTREAM_PID=$UPSTREAM_PID" >> .tpkg.var.test
 wait_unbound_up unbound2.log
index 5541ed7f986830977bda3654d76b19965e93bd16..5f084489081b54fa8ce97e45da5455c58edd1509 100644 (file)
@@ -213,6 +213,36 @@ for x in a1.more.net a2.more.net a3.more.net a4.more.net a5.more.net; do
        fi
 done
 
+# make the server timeout to drop the upstream connection
+echo "> sleep 20"
+sleep 15
+# see if we are still up.
+echo "> query a7.more.net"
+$PRE/streamtcp -a -f 127.0.0.1@$UNBOUND_PORT a7.more.net A IN >outfile 2>&1
+if test "$?" -ne 0; then
+       echo "exit status not OK"
+       echo "> cat logfiles"
+       cat outfile
+       cat unbound2.log
+       cat unbound.log
+       echo "Not OK"
+       exit 1
+fi
+cat outfile
+for x in a7.more.net; do
+       if grep "$x" outfile | grep "10.20.30.40"; then
+               echo "content OK for $x"
+       else
+               echo "result contents not OK, for $x"
+               echo "> cat logfiles"
+               cat outfile
+               cat unbound2.log
+               cat unbound.log
+               echo "result contents not OK, for $x"
+               exit 1
+       fi
+done
+
 # dropconn.drop.net make the server drop the connection.
 echo "> query a11.more.net a12.more.net dropconn.drop.net a14.more.net a15.more.net"
 $PRE/streamtcp -a -f 127.0.0.1@$UNBOUND_PORT a11.more.net A IN a12.more.net A IN dropconn.drop.net A IN a14.more.net A IN a15.more.net A IN >outfile 2>&1