]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - testdata/pymod_thread.tdir/pymod_thread.test
Vendor import of Unbound 1.6.6.
[FreeBSD/FreeBSD.git] / testdata / pymod_thread.tdir / pymod_thread.test
1 # #-- pymod_thread.test --#
2 # source the master var file when it's there
3 [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
4 # use .tpkg.var.test for in test variable passing
5 [ -f .tpkg.var.test ] && source .tpkg.var.test
6
7 PRE="../.."
8 if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then
9         echo "have python module"
10 else
11         echo "no python module"
12         exit 0
13 fi
14
15 if test "`uname 2>&1`" = "Darwin"; then
16         ldnsdir=`grep ldnsdir= ../../Makefile | sed -e 's/ldnsdir=//'`
17         echo export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$ldnsdir/lib:../../.libs"
18         export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$ldnsdir/lib:../../.libs"
19 fi
20
21 # see if config file verifies
22 if $PRE/unbound-checkconf ub.conf; then
23         echo "checkconf OK"
24 else
25         echo "checkconf failed"
26         exit 1
27 fi
28
29 # do the test
30 # generate some load.
31 echo "> dig www[1-10].example.com."
32 dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile1 &
33 dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
34 dig @localhost -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
35 dig @localhost -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
36 dig @localhost -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
37 dig @localhost -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
38 dig @localhost -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
39 dig @localhost -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
40 dig @localhost -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
41 dig @localhost -p $UNBOUND_PORT www10.example.com. | tee outfile10 &
42
43 wait  # wait for all jobs to complete.
44
45 echo "> cat logfiles"
46 cat fwd.log 
47 cat unbound.log
48 echo "> check answer"
49 for x in outfile1 outfile2 outfile3 outfile4 outfile5; do
50 if grep "192.168.1.1" $x; then
51         echo "$x OK"
52 else
53         echo "$x Not OK"
54         exit 1
55 fi
56 done
57
58 for x in outfile6 outfile7 outfile8 outfile9 outfile10; do
59 if grep "192.168.1.1" $x; then
60         echo "$x OK"
61 else
62         echo "$x Not OK"
63         exit 1
64 fi
65 done
66
67 exit 0