Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / sit / tests.sh
bloba34f7292e06917853d488622525751103d114996
1 #!/bin/sh
3 # Copyright (C) 2014 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 # Id: tests.sh,v 1.22 2012/02/09 23:47:18 tbox Exp
19 SYSTEMTESTTOP=..
20 . $SYSTEMTESTTOP/conf.sh
22 status=0
23 n=0
25 getsit() {
26 awk '$2 == "SIT:" {
27 print $3;
28 }' < $1
31 havetc() {
32 grep 'flags:.* tc[^;]*;' $1 > /dev/null
35 for bad in bad*.conf
37 ret=0
38 echo "I:checking that named-checkconf detects error in $bad"
39 $CHECKCONF $bad > /dev/null 2>&1
40 if [ $? != 1 ]; then echo "I:failed"; ret=1; fi
41 status=`expr $status + $ret`
42 done
44 n=`expr $n + 1`
45 echo "I:checking SIT token returned to empty SIT option ($n)"
46 ret=0
47 $DIG +qr +sit version.bind txt ch @10.53.0.1 -p 5300 > dig.out.test$n
48 grep SIT: dig.out.test$n > /dev/null || ret=1
49 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
50 if [ $ret != 0 ]; then echo "I:failed"; fi
51 status=`expr $status + $ret`
53 n=`expr $n + 1`
54 echo "I:checking response size without SIT ($n)"
55 ret=0
56 $DIG large.example txt @10.53.0.1 -p 5300 +ignore > dig.out.test$n
57 havetc dig.out.test$n || ret=1
58 if [ $ret != 0 ]; then echo "I:failed"; fi
59 status=`expr $status + $ret`
61 n=`expr $n + 1`
62 echo "I:checking response size without valid SIT ($n)"
63 ret=0
64 $DIG +sit large.example txt @10.53.0.1 -p 5300 +ignore > dig.out.test$n
65 havetc dig.out.test$n || ret=1
66 grep "; SIT:.*(good)" dig.out.test$n > /dev/null || ret=1
67 if [ $ret != 0 ]; then echo "I:failed"; fi
68 status=`expr $status + $ret`
70 n=`expr $n + 1`
71 echo "I:checking response size with SIT ($n)"
72 ret=0
73 $DIG +sit large.example txt @10.53.0.1 -p 5300 > dig.out.test$n.l
74 sit=`getsit dig.out.test$n.l`
75 $DIG +qr +sit=$sit large.example txt @10.53.0.1 -p 5300 +ignore > dig.out.test$n
76 havetc dig.out.test$n && ret=1
77 grep "; SIT:.*(good)" dig.out.test$n > /dev/null || ret=1
78 if [ $ret != 0 ]; then echo "I:failed"; fi
79 status=`expr $status + $ret`
81 n=`expr $n + 1`
82 echo "I:checking response size with SIT recursive ($n)"
83 ret=0
84 $DIG +qr +sit=$sit large.xxx txt @10.53.0.1 -p 5300 +ignore > dig.out.test$n
85 havetc dig.out.test$n && ret=1
86 grep "; SIT:.*(good)" dig.out.test$n > /dev/null || ret=1
87 if [ $ret != 0 ]; then echo "I:failed"; fi
88 status=`expr $status + $ret`
90 n=`expr $n + 1`
91 echo "I:checking for SIT value in adb ($n)"
92 ret=0
93 $RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 dumpdb
94 sleep 1
95 grep "10.53.0.2.*\[sit=" ns1/named_dump.db > /dev/null|| ret=1
96 if [ $ret != 0 ]; then echo "I:failed"; fi
97 status=`expr $status + $ret`
99 echo "I:exit status: $status"
100 exit $status