tests.sh revision 485522d7e17da517fe91c21c642c8526c3ffb14c
#
# Copyright (C) 2010, 2011 Internet Systems Consortium, Inc. ("ISC")
#
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.11 2011/05/06 21:08:33 each Exp $
status=0
echo I:generating keys
# active zsk
# not yet published or active
# published but not active
# inactive
# active in 12 hours, inactive 12 hours after that...
# explicit successor to czk5
# (suppressing warning about lack of removal date)
# active ksk
# published but not YET active; will be active in 20 seconds
# $SETTIME moved after other $KEYGENs
# revoking key changes its ID
echo I:generating keys
echo "I:checking dnssec-signzone output matches expectations"
ret=0
echo "I:rechecking dnssec-signzone output with -x"
ret=0
# use an alternate output file so -x doesn't interfere with later checks
echo "I:checking parent zone DNSKEY set"
ret=0
echo "I:checking parent zone DS records"
ret=0
# revoked key should not be there, hence the &&
echo "I:checking child zone DNSKEY set"
ret=0
# should not be there, hence the &&
#grep "key id = $czpredecessor" $cfile.signed > /dev/null && ret=1
#grep "key id = $czsuccessor" $cfile.signed > /dev/null && ret=1
echo "I:checking key TTLs are correct"
echo "I:checking key TTLs were imported correctly"
awk 'BEGIN {r = 0} $2 == "DNSKEY" && $1 != 30 {r = 1} END {exit r}' \
echo "I:re-signing and checking imported TTLs again"
awk 'BEGIN {r = 0} $2 == "DNSKEY" && $1 != 15 {r = 1} END {exit r}' \
echo "I:checking child zone signatures"
ret=0
# check DNSKEY signatures first
# should not be there:
# now check other signatures first
# should not be there:
echo "I:checking RRSIG expiry date correctness"
dnskey_expiry=`$CHECKZONE -o - $czone $cfile.signed 2> /dev/null |
soa_expiry=`$CHECKZONE -o - $czone $cfile.signed 2> /dev/null |
echo "I:waiting 20 seconds for key activation"
sleep 20
echo "I:re-signing child zone"
echo "I:checking dnssec-signzone output matches expectations"
ret=0
echo "I:checking child zone signatures again"
ret=0
echo "I:exit status: $status"
exit $status