tests.sh revision 247bf378605811d695e968dbe930a7fc45c0038e
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews#!/bin/sh
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews#
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews *
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * Permission to use, copy, modify, and/or distribute this software for any
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * purpose with or without fee is hereby granted, provided that the above
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * copyright notice and this permission notice appear in all copies.
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews *
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# $Id: tests.sh,v 1.2 2010/06/21 02:31:45 marka Exp $
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark AndrewsSYSTEMTESTTOP=..
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews. $SYSTEMTESTTOP/conf.sh
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsstatus=0
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsn=0
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark AndrewsDIGOPTS="+noadd +nosea +nostat +nocmd +noauth +dnssec -p 5300"
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewszsk=ns1/`cat ns1/keyname`.key
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewszskpat=`awk '/DNSKEY/ { print $8 }' $zsk`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewszskid=`sed 's/^Kexample\.+005+0*//' < ns1/keyname`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsecho "I:checking for ZSK not yet published ($n)"
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsret=0
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$DIG $DIGOPTS -t dnskey example. @10.53.0.1 > dig.out.ns1.key$n || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# Note - this is looking for failure, hence the &&
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewstr -d ' ' < dig.out.ns1.key$n | grep $zskpat > /dev/null && ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$DIG $DIGOPTS -t txt txt.example. @10.53.0.1 > dig.out.ns1.txt$n || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# Note - this is looking for failure, hence the &&
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsgrep 'RRSIG.*'" $zskid "'example\. ' dig.out.ns1.txt$n > /dev/null && ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsn=`expr $n + 1`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsstatus=`expr $status + $ret`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# 5s real, 55s virtual, P +20
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewssleep 4
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsecho "I:checking for ZSK published but not yet active ($n)"
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsret=0
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$DIG $DIGOPTS -t dnskey example. @10.53.0.1 > dig.out.ns1.key$n || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewstr -d ' ' < dig.out.ns1.key$n | grep $zskpat > /dev/null || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# Note - this is looking for failure, hence the &&
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$DIG $DIGOPTS -t txt txt.example. @10.53.0.1 > dig.out.ns1.txt$n || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsgrep 'RRSIG.*'" $zskid "'example\. ' dig.out.ns1.txt$n > /dev/null && ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsn=`expr $n + 1`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsif [ $ret != 0 ] ; then echo "I:failed"; fi
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsstatus=`expr $status + $ret`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# 10s real, 2h15mn virtual, A +1h
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewssleep 5
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsecho "I:checking for ZSK active ($n)"
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsret=0
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$DIG $DIGOPTS -t dnskey example. @10.53.0.1 > dig.out.ns1.key$n || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewstr -d ' ' < dig.out.ns1.key$n | grep $zskpat > /dev/null || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$DIG $DIGOPTS -t txt txt.example. @10.53.0.1 > dig.out.ns1.txt$n || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsgrep 'RRSIG.*'" $zskid "'example\. ' dig.out.ns1.txt$n > /dev/null || ret=1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsn=`expr $n + 1`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsif [ $ret != 0 ] ; then echo "I:failed"; fi
status=`expr $status + $ret`
# 13s real, 45h virtual, I +1d
sleep 3
echo "I:checking for ZSK retired but not yet deleted ($n)"
ret=0
$DIG $DIGOPTS -t dnskey example. @10.53.0.1 > dig.out.ns1.key$n || ret=1
tr -d ' ' < dig.out.ns1.key$n | grep $zskpat > /dev/null || ret=1
# Note - this is looking for failure, hence the &&
$DIG $DIGOPTS -t txt txt.example. @10.53.0.1 > dig.out.ns1.txt$n || ret=1
grep 'RRSIG.*'" $zskid "'example\. ' dig.out.ns1.txt$n > /dev/null && ret=1
n=`expr $n + 1`
if [ $ret != 0 ] ; then echo "I:failed"; fi
status=`expr $status + $ret`
# 17s real, 103d virtual, D +1mo
sleep 4
echo "I:checking for ZSK deleted ($n)"
ret=0
$DIG $DIGOPTS -t dnskey example. @10.53.0.1 > dig.out.ns1.key$n || ret=1
# Note - this is looking for failure, hence the &&
tr -d ' ' < dig.out.ns1.key$n | grep $zskpat > /dev/null && ret=1
# Note - this is looking for failure, hence the &&
$DIG $DIGOPTS -t txt txt.example. @10.53.0.1 > dig.out.ns1.txt$n || ret=1
grep 'RRSIG.*'" $zskid "'example\. ' dig.out.ns1.txt$n > /dev/null && ret=1
n=`expr $n + 1`
if [ $ret != 0 ] ; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status