chroot: ""
username: ""
do-not-query-localhost: no
+ tcp-idle-timeout: 10000
log-queries: yes
log-replies: yes
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
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
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