tests.sh revision 6444de08d1aacf7396663b7a82d62eedf534c3d7
1N/A# Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
1N/A#
1N/A# Permission to use, copy, modify, and/or distribute this software for any
1N/A# purpose with or without fee is hereby granted, provided that the above
1N/A# copyright notice and this permission notice appear in all copies.
1N/A#
1N/A# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1N/A# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1N/A# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1N/A# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1N/A# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1N/A# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1N/A# PERFORMANCE OF THIS SOFTWARE.
1N/A
1N/ASYSTEMTESTTOP=..
1N/A. $SYSTEMTESTTOP/conf.sh
1N/A
1N/Astatus=0
1N/An=1
1N/A
1N/Afor db in zones/good*.db
1N/Ado
1N/A echo "I:checking $db ($n)"
1N/A ret=0
1N/A $CHECKZONE -i local example $db > test.out.$n 2>&1 || ret=1
1N/A n=`expr $n + 1`
1N/A if [ $ret != 0 ]; then echo "I:failed"; fi
1N/A status=`expr $status + $ret`
1N/Adone
1N/A
1N/Afor db in zones/bad*.db
1N/Ado
1N/A echo "I:checking $db ($n)"
1N/A ret=0
1N/A $CHECKZONE -i local example $db > test.out.$n 2>&1 && ret=1
1N/A n=`expr $n + 1`
1N/A if [ $ret != 0 ]; then echo "I:failed"; fi
1N/A status=`expr $status + $ret`
1N/Adone
1N/A
1N/Aecho "I:checking with journal file ($n)"
1N/Aret=0
1N/A$CHECKZONE -D -o test.orig.db test zones/test1.db > /dev/null 2>&1 || ret=1
1N/A$CHECKZONE -D -o test.changed.db test zones/test2.db > /dev/null 2>&1 || ret=1
1N/A../../makejournal test test.orig.db test.changed.db test.orig.db.jnl 2>&1 || ret=1
1N/Ajlines=`$JOURNALPRINT test.orig.db.jnl | wc -l`
1N/A[ $jlines = 3 ] || ret=1
1N/A$CHECKZONE -D -j -o test.out1.db test test.orig.db > /dev/null 2>&1 || ret=1
1N/Acmp -s test.changed.db test.out1.db || ret=1
1N/Amv -f test.orig.db.jnl test.journal
1N/A$CHECKZONE -D -J test.journal -o test.out2.db test test.orig.db > /dev/null 2>&1 || ret=1
1N/Acmp -s test.changed.db test.out2.db || ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking with spf warnings ($n)"
1N/Aret=0
1N/A$CHECKZONE example zones/spf.db > test.out1.$n 2>&1 || ret=1
1N/A$CHECKZONE -T ignore example zones/spf.db > test.out2.$n 2>&1 || ret=1
1N/Agrep "'x.example' found type SPF" test.out1.$n > /dev/null && ret=1
1N/Agrep "'y.example' found type SPF" test.out1.$n > /dev/null || ret=1
1N/Agrep "'example' found type SPF" test.out1.$n > /dev/null && ret=1
1N/Agrep "'x.example' found type SPF" test.out2.$n > /dev/null && ret=1
1N/Agrep "'y.example' found type SPF" test.out2.$n > /dev/null && ret=1
1N/Agrep "'example' found type SPF" test.out2.$n > /dev/null && ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking with max ttl (text) ($n)"
1N/Aret=0
1N/A$CHECKZONE -l 300 example zones/good1.db > test.out1.$n 2>&1 && ret=1
1N/A$CHECKZONE -l 600 example zones/good1.db > test.out2.$n 2>&1 || ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking with max ttl (raw) ($n)"
1N/Aret=0
1N/A$CHECKZONE -f raw -l 300 example good1.db.raw > test.out1.$n 2>&1 && ret=1
1N/A$CHECKZONE -f raw -l 600 example good1.db.raw > test.out2.$n 2>&1 || ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking with max ttl (map) ($n)"
1N/Aret=0
1N/A$CHECKZONE -f map -l 300 example good1.db.map > test.out1.$n 2>&1 && ret=1
1N/A$CHECKZONE -f map -l 600 example good1.db.map > test.out2.$n 2>&1 || ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking for no 'inherited owner' warning on '\$INCLUDE file' with no new \$ORIGIN ($n)"
1N/Aret=0
1N/A$CHECKZONE example zones/nowarn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
1N/Agrep "inherited.owner" test.out1.$n > /dev/null && ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking for 'inherited owner' warning on '\$ORIGIN + \$INCLUDE file' ($n)"
1N/Aret=0
1N/A$CHECKZONE example zones/warn.inherit.origin.db > test.out1.$n 2>&1 || ret=1
1N/Agrep "inherited.owner" test.out1.$n > /dev/null || ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:checking for 'inherited owner' warning on '\$INCLUDE file origin' ($n)"
1N/Aret=0
1N/A$CHECKZONE example zones/warn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
1N/Agrep "inherited.owner" test.out1.$n > /dev/null || ret=1
1N/An=`expr $n + 1`
1N/Aif [ $ret != 0 ]; then echo "I:failed"; fi
1N/Astatus=`expr $status + $ret`
1N/A
1N/Aecho "I:exit status: $status"
1N/Aexit $status
1N/A