unbound/testdata/pymod_thread.tdir/pymod_thread.test
wouter 8ba25b126a tests in tdir format.
git-svn-id: https://unbound.nlnetlabs.nl/svn/trunk@4264 be551aaa-1e26-0410-a405-d3ace91eadb9
2017-07-06 13:27:30 +00:00

68 lines
1.9 KiB
Plaintext

# #-- pymod_thread.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="../.."
if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then
echo "have python module"
else
echo "no python module"
exit 0
fi
if test "`uname 2>&1`" = "Darwin"; then
ldnsdir=`grep ldnsdir= ../../Makefile | sed -e 's/ldnsdir=//'`
echo export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$ldnsdir/lib:../../.libs"
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$ldnsdir/lib:../../.libs"
fi
# see if config file verifies
if $PRE/unbound-checkconf ub.conf; then
echo "checkconf OK"
else
echo "checkconf failed"
exit 1
fi
# do the test
# generate some load.
echo "> dig www[1-10].example.com."
dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile1 &
dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
dig @localhost -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
dig @localhost -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
dig @localhost -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
dig @localhost -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
dig @localhost -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
dig @localhost -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
dig @localhost -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
dig @localhost -p $UNBOUND_PORT www10.example.com. | tee outfile10 &
wait # wait for all jobs to complete.
echo "> cat logfiles"
cat fwd.log
cat unbound.log
echo "> check answer"
for x in outfile1 outfile2 outfile3 outfile4 outfile5; do
if grep "192.168.1.1" $x; then
echo "$x OK"
else
echo "$x Not OK"
exit 1
fi
done
for x in outfile6 outfile7 outfile8 outfile9 outfile10; do
if grep "192.168.1.1" $x; then
echo "$x OK"
else
echo "$x Not OK"
exit 1
fi
done
exit 0