tests.sh revision dc2a4887c40b1ee361cef51e188b386e19497e01
#
# Copyright (C) 2011-2016 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.4.154.1 2012/01/04 20:05:03 smann Exp $
DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
status=0
echo "I:preparing"
ret=0
server 10.53.0.2
zone nil.
update add text1.nil. 600 IN TXT "addition 1"
send
zone other.
update add text1.other. 600 IN TXT "addition 1"
send
END
echo "I:rndc freeze"
echo "I:checking zone was dumped"
ret=0
echo "I:checking journal file is still present"
ret=0
echo "I:checking zone not writable"
ret=0
server 10.53.0.2
zone nil.
update add text2.nil. 600 IN TXT "addition 2"
send
END
echo "I:rndc thaw"
echo "I:checking zone now writable"
ret=0
server 10.53.0.2
zone nil.
update add text3.nil. 600 IN TXT "addition 3"
send
END
echo "I:rndc sync"
ret=0
echo "I:checking zone was dumped"
ret=0
echo "I:checking journal file is still present"
ret=0
echo "I:checking zone is still writable"
ret=0
server 10.53.0.2
zone nil.
update add text4.nil. 600 IN TXT "addition 4"
send
END
echo "I:rndc sync -clean"
ret=0
echo "I:checking zone was dumped"
ret=0
echo "I:checking journal file is deleted"
ret=0
echo "I:checking zone is still writable"
ret=0
server 10.53.0.2
zone nil.
update add text5.nil. 600 IN TXT "addition 5"
send
END
echo "I:checking other journal files not removed"
ret=0
echo "I:cleaning all zones"
echo "I:checking all journals removed"
ret=0
echo "I:checking that freezing static zones is not allowed"
ret=0
echo "I:checking that journal is removed when serial is changed before thaw"
ret=0
sleep 1
server 10.53.0.2
zone other.
update add text6.other. 600 IN TXT "addition 6"
send
END
sleep 1
server 10.53.0.2
zone other.
update add text7.other. 600 IN TXT "addition 7"
send
END
echo "I:checking that journal is kept when ixfr-from-differences is in use"
ret=0
server 10.53.0.2
zone nil.
update add text6.nil. 600 IN TXT "addition 6"
send
END
sleep 1
server 10.53.0.2
zone nil.
update add text7.nil. 600 IN TXT "addition 7"
send
END
# temp test
echo "I:dumping stats"
echo "I: verifying adb records in named.stats"
echo "I:test using second key"
ret=0
echo "I:test 'rndc dumpdb' on a empty cache"
ret=0
do
tmp=0
sleep 1
done
echo "I:test 'rndc reload' on a zone with include files"
ret=0
do
tmp=0
sleep 1
done
do
tmp=0
sleep 1
done
echo "I:testing rndc with hmac-md5"
ret=0
do
done
echo "I:testing rndc with hmac-sha1"
ret=0
do
done
echo "I:testing rndc with hmac-sha224"
ret=0
do
done
echo "I:testing rndc with hmac-sha256"
ret=0
do
done
echo "I:testing rndc with hmac-sha384"
ret=0
do
done
echo "I:testing rndc with hmac-sha512"
ret=0
do
done
echo "I:testing automatic zones are reported"
ret=0
echo "I:testing rndc with null command"
ret=0
echo "I:testing rndc with unknown control channel command"
ret=0
# rndc: 'obviouslynotacommand' failed: unknown command
echo "I:testing rndc with querylog command"
ret=0
# first enable it with querylog on option
# query for builtin and check if query was logged
# toggle query logging and check again
# query for another builtin zone and check if query was logged
echo "I:testing rndc nta time limits"
ret=0
$RNDC -s 10.53.0.4 -p 9956 -c ns4/key6.conf nta -l 2h nta1.example 2>&1 | grep "Negative trust anchor added" > /dev/null || ret=1
$RNDC -s 10.53.0.4 -p 9956 -c ns4/key6.conf nta -l 1d nta2.example 2>&1 | grep "Negative trust anchor added" > /dev/null || ret=1
$RNDC -s 10.53.0.4 -p 9956 -c ns4/key6.conf nta -l 1w nta3.example 2>&1 | grep "Negative trust anchor added" > /dev/null || ret=1
$RNDC -s 10.53.0.4 -p 9956 -c ns4/key6.conf nta -l 8d nta4.example 2>&1 | grep "NTA lifetime cannot exceed one week" > /dev/null || ret=1
do
echo "I:testing rndc buffer size limits (size=${i})"
ret=0
if [ "$?" = "0" ]; then
expected_size=`expr $i + 1`
else
ret=1
fi
done
echo "I:testing rndc -r (show result)"
ret=0
echo "I:testing rndc with a token containing a space"
ret=0
$RNDC -s 10.53.0.4 -p 9956 -c ns4/key6.conf -r flush '"view with a space"' 2>&1 > rndc.output || ret=1
echo "I:test 'rndc reconfig' with a broken config"
ret=0
sleep 1
sleep 1
sleep 1
echo "I:test read-only control channel access"
ret=0
echo "I:test rndc status shows running on"
ret=0
if [ -x "$PYTHON" ]; then
echo "I:test rndc python bindings"
ret=0
$PYTHON > rndc.output << EOF
import sys
sys.path.insert(0, '../../../../bin/python')
from isc import *
r = rndc(('10.53.0.5', 9953), 'hmac-sha256', '1234abcd8765')
result = r.call('status')
print(result['text'])
EOF
fi
exit $status