tests.sh revision 00164c8db201d5acce96972b510d51bfa057a9c8
#
# Copyright (C) 2011, 2012 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.15 2012/01/16 08:35:09 marka Exp $
DIGOPTS="+tcp +dnssec"
status=0
n=0
n=`expr $n + 1`
echo "I:checking that the zone is signed on initial transfer ($n)"
ret=0
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
echo "I:checking expired signatures are updated on load ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking removal of private type record via 'rndc signing -clear' ($n)"
ret=0
break; # We only want to remove 1 record for now.
do
ans=0
[ $num = 1 ] && break
sleep 1
done
n=`expr $n + 1`
echo "I:checking private type was properly signed ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking removal of remaining private type record via 'rndc signing -clear all' ($n)"
ret=0
do
ans=0
[ $ans = 1 ] || break
sleep 1
done
n=`expr $n + 1`
echo "I:checking negative private type response was properly signed ($n)"
ret=0
$NSUPDATE << EOF
zone bits
server 10.53.0.2 5300
update add added.bits 0 A 1.2.3.4
send
EOF
n=`expr $n + 1`
echo "I:checking that the record is added on the hidden master ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that update has been transfered and has been signed ($n)"
ret=0
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
$NSUPDATE << EOF
zone bits
server 10.53.0.2 5300
update add bits 0 SOA ns2.bits. . 2011072400 20 20 1814400 3600
send
EOF
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072400) serial on hidden master ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072400) serial in signed zone ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
echo "I:checking that the zone is signed on initial transfer, noixfr ($n)"
ret=0
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
$NSUPDATE << EOF
zone noixfr
server 10.53.0.4 5300
update add added.noixfr 0 A 1.2.3.4
send
EOF
n=`expr $n + 1`
echo "I:checking that the record is added on the hidden master, noixfr ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that update has been transfered and has been signed, noixfr ($n)"
ret=0
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
$NSUPDATE << EOF
zone noixfr
server 10.53.0.4 5300
update add noixfr 0 SOA ns4.noixfr. . 2011072400 20 20 1814400 3600
send
EOF
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072400) serial on hidden master, noixfr ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072400) serial in signed zone, noixfr ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
echo "I:checking that the master zone signed on initial load ($n)"
ret=0
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
echo "I:checking removal of private type record via 'rndc signing -clear' (master) ($n)"
ret=0
break; # We only want to remove 1 record for now.
do
ans=0
[ $num = 1 ] && break
sleep 1
done
n=`expr $n + 1`
echo "I:checking private type was properly signed (master) ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking removal of remaining private type record via 'rndc signing -clear' (master) ($n)"
ret=0
do
ans=0
[ $ans = 1 ] || break
sleep 1
done
n=`expr $n + 1`
echo "I:check adding of record to unsigned master ($n)"
ret=0
sleep 1
do
ans=0
[ $ans = 1 ] || break
sleep 1
done
n=`expr $n + 1`
echo "I:check the added record was properly signed ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that the dynamic master zone signed on initial load ($n)"
ret=0
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
echo "I:checking master zone that was updated while offline is correct ($n)"
ret=0
# serial should have changed
# e.updated should exist and should be signed
# updated.db.signed.jnl should exist, should have the source serial
# of master2.db, and should show a minimal diff: no more than 8 added
n=`expr $n + 1`
echo "I:checking adding of record to unsigned master using UPDATE ($n)"
ret=0
$NSUPDATE << EOF
zone dynamic
server 10.53.0.3 5300
update add e.dynamic 0 A 1.2.3.4
send
EOF
do
ans=0
[ $ans = 0 ] && break
sleep 1
done
n=`expr $n + 1`
echo "I:stop bump in the wire signer server ($n)"
ret=0
n=`expr $n + 1`
echo "I:update master zone while shutdown ($n)"
n=`expr $n + 1`
echo "I:restart bump in the wire signer server ($n)"
ret=0
####n=`expr $n + 1`
####echo "I:checking that update while server is offline is detected ($n)"
####ret=0
####$DIG $DIGOPTS @10.53.0.3 -p 5300 f.master A > dig.out.ns2.test$n
####grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
####grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
####grep "10.0.0.6" dig.out.ns2.test$n > /dev/null || ret=1
####if [ $ret != 0 ]; then echo "I:failed"; fi
####status=`expr $status + $ret`
$NSUPDATE << EOF
zone bits
server 10.53.0.2 5300
update add bits 0 SOA ns2.bits. . 2011072450 20 20 1814400 3600
send
EOF
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072450) serial on hidden master ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072450) serial in signed zone ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
$NSUPDATE << EOF
zone noixfr
server 10.53.0.4 5300
update add noixfr 0 SOA ns4.noixfr. . 2011072450 20 20 1814400 3600
send
EOF
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072450) serial on hidden master, noixfr ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking YYYYMMDDVV (2011072450) serial in signed zone, noixfr ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
$NSUPDATE << EOF
zone bits
server 10.53.0.3 5300
update add bits 0 SOA ns2.bits. . 2011072460 20 20 1814400 3600
send
EOF
n=`expr $n + 1`
echo "I:checking forwarded update on hidden master ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking forwarded update on signed zone ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
$NSUPDATE << EOF
zone noixfr
server 10.53.0.3 5300
update add noixfr 0 SOA ns4.noixfr. . 2011072460 20 20 1814400 3600
send
EOF
n=`expr $n + 1`
echo "I:checking forwarded update on hidden master, noixfr ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking forwarded update on signed zone, noixfr ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
echo "I:checking turning on of inline signing in a slave zone via reload ($n)"
do
ret=0
if [ $ret = 0 ]; then break; fi
sleep 1
done
n=`expr $n + 1`
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 freeze dynamic > freeze.test$n 2>&1 || { echo "I: rndc freeze dynamic failed" ; sed 's/^/I:/' < freeze.test$n ; ret=1; }
sleep 1
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 thaw dynamic > thaw.test$n 2>&1 || { echo "I: rndc thaw dynamic failed" ; ret=1; }
sleep 1
grep "zone dynamic/IN (unsigned): ixfr-from-differences: unchanged" ns3/named.run > /dev/null || ret=1
n=`expr $n + 1`
ret=0
sleep 1
awk '$2 == ";" && $3 == "serial" { print $1 + 1, $2, $3; next; }
{ print; }
n=`expr $n + 1`
echo "I:check added record freeze1.dynamic ($n)"
do
ret=0
test $ret = 0 && break
sleep 1
done
# allow 1 second so that file time stamps change
sleep 1
n=`expr $n + 1`
ret=0
sleep 1
awk '$2 == ";" && $3 == "serial" { print $1 + 1, $2, $3; next; }
{ print; }
n=`expr $n + 1`
echo "I:check added record freeze2.dynamic ($n)"
do
ret=0
test $ret = 0 && break
sleep 1
done
n=`expr $n + 1`
echo "I:check rndc sync removes both signed and unsigned journals ($n)"
ret=0
exit $status