tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd# Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd# This Source Code Form is subject to the terms of the Mozilla Public
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd# License, v. 2.0. If a copy of the MPL was not distributed with this
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd echo "I:checking $db ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd $CHECKZONE -k fail -i local example $db > test.out.$n 2>&1 || ret=1
3f08db06526d6901aa08c110b5bc7dde6bc39905nd $CHECKZONE -k fail -i local 0.0.0.0.in-addr.arpa $db > test.out.$n 2>&1 || ret=1
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess $CHECKZONE -i local example $db > test.out.$n 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd echo "I:checking $db ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd $CHECKZONE -k fail -i local 0.0.0.0.in-addr.arpa $db > test.out.$n 2>&1 && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd $CHECKZONE -i local example $db > test.out.$n 2>&1 && ret=1
71fccc298df6a1540d408151a26aa22beed55d0bnd n=`expr $n + 1`
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndecho "I:checking with journal file ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -D -o test.orig.db test zones/test1.db > /dev/null 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -D -o test.changed.db test zones/test2.db > /dev/null 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd../../makejournal test test.orig.db test.changed.db test.orig.db.jnl 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -D -j -o test.out1.db test test.orig.db > /dev/null 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -D -J test.journal -o test.out2.db test test.orig.db > /dev/null 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndecho "I:checking with spf warnings ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE example zones/spf.db > test.out1.$n 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -T ignore example zones/spf.db > test.out2.$n 2>&1 || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndgrep "'x.example' found type SPF" test.out1.$n > /dev/null && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndgrep "'y.example' found type SPF" test.out1.$n > /dev/null || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndgrep "'example' found type SPF" test.out1.$n > /dev/null && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndgrep "'x.example' found type SPF" test.out2.$n > /dev/null && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndgrep "'y.example' found type SPF" test.out2.$n > /dev/null && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndgrep "'example' found type SPF" test.out2.$n > /dev/null && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndecho "I:checking with max ttl (text) ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -l 300 example zones/good1.db > test.out1.$n 2>&1 && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -l 600 example zones/good1.db > test.out2.$n 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndecho "I:checking with max ttl (raw) ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -f raw -l 300 example good1.db.raw > test.out1.$n 2>&1 && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -f raw -l 600 example good1.db.raw > test.out2.$n 2>&1 || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndecho "I:checking with max ttl (map) ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -f map -l 300 example good1.db.map > test.out1.$n 2>&1 && ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE -f map -l 600 example good1.db.map > test.out2.$n 2>&1 || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndecho "I:checking for no 'inherited owner' warning on '\$INCLUDE file' with no new \$ORIGIN ($n)"
71fccc298df6a1540d408151a26aa22beed55d0bnd$CHECKZONE example zones/nowarn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndecho "I:checking for 'inherited owner' warning on '\$ORIGIN + \$INCLUDE file' ($n)"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd$CHECKZONE example zones/warn.inherit.origin.db > test.out1.$n 2>&1 || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndecho "I:checking for 'inherited owner' warning on '\$INCLUDE file origin' ($n)"
71fccc298df6a1540d408151a26aa22beed55d0bnd$CHECKZONE example zones/warn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndecho "I:checking that raw zone with bad class is handled ($n)"
71fccc298df6a1540d408151a26aa22beed55d0bnd$CHECKZONE -f raw example zones/bad-badclass.raw > test.out.$n 2>&1 && ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndecho "I:checking that expirations that loop using serial arithmetic are handled ($n)"
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
71fccc298df6a1540d408151a26aa22beed55d0bndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndtest $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndecho "I:exit status: $status"