aboutsummaryrefslogtreecommitdiff
path: root/testdata/pymod_thread.tdir/pymod_thread.test
blob: 2b0464ae8c473138335ed49a58885a0dc12b3906 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# #-- 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 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 @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile1 &
dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
dig @127.0.0.1 -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
dig @127.0.0.1 -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
dig @127.0.0.1 -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
dig @127.0.0.1 -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