| 1 |
# #-- fwd_oneport.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 |
# do the test |
| 9 |
|
| 10 |
# skip the single query test |
| 11 |
# so that all three queries get timeouts during the later test. |
| 12 |
# |
| 13 |
#echo "> dig www1.example.com." |
| 14 |
#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile |
| 15 |
#echo "> cat logfiles" |
| 16 |
#cat fwd.log |
| 17 |
#cat unbound.log |
| 18 |
#echo "> check answer for single query" |
| 19 |
#if grep "10.20.30.40" outfile; then |
| 20 |
#echo "OK" |
| 21 |
#else |
| 22 |
#echo "Not OK" |
| 23 |
#exit 1 |
| 24 |
#fi |
| 25 |
|
| 26 |
echo "> do queries" |
| 27 |
dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 & |
| 28 |
digpid1=$! |
| 29 |
dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 & |
| 30 |
digpid2=$! |
| 31 |
dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 & |
| 32 |
digpid3=$! |
| 33 |
dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. >outfile4 & |
| 34 |
digpid4=$! |
| 35 |
dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. >outfile5 & |
| 36 |
digpid5=$! |
| 37 |
dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. >outfile6 & |
| 38 |
digpid6=$! |
| 39 |
sleep 12 |
| 40 |
kill -9 $digpid1 |
| 41 |
kill -9 $digpid2 |
| 42 |
kill -9 $digpid3 |
| 43 |
kill -9 $digpid4 |
| 44 |
kill -9 $digpid5 |
| 45 |
kill -9 $digpid6 |
| 46 |
|
| 47 |
echo "> cat outfile1" |
| 48 |
cat outfile1 |
| 49 |
echo "> cat outfile2" |
| 50 |
cat outfile2 |
| 51 |
echo "> cat outfile3" |
| 52 |
cat outfile3 |
| 53 |
echo "> cat outfile4" |
| 54 |
cat outfile4 |
| 55 |
echo "> cat outfile5" |
| 56 |
cat outfile5 |
| 57 |
echo "> cat outfile6" |
| 58 |
cat outfile6 |
| 59 |
echo "> cat logfiles" |
| 60 |
cat fwd.log |
| 61 |
cat unbound.log |
| 62 |
|
| 63 |
echo "> check for ID bit collisions" |
| 64 |
grep "pending reply" unbound.log > ids |
| 65 |
numsend=`cat ids | wc -l` |
| 66 |
cat ids | awk '{print $8};' | sort -u > ids2 |
| 67 |
numuniq=`cat ids2 | wc -l` |
| 68 |
if test $numuniq -ne $numsend; then |
| 69 |
echo "got a ID number clash. could not do test, sorry" |
| 70 |
exit 0 |
| 71 |
fi |
| 72 |
|
| 73 |
echo "> check answers for queries" |
| 74 |
if grep "10.20.30.40" outfile1; then |
| 75 |
echo "1 is OK" |
| 76 |
else |
| 77 |
echo "1 is not OK" |
| 78 |
exit 1 |
| 79 |
fi |
| 80 |
if grep "10.20.30.50" outfile2; then |
| 81 |
echo "2 is OK" |
| 82 |
else |
| 83 |
echo "2 is not OK" |
| 84 |
exit 1 |
| 85 |
fi |
| 86 |
if grep "10.20.30.60" outfile3; then |
| 87 |
echo "3 is OK" |
| 88 |
else |
| 89 |
echo "3 is not OK" |
| 90 |
exit 1 |
| 91 |
fi |
| 92 |
if grep "10.20.30.70" outfile4; then |
| 93 |
echo "4 is OK" |
| 94 |
else |
| 95 |
echo "4 is not OK" |
| 96 |
exit 1 |
| 97 |
fi |
| 98 |
if grep "10.20.30.80" outfile5; then |
| 99 |
echo "5 is OK" |
| 100 |
else |
| 101 |
echo "5 is not OK" |
| 102 |
exit 1 |
| 103 |
fi |
| 104 |
if grep "10.20.30.90" outfile6; then |
| 105 |
echo "6 is OK" |
| 106 |
else |
| 107 |
echo "6 is not OK" |
| 108 |
exit 1 |
| 109 |
fi |
| 110 |
|
| 111 |
exit 0 |