6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#!/bin/sh
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
dce54b9b5cfa450570fe9c11644450aeb3ee89f3Tinderbox User# Copyright (C) 2004, 2007, 2009, 2012-2016 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark AndrewsSYSTEMTESTTOP=..
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews. $SYSTEMTESTTOP/conf.sh
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsstatus=0
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which refers to a CNAME"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE . cname.db > cname.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "is a CNAME" cname.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which is below a DNAME"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE . dname.db > dname.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "is below a DNAME" dname.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which has no address records (A/AAAA)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE . noaddress.db > noaddress.out
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "has no address records" noaddress.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which has no records"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE . nxdomain.db > nxdomain.out
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "has no address records" noaddress.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a A record (fail)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE -n fail . a.db > a.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" a.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a A record (warn=default)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE . a.db > a.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" a.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a A record (ignore)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE -n ignore . a.db > a.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" a.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a AAAA record (fail)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE -n fail . aaaa.db > aaaa.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" aaaa.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a AAAA record (warn=default)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE . aaaa.db > aaaa.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" aaaa.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews#
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a AAAA record (ignore)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsif $CHECKZONE -n ignore . aaaa.db > aaaa.out 2>&1
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsthen
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" aaaa.out > /dev/null
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews then
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews else
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews :
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews fi
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewselse
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsfi
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt#
2855e2772342e369cc8962659beac7b3001b4ec6Evan Huntecho "I: checking 'rdnc zonestatus' output"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Huntret=0
53d4f17eac64412549ef8874a81662a0371657abMark Andrewsfor i in 0 1 2 3 4 5 6 7 8 9
53d4f17eac64412549ef8874a81662a0371657abMark Andrewsdo
53d4f17eac64412549ef8874a81662a0371657abMark Andrews $RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus master.example > rndc.out.master 2>&1
53d4f17eac64412549ef8874a81662a0371657abMark Andrews grep "zone not loaded" rndc.out.master > /dev/null || break
53d4f17eac64412549ef8874a81662a0371657abMark Andrews sleep 1
53d4f17eac64412549ef8874a81662a0371657abMark Andrewsdone
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor() {
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrews grep "$1" $2 > /dev/null || {
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrews ret=1;
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaraman echo "I: missing string '$1' from '$2'"
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrews }
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrews}
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "name: master.example" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "type: master" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "files: master.db, master.db.signed" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "serial: " rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "nodes: " rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "last loaded: " rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "secure: yes" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "inline signing: no" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "key maintenance: automatic" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "next key event: " rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "next resign node: " rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "next resign time: " rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "dynamic: yes" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "frozen: no" rndc.out.master
53d4f17eac64412549ef8874a81662a0371657abMark Andrewsfor i in 0 1 2 3 4 5 6 7 8 9
53d4f17eac64412549ef8874a81662a0371657abMark Andrewsdo
53d4f17eac64412549ef8874a81662a0371657abMark Andrews $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 zonestatus master.example > rndc.out.slave 2>&1
53d4f17eac64412549ef8874a81662a0371657abMark Andrews grep "zone not loaded" rndc.out.slave > /dev/null || break
53d4f17eac64412549ef8874a81662a0371657abMark Andrews sleep 1
53d4f17eac64412549ef8874a81662a0371657abMark Andrewsdone
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "name: master.example" rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "type: slave" rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "files: slave.db" rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "serial: " rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "nodes: " rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "next refresh: " rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "expires: " rndc.out.slave
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "secure: yes" rndc.out.slave
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsfor i in 0 1 2 3 4 5 6 7 8 9
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsdo
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews $RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus reload.example > rndc.out.prereload 2>&1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews grep "zone not loaded" rndc.out.prereload > /dev/null || break
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews sleep 1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsdone
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewscheckfor "files: reload.db, soa.db$" rndc.out.prereload
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsecho "@ 0 SOA . . 2 0 0 0 0" > ns1/soa.db
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload reload.example
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsfor i in 0 1 2 3 4 5 6 7 8 9
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsdo
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews $DIG reload.example SOA @10.53.0.1 -p 5300 > dig.out
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews grep " 2 0 0 0 0" dig.out >/dev/null && break
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews sleep 1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsdone
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus reload.example > rndc.out.postreload 2>&1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewscheckfor "files: reload.db, soa.db$" rndc.out.postreload
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewssleep 1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsecho "@ 0 SOA . . 3 0 0 0 0" > ns1/reload.db
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsecho "@ 0 NS ." >> ns1/reload.db
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload reload.example
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsfor i in 0 1 2 3 4 5 6 7 8 9
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsdo
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews $DIG reload.example SOA @10.53.0.1 -p 5300 > dig.out
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews grep " 3 0 0 0 0" dig.out >/dev/null && break
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews sleep 1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewsdone
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus reload.example > rndc.out.removeinclude 2>&1
7d65cbaca0839ae23358dce26de426be1301657aMark Andrewscheckfor "files: reload.db$" rndc.out.removeinclude
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt
2855e2772342e369cc8962659beac7b3001b4ec6Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
2855e2772342e369cc8962659beac7b3001b4ec6Evan Huntstatus=`expr $status + $ret`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewsecho "I: checking 'rdnc zonestatus' with duplicated zone name"
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewsret=0
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus duplicate.example > rndc.out.duplicate 2>&1
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewscheckfor "zone 'duplicate.example' was found in multiple views" rndc.out.duplicate
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus duplicate.example in primary > rndc.out.duplicate 2>&1
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewscheckfor "name: duplicate.example" rndc.out.duplicate
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus nosuchzone.example > rndc.out.duplicate 2>&1
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewscheckfor "no matching zone 'nosuchzone.example' in any view" rndc.out.duplicate
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewsstatus=`expr $status + $ret`
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrews
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaramanecho "I: checking 'rdnc zonestatus' with big serial value"
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaramanret=0
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaraman$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus bigserial.example > rndc.out.bigserial 2>&1
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaramancheckfor "serial: 3003113544" rndc.out.bigserial
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaramanif [ $ret != 0 ]; then echo "I:failed"; fi
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaramanstatus=`expr $status + $ret`
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaraman
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I:exit status: $status"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews[ $status -eq 0 ] || exit 1