From: Evan Hunt Date: Mon, 21 Mar 2011 18:06:07 +0000 (+0000) Subject: Forgot to add rndc test dir when committing "rndc sync" change to HEAD X-Git-Tag: v9.9.0a1~444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf0d508b1eb836150fd2fc9c3d497525ed8fbe66;p=thirdparty%2Fbind9.git Forgot to add rndc test dir when committing "rndc sync" change to HEAD --- diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in index f21a1c2ba9b..f68136f3b11 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -15,7 +15,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: conf.sh.in,v 1.65 2011/03/18 21:14:19 fdupont Exp $ +# $Id: conf.sh.in,v 1.66 2011/03/21 18:06:06 each Exp $ # # Common configuration data for system tests, to be sourced into @@ -56,7 +56,7 @@ SUBDIRS="acl allow_query addzone autosign cacheclean checkconf checknames checkzone database dlv dlvauto @DLZ_SYSTEM_TEST@ dlzexternal dname dns64 dnssec forward glue gost ixfr limits logfileconfig lwresd masterfile masterformat metadata notify - nsupdate pending pkcs11 redirect resolver rpz rrsetorder + nsupdate pending pkcs11 redirect resolver rndc rpz rrsetorder sortlist smartsign staticstub stub tkey tsig tsiggss unknown upforwd views xfer xferquota zonechecks" diff --git a/bin/tests/system/rndc/clean.sh b/bin/tests/system/rndc/clean.sh new file mode 100644 index 00000000000..c3096179028 --- /dev/null +++ b/bin/tests/system/rndc/clean.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# 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: clean.sh,v 1.2 2011/03/21 18:06:06 each Exp $ + +rm -f ns2/*.db ns2/*.jnl +rm -f ns2/session.key +rm -f ns2/named.memstats diff --git a/bin/tests/system/rndc/ns2/named.conf b/bin/tests/system/rndc/ns2/named.conf new file mode 100644 index 00000000000..ead1efc813d --- /dev/null +++ b/bin/tests/system/rndc/ns2/named.conf @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC") + * + * Permission to use, copy, modify, and/or distribute this software for any + * 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: named.conf,v 1.2 2011/03/21 18:06:07 each Exp $ */ + +controls { /* empty */ }; + +options { + port 5300; + pid-file "named.pid"; + session-keyfile "session.key"; + listen-on { 10.53.0.2; }; + listen-on-v6 { none; }; + recursion no; +}; + +key rndc_key { + secret "1234abcd8765"; + algorithm hmac-md5; +}; + +controls { + inet 10.53.0.2 port 9953 allow { any; } keys { rndc_key; }; +}; + + +zone "." { + type hint; + file "../../common/root.hint"; +}; + +zone "nil" { + type master; + update-policy local; + file "nil.db"; +}; + +zone "other" { + type master; + update-policy local; + file "other.db"; +}; + +zone "static" { + type master; + file "static.db"; +}; diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh new file mode 100644 index 00000000000..8927e837da5 --- /dev/null +++ b/bin/tests/system/rndc/setup.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# 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: setup.sh,v 1.2 2011/03/21 18:06:06 each Exp $ + +sh clean.sh + +sh ../genzone.sh 2 >ns2/nil.db +sh ../genzone.sh 2 >ns2/other.db +sh ../genzone.sh 2 >ns2/static.db diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh new file mode 100644 index 00000000000..0852f202c22 --- /dev/null +++ b/bin/tests/system/rndc/tests.sh @@ -0,0 +1,168 @@ +#!/bin/sh +# +# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# 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.2 2011/03/21 18:06:06 each Exp $ + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd" +DIGCMD="$DIG $DIGOPTS @10.53.0.2 -p 5300" +RNDCCMD="$RNDC -s 10.53.0.2 -p 9953 -c ../common/rndc.conf" + +status=0 + +echo "I:preparing" +ret=0 +$NSUPDATE -p 5300 -k ns2/session.key > /dev/null 2>&1 < /dev/null 2>&1 || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking journal file is still present" +ret=0 +[ -s ns2/nil.db.jnl ] || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking zone not writable" +ret=0 +$NSUPDATE -p 5300 -k ns2/session.key > /dev/null 2>&1 </dev/null && ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:rndc thaw" +$RNDCCMD thaw nil | sed 's/^/I:ns2 /' + +echo "I:checking zone now writable" +ret=0 +$NSUPDATE -p 5300 -k ns2/session.key > /dev/null 2>&1 </dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:rndc sync" +ret=0 +$RNDCCMD sync nil | sed 's/^/I:ns2 /' + +echo "I:checking zone was dumped" +ret=0 +grep "addition 3" ns2/nil.db > /dev/null 2>&1 || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking journal file is still present" +ret=0 +[ -s ns2/nil.db.jnl ] || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking zone is still writable" +ret=0 +$NSUPDATE -p 5300 -k ns2/session.key > /dev/null 2>&1 </dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:rndc sync -clean" +ret=0 +$RNDCCMD sync -clean nil | sed 's/^/I:ns2 /' + +echo "I:checking zone was dumped" +ret=0 +grep "addition 4" ns2/nil.db > /dev/null 2>&1 || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking journal file is deleted" +ret=0 +[ -s ns2/nil.db.jnl ] && ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking zone is still writable" +ret=0 +$NSUPDATE -p 5300 -k ns2/session.key > /dev/null 2>&1 </dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking other journal files not removed" +ret=0 +[ -s ns2/other.db.jnl ] || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:cleaning all zones" +$RNDCCMD sync -clean | sed 's/^/I:ns2 /' + +echo "I:checking all journals removed" +ret=0 +[ -s ns2/nil.db.jnl ] && ret=1 +[ -s ns2/other.db.jnl ] && ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:checking that freezing static zones is not allowed" +ret=0 +$RNDCCMD freeze static 2>&1 | grep 'not dynamic' > /dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +echo "I:exit status: $status" +exit $status