1 # Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
3 # Permission to use, copy, modify, and/or distribute this software for any
4 # purpose with or without fee is hereby granted, provided that the above
5 # copyright notice and this permission notice appear in all copies.
7 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13 # PERFORMANCE OF THIS SOFTWARE.
16 .
$SYSTEMTESTTOP/conf.sh
21 for db
in zones
/good
*.db
23 echo "I:checking $db ($n)"
25 $CHECKZONE -i local example
$db > test.out.
$n 2>&1 || ret
=1
27 if [ $ret != 0 ]; then echo "I:failed"; fi
28 status
=`expr $status + $ret`
31 for db
in zones
/bad
*.db
33 echo "I:checking $db ($n)"
35 $CHECKZONE -i local example
$db > test.out.
$n 2>&1 && ret
=1
37 if [ $ret != 0 ]; then echo "I:failed"; fi
38 status
=`expr $status + $ret`
41 echo "I:checking with journal file ($n)"
43 $CHECKZONE -D -o test.orig.db
test zones
/test1.db
> /dev
/null
2>&1 || ret
=1
44 $CHECKZONE -D -o test.changed.db
test zones
/test2.db
> /dev
/null
2>&1 || ret
=1
45 ..
/..
/makejournal
test test.orig.db
test.changed.db
test.orig.db.jnl
2>&1 || ret
=1
46 jlines
=`$JOURNALPRINT test.orig.db.jnl | wc -l`
47 [ $jlines = 3 ] || ret
=1
48 $CHECKZONE -D -j -o test.out1.db
test test.orig.db
> /dev
/null
2>&1 || ret
=1
49 cmp -s test.changed.db
test.out1.db || ret
=1
50 mv -f test.orig.db.jnl
test.journal
51 $CHECKZONE -D -J test.journal
-o test.out2.db
test test.orig.db
> /dev
/null
2>&1 || ret
=1
52 cmp -s test.changed.db
test.out2.db || ret
=1
54 if [ $ret != 0 ]; then echo "I:failed"; fi
55 status
=`expr $status + $ret`
57 echo "I:checking with spf warnings ($n)"
59 $CHECKZONE example zones
/spf.db
> test.out1.
$n 2>&1 || ret
=1
60 $CHECKZONE -T ignore example zones
/spf.db
> test.out2.
$n 2>&1 || ret
=1
61 grep "'x.example' found type SPF" test.out1.
$n > /dev
/null
&& ret
=1
62 grep "'y.example' found type SPF" test.out1.
$n > /dev
/null || ret
=1
63 grep "'example' found type SPF" test.out1.
$n > /dev
/null
&& ret
=1
64 grep "'x.example' found type SPF" test.out2.
$n > /dev
/null
&& ret
=1
65 grep "'y.example' found type SPF" test.out2.
$n > /dev
/null
&& ret
=1
66 grep "'example' found type SPF" test.out2.
$n > /dev
/null
&& ret
=1
68 if [ $ret != 0 ]; then echo "I:failed"; fi
69 status
=`expr $status + $ret`
71 echo "I:checking with max ttl (text) ($n)"
73 $CHECKZONE -l 300 example zones
/good1.db
> test.out1.
$n 2>&1 && ret
=1
74 $CHECKZONE -l 600 example zones
/good1.db
> test.out2.
$n 2>&1 || ret
=1
76 if [ $ret != 0 ]; then echo "I:failed"; fi
77 status
=`expr $status + $ret`
79 echo "I:checking with max ttl (raw) ($n)"
81 $CHECKZONE -f raw
-l 300 example good1.db.raw
> test.out1.
$n 2>&1 && ret
=1
82 $CHECKZONE -f raw
-l 600 example good1.db.raw
> test.out2.
$n 2>&1 || ret
=1
84 if [ $ret != 0 ]; then echo "I:failed"; fi
85 status
=`expr $status + $ret`
87 echo "I:checking with max ttl (map) ($n)"
89 $CHECKZONE -f map
-l 300 example good1.db.map
> test.out1.
$n 2>&1 && ret
=1
90 $CHECKZONE -f map
-l 600 example good1.db.map
> test.out2.
$n 2>&1 || ret
=1
92 if [ $ret != 0 ]; then echo "I:failed"; fi
93 status
=`expr $status + $ret`
95 echo "I:checking for no 'inherited owner' warning on '\$INCLUDE file' with no new \$ORIGIN ($n)"
97 $CHECKZONE example zones
/nowarn.inherited.owner.db
> test.out1.
$n 2>&1 || ret
=1
98 grep "inherited.owner" test.out1.
$n > /dev
/null
&& ret
=1
100 if [ $ret != 0 ]; then echo "I:failed"; fi
101 status
=`expr $status + $ret`
103 echo "I:checking for 'inherited owner' warning on '\$ORIGIN + \$INCLUDE file' ($n)"
105 $CHECKZONE example zones
/warn.inherit.origin.db
> test.out1.
$n 2>&1 || ret
=1
106 grep "inherited.owner" test.out1.
$n > /dev
/null || ret
=1
108 if [ $ret != 0 ]; then echo "I:failed"; fi
109 status
=`expr $status + $ret`
111 echo "I:checking for 'inherited owner' warning on '\$INCLUDE file origin' ($n)"
113 $CHECKZONE example zones
/warn.inherited.owner.db
> test.out1.
$n 2>&1 || ret
=1
114 grep "inherited.owner" test.out1.
$n > /dev
/null || ret
=1
116 if [ $ret != 0 ]; then echo "I:failed"; fi
117 status
=`expr $status + $ret`
119 echo "I:exit status: $status"