etc/services - sync with NetBSD-8
[minix.git] / external / bsd / bind / dist / bin / tests / bigtest / tests.sh
blob850416d091bcda75de478cd0a3c5005eff494bec
1 #!/bin/bash
3 # Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 TOP=$( (cd ../../.. && pwd) )
18 dig=${TOP}/bin/dig/dig
20 cmd="${dig} -p 5300 @127.127.0.0 txt"
21 inner() {
22 zone=$1 i=$2 to=$3
23 x=$i
24 dout=dig$x.out
25 tout=time$x.out
26 while [ $i -lt $to ]
28 case $zone in
29 .) zone=;;
30 esac
32 (time -p $cmd $i.${sub}$zone > $dout ) 2> $tout
33 s=`sed -n '/real/s/[^0-9]*\([0-9]*\)\..*/\1/p' $tout`
34 case $s in
35 0);;
36 1) t1=`expr ${t1:-0} + 1`;;
37 2) t2=`expr ${t2:-0} + 1`;;
38 3) t3=`expr ${t3:-0} + 1`;;
39 *) echo $i `grep real $tout`;;
40 esac
42 grep "status: \(NXDOMAIN\|NOERROR\)" $dout > /dev/null || {
43 echo $cmd $i.${sub}$zone
44 cat $dout
46 i=`expr $i + 1`
47 done
48 if test ${t1:-0} -ne 0 -o ${t2:-0} -ne 0 -o ${t3:-0} -ne 0
49 then
50 echo "$x timeouts: t1=${t1:-0} t2=${t2:-0} t3=${t3:-0}"
54 while read zone rest
56 for sub in "" medium. big.
58 case $zone in
59 .) echo doing ${sub:-.};;
60 *) echo doing $sub$zone;;
61 esac
62 ( inner $zone 1 100) &
63 ( inner $zone 101 200) &
64 ( inner $zone 201 300) &
65 ( inner $zone 301 400) &
66 ( inner $zone 401 500) &
67 ( inner $zone 501 600) &
68 ( inner $zone 601 700) &
69 ( inner $zone 701 800) &
70 ( inner $zone 801 900) &
71 ( inner $zone 901 1000) &
72 ( inner $zone 1001 1100) &
73 ( inner $zone 1101 1200) &
74 ( inner $zone 1201 1300) &
75 ( inner $zone 1301 1400) &
76 ( inner $zone 1401 1500) &
77 ( inner $zone 1501 1600) &
78 ( inner $zone 1601 1700) &
79 wait
80 done
81 done