The rewrite of BIND 9 build system is a large work and cannot be reasonable split into separate merge requests. Addition of the automake has a positive effect on the readability and maintainability of the build system as it is more declarative, it allows conditional and we are able to drop all of the custom make code that BIND 9 developed over the years to overcome the deficiencies of autoconf + custom Makefile.in files. This squashed commit contains following changes: - conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am by using automake - the libtool is now properly integrated with automake (the way we used it was rather hackish as the only official way how to use libtool is via automake - the dynamic module loading was rewritten from a custom patchwork to libtool's libltdl (which includes the patchwork to support module loading on different systems internally) - conversion of the unit test executor from kyua to automake parallel driver - conversion of the system test executor from custom make/shell to automake parallel driver - The GSSAPI has been refactored, the custom SPNEGO on the basis that all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations support SPNEGO mechanism. - The various defunct tests from bin/tests have been removed: bin/tests/optional and bin/tests/pkcs11 - The text files generated from the MD files have been removed, the MarkDown has been designed to be readable by both humans and computers - The xsl header is now generated by a simple sed command instead of perl helper - The <irs/platform.h> header has been removed - cleanups of configure.ac script to make it more simpler, addition of multiple macros (there's still work to be done though) - the tarball can now be prepared with `make dist` - the system tests are partially able to run in oot build Here's a list of unfinished work that needs to be completed in subsequent merge requests: - `make distcheck` doesn't yet work (because of system tests oot run is not yet finished) - documentation is not yet built, there's a different merge request with docbook to sphinx-build rst conversion that needs to be rebased and adapted on top of the automake - msvc build is non functional yet and we need to decide whether we will just cross-compile bind9 using mingw-w64 or fix the msvc build - contributed dlz modules are not included neither in the autoconf nor automake
208 lines
8.2 KiB
Bash
208 lines
8.2 KiB
Bash
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
# information regarding copyright ownership.
|
|
|
|
. $SYSTEMTESTTOP/conf.sh
|
|
|
|
status=0
|
|
n=1
|
|
|
|
for db in zones/good*.db
|
|
do
|
|
echo_i "checking $db ($n)"
|
|
ret=0
|
|
case $db in
|
|
zones/good-gc-msdcs.db)
|
|
$CHECKZONE -k fail -i local example $db > test.out.$n 2>&1 || ret=1
|
|
;;
|
|
zones/good-dns-sd-reverse.db)
|
|
$CHECKZONE -k fail -i local 0.0.0.0.in-addr.arpa $db > test.out.$n 2>&1 || ret=1
|
|
;;
|
|
*)
|
|
$CHECKZONE -i local example $db > test.out.$n 2>&1 || ret=1
|
|
;;
|
|
esac
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
done
|
|
|
|
for db in zones/bad*.db
|
|
do
|
|
echo_i "checking $db ($n)"
|
|
ret=0 v=0
|
|
case $db in
|
|
zones/bad-dns-sd-reverse.db)
|
|
$CHECKZONE -k fail -i local 0.0.0.0.in-addr.arpa $db > test.out.$n 2>&1 || v=$?
|
|
;;
|
|
*)
|
|
$CHECKZONE -i local example $db > test.out.$n 2>&1 || v=$?
|
|
;;
|
|
esac
|
|
test $v = 1 || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
done
|
|
|
|
echo_i "checking with journal file ($n)"
|
|
ret=0
|
|
$CHECKZONE -D -o test.orig.db test zones/test1.db > /dev/null 2>&1 || ret=1
|
|
$CHECKZONE -D -o test.changed.db test zones/test2.db > /dev/null 2>&1 || ret=1
|
|
$MAKEJOURNAL test test.orig.db test.changed.db test.orig.db.jnl 2>&1 || ret=1
|
|
jlines=`$JOURNALPRINT test.orig.db.jnl | wc -l`
|
|
[ $jlines = 3 ] || ret=1
|
|
$CHECKZONE -D -j -o test.out1.db test test.orig.db > /dev/null 2>&1 || ret=1
|
|
cmp -s test.changed.db test.out1.db || ret=1
|
|
mv -f test.orig.db.jnl test.journal
|
|
$CHECKZONE -D -J test.journal -o test.out2.db test test.orig.db > /dev/null 2>&1 || ret=1
|
|
cmp -s test.changed.db test.out2.db || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking with spf warnings ($n)"
|
|
ret=0
|
|
$CHECKZONE example zones/spf.db > test.out1.$n 2>&1 || ret=1
|
|
$CHECKZONE -T ignore example zones/spf.db > test.out2.$n 2>&1 || ret=1
|
|
grep "'x.example' found type SPF" test.out1.$n > /dev/null && ret=1
|
|
grep "'y.example' found type SPF" test.out1.$n > /dev/null || ret=1
|
|
grep "'example' found type SPF" test.out1.$n > /dev/null && ret=1
|
|
grep "'x.example' found type SPF" test.out2.$n > /dev/null && ret=1
|
|
grep "'y.example' found type SPF" test.out2.$n > /dev/null && ret=1
|
|
grep "'example' found type SPF" test.out2.$n > /dev/null && ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking with max ttl (text) ($n)"
|
|
ret=0
|
|
$CHECKZONE -l 300 example zones/good1.db > test.out1.$n 2>&1 && ret=1
|
|
$CHECKZONE -l 600 example zones/good1.db > test.out2.$n 2>&1 || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking with max ttl (raw) ($n)"
|
|
ret=0
|
|
$CHECKZONE -f raw -l 300 example good1.db.raw > test.out1.$n 2>&1 && ret=1
|
|
$CHECKZONE -f raw -l 600 example good1.db.raw > test.out2.$n 2>&1 || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking with max ttl (map) ($n)"
|
|
ret=0
|
|
$CHECKZONE -f map -l 300 example good1.db.map > test.out1.$n 2>&1 && ret=1
|
|
$CHECKZONE -f map -l 600 example good1.db.map > test.out2.$n 2>&1 || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking for no 'inherited owner' warning on '\$INCLUDE file' with no new \$ORIGIN ($n)"
|
|
ret=0
|
|
$CHECKZONE example zones/nowarn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
|
|
grep "inherited.owner" test.out1.$n > /dev/null && ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking for 'inherited owner' warning on '\$ORIGIN + \$INCLUDE file' ($n)"
|
|
ret=0
|
|
$CHECKZONE example zones/warn.inherit.origin.db > test.out1.$n 2>&1 || ret=1
|
|
grep "inherited.owner" test.out1.$n > /dev/null || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking for 'inherited owner' warning on '\$INCLUDE file origin' ($n)"
|
|
ret=0
|
|
$CHECKZONE example zones/warn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
|
|
grep "inherited.owner" test.out1.$n > /dev/null || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking that raw zone with bad class is handled ($n)"
|
|
ret=0
|
|
$CHECKZONE -f raw example zones/bad-badclass.raw > test.out.$n 2>&1 && ret=1
|
|
grep "failed: bad class" test.out.$n >/dev/null || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking that expirations that loop using serial arithmetic are handled ($n)"
|
|
ret=0
|
|
q=-q
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
test $ret -eq 1 || $CHECKZONE $q dyn.example.net zones/crashzone.db || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking that nameserver below DNAME is reported even with occulted address record present ($n)"
|
|
ret=0
|
|
$CHECKZONE example.com zones/ns-address-below-dname.db > test.out.$n 2>&1 && ret=1
|
|
grep "is below a DNAME" test.out.$n >/dev/null || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
echo_i "checking that delegating nameserver below DNAME is reported even with occulted address record present ($n)"
|
|
ret=0
|
|
$CHECKZONE example.com zones/delegating-ns-address-below-dname.db > test.out.$n 2>&1 || ret=1
|
|
grep "is below a DNAME" test.out.$n >/dev/null || ret=1
|
|
n=`expr $n + 1`
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
status=`expr $status + $ret`
|
|
|
|
n=`expr $n + 1`
|
|
echo_i "checking that named-compilezone works when reading input from stdin ($n)"
|
|
ret=0
|
|
# Step 1: take raw input from stdin and convert it to text/relative format.
|
|
# Last argument "-" is optional, but it says more explicitly that we're reading from stdin.
|
|
cat zones/zone1.db | ./named-compilezone -f text -F text -s relative \
|
|
-o zones/zone1_stdin.txt zone1.com - > /dev/null || ret=1
|
|
status=`expr $status + $ret`
|
|
|
|
ret=0
|
|
# Step 2: take raw input from file and convert it to text format.
|
|
./named-compilezone -f text -F text -s relative -o zones/zone1_file.txt \
|
|
zone1.com zones/zone1.db > /dev/null || ret=1
|
|
status=`expr $status + $ret`
|
|
|
|
ret=0
|
|
# Step 3: Ensure that output conversion from stdin is the same as the output conversion from a file.
|
|
$DIFF zones/zone1_file.txt zones/zone1_stdin.txt >/dev/null 2>&1 || ret=1
|
|
status=`expr $status + $ret`
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
|
|
|
echo_i "exit status: $status"
|
|
[ $status -eq 0 ] || exit 1
|