3 # Copyright (C) 2010, 2012, 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.3 2010/06/08 23:50:24 tbox Exp
20 .
$SYSTEMTESTTOP/conf.sh
22 DIGOPTS
="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
27 supported
=`cat supported`
29 rsaonly
) algs
="rsa" ;;
30 ecconly
) algs
="ecc" ;;
31 both
) algs
="rsa ecc" ;;
36 zonefile
=ns
1/$alg.example.db
37 echo "I:testing PKCS#11 key generation ($alg)"
38 count
=`$PK11LIST | grep robie-$alg-ksk | wc -l`
39 if [ $count != 2 ]; then echo "I:failed"; status
=1; fi
41 echo "I:testing offline signing with PKCS#11 keys ($alg)"
43 count
=`grep RRSIG $zonefile.signed | wc -l`
44 if [ $count != 12 ]; then echo "I:failed"; status
=1; fi
46 echo "I:testing inline signing with PKCS#11 keys ($alg)"
48 $NSUPDATE > /dev
/null
<<END || status=1
52 update add `grep -v ';' ns1/${alg}.key`
56 echo "I:waiting 20 seconds for key changes to take effect"
59 $DIG $DIGOPTS ns.
$alg.example. @
10.53.0.1 a
> dig.out || ret
=1
60 if [ $ret != 0 ]; then echo "I:failed"; fi
61 status
=`expr $status + $ret`
62 count
=`grep RRSIG dig.out | wc -l`
63 if [ $count != 4 ]; then echo "I:failed"; status
=1; fi
65 echo "I:testing PKCS#11 key destroy ($alg)"
67 $PK11DEL -l robie-
$alg-ksk -w0 > /dev
/null
2>&1 || ret
=1
68 $PK11DEL -l robie-
$alg-zsk1 -w0 > /dev
/null
2>&1 || ret
=1
73 $PK11DEL -i $id -w0 > /dev
/null
2>&1 || ret
=1
74 if [ $ret != 0 ]; then echo "I:failed"; fi
75 status
=`expr $status + $ret`
76 count
=`$PK11LIST | grep robie-$alg | wc -l`
77 if [ $count != 0 ]; then echo "I:failed"; fi
78 status
=`expr $status + $count`
81 echo "I:exit status: $status"