tests.sh revision ba751492fcc4f161a18b983d4f018a1a52938cb9
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# Copyright (C) 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# purpose with or without fee is hereby granted, provided that the above
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# copyright notice and this permission notice appear in all copies.
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews# $Id: tests.sh,v 1.3 2010/06/08 23:50:24 tbox Exp $
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark AndrewsDIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews echo "I:testing PKCS#11 key generation ($alg)"
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews count=`$PK11LIST | grep robie-$alg-ksk | wc -l`
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews if [ $count != 2 ]; then echo "I:failed"; status=1; fi
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews echo "I:testing offline signing with PKCS#11 keys ($alg)"
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews if [ $count != 12 ]; then echo "I:failed"; status=1; fi
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews echo "I:testing inline signing with PKCS#11 keys ($alg)"
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrewsserver 10.53.0.1 5300
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrewszone $alg.example.
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrewsupdate add `grep -v ';' ns1/${alg}.key`
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews echo "I:waiting 20 seconds for key changes to take effect"
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews $DIG $DIGOPTS ns.$alg.example. @10.53.0.1 a > dig.out || ret=1
1c9f629c181dfd14bb429a6699d22c3c023aa218Mark Andrews if [ $count != 4 ]; then echo "I:failed"; status=1; fi
echo "I:testing PKCS#11 key destroy ($alg)"
echo "I:exit status: $status"
exit $status