dce54b9b5cfa450570fe9c11644450aeb3ee89f3Tinderbox User# Copyright (C) 2004, 2007, 2009, 2012-2016 Internet Systems Consortium, Inc. ("ISC")
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 Andrewsecho "I: checking that we detect a NS which refers to a CNAME"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which is below a DNAME"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "is below a DNAME" dname.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which has no address records (A/AAAA)"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "has no address records" noaddress.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which has no records"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "has no address records" noaddress.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a A record (fail)"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" a.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a A record (warn=default)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" a.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a A record (ignore)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" a.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a AAAA record (fail)"
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" aaaa.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I: checking that we detect a NS which looks like a AAAA record (warn=default)"
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews if grep "appears to be an address" aaaa.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
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 Andrews if grep "appears to be an address" aaaa.out > /dev/null
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (message)"; status=`expr $status + 1`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Hunt echo "I:failed (status)"; status=`expr $status + 1`
2855e2772342e369cc8962659beac7b3001b4ec6Evan Huntecho "I: checking 'rdnc zonestatus' output"
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
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "files: master.db, master.db.signed" rndc.out.master
912920eace3cbbe6dcba794603d5f44f88972e8bMark Andrewscheckfor "key maintenance: automatic" rndc.out.master
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
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 Andrewscheckfor "files: reload.db, soa.db$" rndc.out.prereload
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload reload.example
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews $DIG reload.example SOA @10.53.0.1 -p 5300 > dig.out
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 Andrews$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload reload.example
7d65cbaca0839ae23358dce26de426be1301657aMark Andrews $DIG reload.example SOA @10.53.0.1 -p 5300 > dig.out
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
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrewsecho "I: checking 'rdnc zonestatus' with duplicated zone name"
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
b4e114e3cd99b8875fc677a1a1c7c8257ef5a7a6Mukund Sivaramanecho "I: checking 'rdnc zonestatus' with big serial value"
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
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrewsecho "I:exit status: $status"