3 # Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2001 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: tests.sh,v 1.9 2009/07/19 23:47:55 tbox Exp
21 .
$SYSTEMTESTTOP/conf.sh
23 DIGOPTS
="@10.53.0.1 -p 5300"
29 echo "I:generating new DH key"
31 dhkeyname
=`$KEYGEN -T KEY -a DH -b 768 -n host -r $RANDFILE client` || ret
=1
32 if [ $ret != 0 ]; then
34 echo "I:exit status: $status"
37 status
=`expr $status + $ret`
39 for owner
in . foo.example.
41 echo "I:creating new key using owner name \"$owner\""
43 keyname
=`./keycreate $dhkeyname $owner` || ret
=1
44 if [ $ret != 0 ]; then
46 echo "I:exit status: $status"
49 status
=`expr $status + $ret`
51 echo "I:checking the new key"
53 $DIG $DIGOPTS . ns
-k $keyname > dig.out
.1 || ret
=1
54 grep "status: NOERROR" dig.out
.1 > /dev
/null || ret
=1
55 grep "TSIG.*hmac-md5.*NOERROR" dig.out
.1 > /dev
/null || ret
=1
56 grep "Some TSIG could not be validated" dig.out
.1 > /dev
/null
&& ret
=1
57 if [ $ret != 0 ]; then
60 status
=`expr $status + $ret`
62 echo "I:deleting new key"
64 .
/keydelete
$keyname || ret
=1
65 if [ $ret != 0 ]; then
68 status
=`expr $status + $ret`
70 echo "I:checking that new key has been deleted"
72 $DIG $DIGOPTS . ns
-k $keyname > dig.out
.2 || ret
=1
73 grep "status: NOERROR" dig.out
.2 > /dev
/null
&& ret
=1
74 grep "TSIG.*hmac-md5.*NOERROR" dig.out
.2 > /dev
/null
&& ret
=1
75 grep "Some TSIG could not be validated" dig.out
.2 > /dev
/null || ret
=1
76 if [ $ret != 0 ]; then
79 status
=`expr $status + $ret`
82 echo "I:exit status: $status"