mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
66 lines
1.4 KiB
Text
66 lines
1.4 KiB
Text
|
|
# #-- tcp_reuse.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
|
||
|
|
|
||
|
|
PRE="../.."
|
||
|
|
. ../common.sh
|
||
|
|
|
||
|
|
get_make
|
||
|
|
(cd $PRE; $MAKE streamtcp)
|
||
|
|
|
||
|
|
echo "> query www1.example.com."
|
||
|
|
$PRE/streamtcp -f 127.0.0.1@$UNBOUND_PORT www1.example.com. A IN >outfile 2>&1
|
||
|
|
cat outfile
|
||
|
|
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
|
||
|
|
if grep "www1.example.com" outfile | grep "10.20.30.41"; then
|
||
|
|
echo "content OK"
|
||
|
|
else
|
||
|
|
echo "result contents not OK"
|
||
|
|
echo "> cat logfiles"
|
||
|
|
cat outfile
|
||
|
|
cat unbound2.log
|
||
|
|
cat unbound.log
|
||
|
|
echo "result contents not OK"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
echo "OK"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# this should be reused on the same tcp stream:
|
||
|
|
echo "> query www2.example.com."
|
||
|
|
$PRE/streamtcp -f 127.0.0.1@$UNBOUND_PORT www2.example.com. A IN >outfile 2>&1
|
||
|
|
cat outfile
|
||
|
|
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
|
||
|
|
if grep "www2.example.com" outfile | grep "10.20.30.42"; then
|
||
|
|
echo "content OK"
|
||
|
|
else
|
||
|
|
echo "result contents not OK"
|
||
|
|
echo "> cat logfiles"
|
||
|
|
cat outfile
|
||
|
|
cat unbound2.log
|
||
|
|
cat unbound.log
|
||
|
|
echo "result contents not OK"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
echo "OK"
|
||
|
|
exit 0
|