Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / delv / tests.sh
blob2b0d1f98bf759920acc1d8e86446086d18c8fb68
1 # Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
3 # Permission to use, copy, modify, and/or distribute this software for any
4 # purpose with or without fee is hereby granted, provided that the above
5 # copyright notice and this permission notice appear in all copies.
7 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13 # PERFORMANCE OF THIS SOFTWARE.
15 SYSTEMTESTTOP=..
16 . $SYSTEMTESTTOP/conf.sh
18 status=0
19 n=0
20 # using delv insecure mode as not testing dnssec here
21 DELVOPTS="-i -p 5300"
23 if [ -x ${DELV} ] ; then
24 n=`expr $n + 1`
25 echo "I:checking delv short form works ($n)"
26 ret=0
27 $DELV $DELVOPTS @10.53.0.3 +short a a.example > delv.out.test$n || ret=1
28 if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi
29 if [ $ret != 0 ]; then echo "I:failed"; fi
30 status=`expr $status + $ret`
32 n=`expr $n + 1`
33 echo "I:checking delv split width works ($n)"
34 ret=0
35 $DELV $DELVOPTS @10.53.0.3 +split=4 -t sshfp foo.example > delv.out.test$n || ret=1
36 grep " 9ABC DEF6 7890 " < delv.out.test$n > /dev/null || ret=1
37 if [ $ret != 0 ]; then echo "I:failed"; fi
38 status=`expr $status + $ret`
40 echo "I:checking delv with IPv6 on IPv4 does not work ($n)"
41 n=`expr $n + 1`
42 if $TESTSOCK6 fd92:7065:b8e:ffff::3
43 then
44 ret=0
45 # following should fail because @IPv4 overrides earlier @IPv6 above
46 # and -6 forces IPv6 so this should fail, such as:
47 # ;; getaddrinfo failed: hostname nor servname provided, or not known
48 # ;; resolution failed: not found
49 # note that delv returns success even on lookup failure
50 $DELV $DELVOPTS @fd92:7065:b8e:ffff::3 @10.53.0.3 -6 -t txt foo.example > delv.out.test$n 2>&1 || ret=1
51 # it should have no results but error output
52 grep "testing" < delv.out.test$n > /dev/null && ret=1
53 grep "getaddrinfo failed:" < delv.out.test$n > /dev/null || ret=1
54 if [ $ret != 0 ]; then echo "I:failed"; fi
55 status=`expr $status + $ret`
56 else
57 echo "I:IPv6 unavailable; skipping"
60 n=`expr $n + 1`
61 echo "I:checking delv with reverse lookup works ($n)"
62 ret=0
63 $DELV $DELVOPTS @10.53.0.3 -x 127.0.0.1 > delv.out.test$n 2>&1 || ret=1
64 # doesn't matter if has answer
65 grep -i "127\.in-addr\.arpa\." < delv.out.test$n > /dev/null || ret=1
66 if [ $ret != 0 ]; then echo "I:failed"; fi
67 status=`expr $status + $ret`
69 exit $status
70 else
71 echo "$DELV is needed, so skipping these delv tests"