summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in8
-rw-r--r--README13
-rw-r--r--RELNOTES5
-rw-r--r--client/Makefile.in1
-rw-r--r--client/tests/Makefile.in1
-rw-r--r--common/Makefile.in1
-rw-r--r--common/tests/Makefile.in1
-rwxr-xr-xconfigure64
-rw-r--r--configure.ac39
-rw-r--r--dhcpctl/Makefile.in1
-rw-r--r--doc/devel/atf.dox101
-rw-r--r--dst/Makefile.in1
-rw-r--r--includes/Makefile.in1
-rw-r--r--omapip/Makefile.in1
-rw-r--r--relay/Makefile.in1
-rw-r--r--server/Makefile.in1
-rw-r--r--server/tests/Makefile.in1
-rw-r--r--tests/Makefile.in1
-rw-r--r--util/Makefile.bind.in (renamed from util/Makefile.bind)48
-rw-r--r--util/bind.sh2
-rw-r--r--util/bindcus.sh39
-rw-r--r--util/bindlib.sh58
23 files changed, 212 insertions, 179 deletions
diff --git a/Makefile.am b/Makefile.am
index ab1d0d65..57fd09d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,7 +22,7 @@ EXTRA_DIST = RELNOTES LICENSE \
doc/devel/arch.dox doc/devel/atf.dox doc/devel/contrib.dox \
doc/devel/debug.dox doc/devel/isc-logo.jpg doc/devel/mainpage.dox \
doc/devel/omapi.dox doc/devel/qa.dox util/bindvar.sh \
- bind/Makefile bind/bind.tar.gz bind/version.tmp \
+ bind/Makefile.in bind/bind.tar.gz bind/version.tmp \
common/tests/Atffile server/tests/Atffile
SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
diff --git a/Makefile.in b/Makefile.in
index b273fc17..13263553 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,6 +81,7 @@ host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
+ $(top_srcdir)/bind/Makefile.in \
$(top_srcdir)/doc/devel/doxyfile.in $(nobase_include_HEADERS) \
README compile config.guess config.sub depcomp install-sh \
missing
@@ -92,7 +93,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/includes/config.h
-CONFIG_CLEAN_FILES = doc/devel/doxyfile
+CONFIG_CLEAN_FILES = bind/Makefile doc/devel/doxyfile
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -231,6 +232,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -344,7 +346,7 @@ EXTRA_DIST = RELNOTES LICENSE \
doc/devel/arch.dox doc/devel/atf.dox doc/devel/contrib.dox \
doc/devel/debug.dox doc/devel/isc-logo.jpg doc/devel/mainpage.dox \
doc/devel/omapi.dox doc/devel/qa.dox util/bindvar.sh \
- bind/Makefile bind/bind.tar.gz bind/version.tmp \
+ bind/Makefile.in bind/bind.tar.gz bind/version.tmp \
common/tests/Atffile server/tests/Atffile
SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
@@ -377,6 +379,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
+bind/Makefile: $(top_builddir)/config.status $(top_srcdir)/bind/Makefile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
doc/devel/doxyfile: $(top_builddir)/config.status $(top_srcdir)/doc/devel/doxyfile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-nobase_includeHEADERS: $(nobase_include_HEADERS)
diff --git a/README b/README
index 1ff685cf..2e0aff01 100644
--- a/README
+++ b/README
@@ -38,6 +38,7 @@ the ISC DHCP Distribution.
5.8.3 Other Solaris Items
5.9 AIX
5.10 MacOS X
+ 5.11 ATF
6 SUPPORT
6.1 HOW TO REPORT BUGS
7 HISTORY
@@ -585,6 +586,18 @@ recomputed from scratch when the current location/set is changed.
Running the dhclient-script reinstalls the resolv.conf.dhclient6
configuration.
+
+ ATF
+
+Please see the file DHCP/doc/devel/atf.dox for a description of building
+and using these tools.
+
+The optional unit tests use ATF (Automated Testing Framework) including
+the atf-run and atf-report tools. ATF deprecated these tools in
+version 0.19 and removed these tools from its sources in version 0.20,
+requiring you to get an older version, use Kyua with an ATF compatibility
+package or use the version included in the Bind sources.
+
SUPPORT
The Internet Systems Consortium DHCP server is developed and distributed
diff --git a/RELNOTES b/RELNOTES
index b0c3dc92..cbffebe7 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -54,6 +54,11 @@ by Eric Young (eay@cryptsoft.com).
Changes since 4.3.2
+- The ATF (Automated Testing Framework) tools used for optional unit tests
+ can now be built from its embedded sources in bind, solving the
+ atf-run / atf-report issue with recent (>= 0.20) versions of ATF.
+ The new configuration option is "./configure --with-atf=bind".
+
- The server now does a better check to see if it can allocate the memory
for large blocks of v4 leases and should provide a slightly better error
message. Note well: the server pre-allocates v4 addresses, if you use
diff --git a/client/Makefile.in b/client/Makefile.in
index 7b7d6067..72fce7c8 100644
--- a/client/Makefile.in
+++ b/client/Makefile.in
@@ -239,6 +239,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/client/tests/Makefile.in b/client/tests/Makefile.in
index d724a1e3..303eb130 100644
--- a/client/tests/Makefile.in
+++ b/client/tests/Makefile.in
@@ -212,6 +212,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/common/Makefile.in b/common/Makefile.in
index 51e78184..ade60f17 100644
--- a/common/Makefile.in
+++ b/common/Makefile.in
@@ -246,6 +246,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/common/tests/Makefile.in b/common/tests/Makefile.in
index a7ebb057..8fdddf63 100644
--- a/common/tests/Makefile.in
+++ b/common/tests/Makefile.in
@@ -250,6 +250,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/configure b/configure
index 2f2a2c50..e652a083 100755
--- a/configure
+++ b/configure
@@ -632,11 +632,14 @@ HAVE_ATF_TRUE
ATF_BIN
ATF_LDFLAGS
ATF_CFLAGS
+BIND_ATF_FALSE
+BIND_ATF_TRUE
byte_order
RANLIB
EGREP
GREP
CPP
+BINDCONFIG
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
@@ -1421,7 +1424,7 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-atf=PATH specify location where atf was installed
+ --with-atf=PATH specify location where atf was installed (or "bind")
--with-srv-lease-file=PATH
File for dhcpd leases (default is
LOCALSTATEDIR/db/dhcpd.leases)
@@ -4444,6 +4447,10 @@ if test "$GCC" = "yes"; then
fi
fi
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+
+
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
# parts of the IPv6 Advanced Socket API as a result. This is stupid
# as it breaks how the two halves (Basic and Advanced) of the IPv6
@@ -5428,7 +5435,25 @@ if test "${with_atf+set}" = set; then :
withval=$with_atf; atf_path="$withval"
fi
-if test "$atf_path" != "no" ; then
+ if test "$atf_path" = "bind"; then
+ BIND_ATF_TRUE=
+ BIND_ATF_FALSE='#'
+else
+ BIND_ATF_TRUE='#'
+ BIND_ATF_FALSE=
+fi
+
+if test "$atf_path" = "bind" ; then
+ atf_pcp="bind"
+ atf_path="\${top_srcdir}/bind/atf"
+ ATF_CFLAGS="-I$atf_path/include -DUNIT_TEST"
+ ATF_LDFLAGS="-L$atf_path/lib -latf-c"
+ ATF_BIN=`pwd`/bind/atf/bin
+
+
+
+ BINDCONFIG="$BINDCONFIG --with-atf"
+elif test "$atf_path" != "no" ; then
# Config path for pkg-config
atf_pcp=""
if test "$atf_path" != "yes" ; then
@@ -5611,7 +5636,8 @@ _ACEOF
fi
-echo -n "checking for dhcpd.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhcpd.leases location" >&5
+$as_echo_n "checking for dhcpd.leases location... " >&6; }
if [ "x$with_srv_lease_file" = "x" ] ; then
if [ -d "${localstatedir}/db" ] ; then
with_srv_lease_file="${localstatedir}/db/dhcpd.leases"
@@ -5633,7 +5659,8 @@ if [ "x$with_srv_lease_file" = "x" ] ; then
with_srv_lease_file="/etc/dhcpd.leases"
fi
fi
-echo "$with_srv_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_srv_lease_file" >&5
+$as_echo "$with_srv_lease_file" >&6; }
# Check whether --with-srv6-lease-file was given.
@@ -5646,7 +5673,8 @@ _ACEOF
fi
-echo -n "checking for dhcpd6.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhcpd6.leases location" >&5
+$as_echo_n "checking for dhcpd6.leases location... " >&6; }
if [ "x$with_srv6_lease_file" = "x" ] ; then
if [ -d "${localstatedir}/db" ] ; then
with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases"
@@ -5668,7 +5696,8 @@ if [ "x$with_srv6_lease_file" = "x" ] ; then
with_srv6_lease_file="/etc/dhcpd6.leases"
fi
fi
-echo "$with_srv6_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_srv6_lease_file" >&5
+$as_echo "$with_srv6_lease_file" >&6; }
# Check whether --with-cli-lease-file was given.
@@ -5681,7 +5710,8 @@ _ACEOF
fi
-echo -n "checking for dhclient.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhclient.leases location" >&5
+$as_echo_n "checking for dhclient.leases location... " >&6; }
if [ "x$with_cli_lease_file" = "x" ] ; then
if [ -d "${localstatedir}/db" ] ; then
with_cli_lease_file="${localstatedir}/db/dhclient.leases"
@@ -5703,7 +5733,8 @@ if [ "x$with_cli_lease_file" = "x" ] ; then
with_cli_lease_file="/etc/dhclient.leases"
fi
fi
-echo "$with_cli_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cli_lease_file" >&5
+$as_echo "$with_cli_lease_file" >&6; }
# Check whether --with-cli6-lease-file was given.
@@ -5716,7 +5747,8 @@ _ACEOF
fi
-echo -n "checking for dhclient6.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhclient6.leases location" >&5
+$as_echo_n "checking for dhclient6.leases location... " >&6; }
if [ "x$with_cli6_lease_file" = "x" ] ; then
if [ -d "${localstatedir}/db" ] ; then
with_cli6_lease_file="${localstatedir}/db/dhclient6.leases"
@@ -5738,7 +5770,8 @@ if [ "x$with_cli6_lease_file" = "x" ] ; then
with_cli6_lease_file="/etc/dhclient6.leases"
fi
fi
-echo "$with_cli6_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cli6_lease_file" >&5
+$as_echo "$with_cli6_lease_file" >&6; }
# Check whether --with-srv-pid-file was given.
@@ -6598,6 +6631,10 @@ no)
;;
*)
libbind="$use_libbind"
+ if test ! -d "bind"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: empty bind directory" >&5
+$as_echo "$as_me: WARNING: empty bind directory" >&2;}
+ fi
;;
esac
@@ -6812,7 +6849,7 @@ $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
fi
-ac_config_files="$ac_config_files Makefile client/Makefile client/tests/Makefile common/Makefile common/tests/Makefile dhcpctl/Makefile dst/Makefile includes/Makefile omapip/Makefile relay/Makefile server/Makefile tests/Makefile tests/unittest.sh server/tests/Makefile doc/devel/doxyfile"
+ac_config_files="$ac_config_files Makefile bind/Makefile client/Makefile client/tests/Makefile common/Makefile common/tests/Makefile dhcpctl/Makefile dst/Makefile includes/Makefile omapip/Makefile relay/Makefile server/Makefile tests/Makefile tests/unittest.sh server/tests/Makefile doc/devel/doxyfile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -6952,6 +6989,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BIND_ATF_TRUE}" && test -z "${BIND_ATF_FALSE}"; then
+ as_fn_error $? "conditional \"BIND_ATF\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_ATF_TRUE}" && test -z "${HAVE_ATF_FALSE}"; then
as_fn_error $? "conditional \"HAVE_ATF\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -7551,6 +7592,7 @@ do
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"includes/config.h") CONFIG_HEADERS="$CONFIG_HEADERS includes/config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "bind/Makefile") CONFIG_FILES="$CONFIG_FILES bind/Makefile" ;;
"client/Makefile") CONFIG_FILES="$CONFIG_FILES client/Makefile" ;;
"client/tests/Makefile") CONFIG_FILES="$CONFIG_FILES client/tests/Makefile" ;;
"common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index ead0bc77..8a183bcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,10 @@ if test "$GCC" = "yes"; then
fi
fi
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+AC_SUBST(BINDCONFIG)
+
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
# parts of the IPv6 Advanced Socket API as a result. This is stupid
# as it breaks how the two halves (Basic and Advanced) of the IPv6
@@ -187,9 +191,20 @@ fi
atf_path="no"
AC_ARG_WITH([atf],
- AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed]),
+ AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed (or "bind")]),
[atf_path="$withval"])
-if test "$atf_path" != "no" ; then
+AM_CONDITIONAL(BIND_ATF, test "$atf_path" = "bind")
+if test "$atf_path" = "bind" ; then
+ atf_pcp="bind"
+ atf_path="\${top_srcdir}/bind/atf"
+ ATF_CFLAGS="-I$atf_path/include -DUNIT_TEST"
+ ATF_LDFLAGS="-L$atf_path/lib -latf-c"
+ ATF_BIN=`pwd`/bind/atf/bin
+ AC_SUBST(ATF_CFLAGS)
+ AC_SUBST(ATF_LDFLAGS)
+ AC_SUBST(ATF_BIN)
+ BINDCONFIG="$BINDCONFIG --with-atf"
+elif test "$atf_path" != "no" ; then
# Config path for pkg-config
atf_pcp=""
if test "$atf_path" != "yes" ; then
@@ -264,7 +279,7 @@ AC_ARG_WITH(srv-lease-file,
AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
[File for dhcpd leases.]))
-echo -n "checking for dhcpd.leases location..."
+AC_MSG_CHECKING([for dhcpd.leases location])
if [[ "x$with_srv_lease_file" = "x" ]] ; then
if [[ -d "${localstatedir}/db" ]] ; then
with_srv_lease_file="${localstatedir}/db/dhcpd.leases"
@@ -286,7 +301,7 @@ if [[ "x$with_srv_lease_file" = "x" ]] ; then
with_srv_lease_file="/etc/dhcpd.leases"
fi
fi
-echo "$with_srv_lease_file"
+AC_MSG_RESULT($with_srv_lease_file)
AC_ARG_WITH(srv6-lease-file,
AS_HELP_STRING([--with-srv6-lease-file=PATH],[File for dhcpd6 leases
@@ -294,7 +309,7 @@ AC_ARG_WITH(srv6-lease-file,
AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
[File for dhcpd6 leases.]))
-echo -n "checking for dhcpd6.leases location..."
+AC_MSG_CHECKING([for dhcpd6.leases location])
if [[ "x$with_srv6_lease_file" = "x" ]] ; then
if [[ -d "${localstatedir}/db" ]] ; then
with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases"
@@ -316,7 +331,7 @@ if [[ "x$with_srv6_lease_file" = "x" ]] ; then
with_srv6_lease_file="/etc/dhcpd6.leases"
fi
fi
-echo "$with_srv6_lease_file"
+AC_MSG_RESULT($with_srv6_lease_file)
AC_ARG_WITH(cli-lease-file,
AS_HELP_STRING([--with-cli-lease-file=PATH],[File for dhclient leases
@@ -324,7 +339,7 @@ AC_ARG_WITH(cli-lease-file,
AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
[File for dhclient leases.]))
-echo -n "checking for dhclient.leases location..."
+AC_MSG_CHECKING([for dhclient.leases location])
if [[ "x$with_cli_lease_file" = "x" ]] ; then
if [[ -d "${localstatedir}/db" ]] ; then
with_cli_lease_file="${localstatedir}/db/dhclient.leases"
@@ -346,7 +361,7 @@ if [[ "x$with_cli_lease_file" = "x" ]] ; then
with_cli_lease_file="/etc/dhclient.leases"
fi
fi
-echo "$with_cli_lease_file"
+AC_MSG_RESULT($with_cli_lease_file)
AC_ARG_WITH(cli6-lease-file,
AS_HELP_STRING([--with-cli6-lease-file=PATH],[File for dhclient6 leases
@@ -354,7 +369,7 @@ AC_ARG_WITH(cli6-lease-file,
AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
[File for dhclient6 leases.]))
-echo -n "checking for dhclient6.leases location..."
+AC_MSG_CHECKING([for dhclient6.leases location])
if [[ "x$with_cli6_lease_file" = "x" ]] ; then
if [[ -d "${localstatedir}/db" ]] ; then
with_cli6_lease_file="${localstatedir}/db/dhclient6.leases"
@@ -376,7 +391,7 @@ if [[ "x$with_cli6_lease_file" = "x" ]] ; then
with_cli6_lease_file="/etc/dhclient6.leases"
fi
fi
-echo "$with_cli6_lease_file"
+AC_MSG_RESULT($with_cli6_lease_file)
AC_ARG_WITH(srv-pid-file,
AS_HELP_STRING([--with-srv-pid-file=PATH],[File for dhcpd process information
@@ -594,6 +609,9 @@ no)
;;
*)
libbind="$use_libbind"
+ if test ! -d "bind"; then
+ AC_MSG_WARN(empty bind directory)
+ fi
;;
esac
@@ -641,6 +659,7 @@ AC_C_FLEXIBLE_ARRAY_MEMBER
AC_CONFIG_FILES([
Makefile
+ bind/Makefile
client/Makefile
client/tests/Makefile
common/Makefile
diff --git a/dhcpctl/Makefile.in b/dhcpctl/Makefile.in
index 105ceb69..0141b748 100644
--- a/dhcpctl/Makefile.in
+++ b/dhcpctl/Makefile.in
@@ -214,6 +214,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/doc/devel/atf.dox b/doc/devel/atf.dox
index dd596841..0bf82d13 100644
--- a/doc/devel/atf.dox
+++ b/doc/devel/atf.dox
@@ -31,9 +31,19 @@ Test Framework)</a> as a framework to run our unittests.
ATF stands for Automated Test Framework, and is the framework used for unit
tests in ISC DHCP and BIND9. ATF sources can be downloaded from
https://github.com/jmmv/kyua . ATF itself must be configured, compiled
-and then installed to be available during the DHCP configure procedure. Please
+and then installed to be available during the DHCP configure procedure.
+
+There are three options for installing ATF. 1) Get the ATF sources and
follow INSTALL file supplied with ATF sources (it's essentially the typical
-./configure && make && make install procedure).
+./configure && make && make install procedure). 2) install Kyua with the ATF
+compatibility package, or 3) use the ATF version included in bind sources.
+
+To configure and build the ATF from BIND you should set the "--with-atf" option
+to "bind".
+@verbatim
+./configure --with-atf=bind
+@endverbatim
+
Beginning with ATF version 0.16, it is necessary to include the following
options --enable-tools and --disable-shared when configuring ATF:
@@ -46,10 +56,11 @@ ISC DHCP unittests will run with ATF releases upto 0.19. Beginning with
ATF 0.20, the tools, atf-run and atf-report required by ISC DHCP, were
deprecated and are no longer included with ATF.
-The ATF successor, called Kyua, is being developed. As of August 2012, the
-latest available release of Kyua is 0.5. It claims to offer feature parity with
-ATF. Migration to Kyua may be planned some time in the future, but DHCP uses ATF
-for now. Such an upgrade should be done in coordination with BIND.
+The ATF successor, called Kyua, is being developed. As of August 2012,
+the latest available release of Kyua is 0.5. It claims to offer
+feature parity with ATF. Migration to Kyua may be planned some time in
+the future, but DHCP uses ATF for now. Such an upgrade should be done
+in coordination with BIND.
To build and run the unit-tests, use the following:
@@ -86,21 +97,23 @@ or
$ sh ../../tests/unittests.sh
@endverbatim
-atf-run will read the Atffile in the current directory and execute all the tests
-specified in it. Using atf-run - rather than calling the test binary directly -
-has several major benefits. The main one is that atf-run is able to recover from
-test segfault and continue execution from the next case onwards. Another is that
-it is possible to specify a timeout for a test. atf-run will kill the test in
-case of any infinite loops and will continue running next tests.
+atf-run will read the Atffile in the current directory and execute all
+the tests specified in it. Using atf-run - rather than calling the
+test binary directly - has several major benefits. The main one is
+that atf-run is able to recover from test segfault and continue
+execution from the next case onwards. Another is that it is possible
+to specify a timeout for a test. atf-run will kill the test in case of
+any infinite loops and will continue running next tests.
It is possible to run atf-run without passing its output to atf-report, but its
output is somewhat convoluted. That is useful in some situations, e.g. when one
wants to see test output.
-It is possible to run test binary directly. The only required parameter is the
-test case name. The binary will print out a warning that direct binary execution
-is not recommended as it won't be able to recover from crash. However, such an
-approach is convenient for running the test under the debugger.
+It is possible to run test binary directly. The only required
+parameter is the test case name. The binary will print out a warning
+that direct binary execution is not recommended as it won't be able to
+recover from crash. However, such an approach is convenient for
+running the test under the debugger.
@section testsAtfAdding Adding new unit-tests
@@ -162,27 +175,30 @@ See existing Makefile.am for examples, and the Automake documentation:
http://www.gnu.org/software/automake/manual/html_node/Tests.html
-<b>2. Implement the test.</b> That typically means that you create a new file that will
-hold test code. It is recommended you name it (tested_feature_name)_unittest.c
-and put the file in specified tests directory. For example tests related to
-hash tables used on the server side should be named
-server/tests/hash_unittest.c. If in doubt, it is convenient to name the test
-code after the file that holds tested code, e.g. server/mdb6.c is tested in
+<b>2. Implement the test.</b> That typically means that you create a
+new file that will hold test code. It is recommended you name it
+(tested_feature_name)_unittest.c and put the file in specified tests
+directory. For example tests related to hash tables used on the
+server side should be named server/tests/hash_unittest.c. If in doubt,
+it is convenient to name the test code after the file that holds
+tested code, e.g. server/mdb6.c is tested in
server/tests/mdb6_unittest.c.
-The file server/tests/simple_unittest.c holds a template explaining the basic
-layout of the ATF tests. There may be many test cases in a single *_unittest.c
-file. Make sure that you register all your test cases using ATF_TP_ADD_TC()
-macro, and try to minimize modifications to the tested code if possible. Keep in
-mind that we are using modernized \ref codingGuidelines for test
-development. You are advised to also look at atf-c-api(3) man page.
-
-To add a new test, such as when a new module is added or when you want to start
-testing existing code, you can copy the server/tests/simple_unittest.c as a new
-new file, add the new file as a target in Makefile.am, and begin adding
-tests. Reviewing that file is a good idea, even if you decide to write your test
-from scratch, as it give you quick overview of the essential capabilities of the
-ATF framework (how to write test, how to make checks, pass or fail test
+The file server/tests/simple_unittest.c holds a template explaining
+the basic layout of the ATF tests. There may be many test cases in a
+single *_unittest.c file. Make sure that you register all your test
+cases using ATF_TP_ADD_TC() macro, and try to minimize modifications
+to the tested code if possible. Keep in mind that we are using
+modernized \ref codingGuidelines for test development. You are advised
+to also look at atf-c-api(3) man page.
+
+To add a new test, such as when a new module is added or when you want
+to start testing existing code, you can copy the
+server/tests/simple_unittest.c as a new new file, add the new file as
+a target in Makefile.am, and begin adding tests. Reviewing that file
+is a good idea, even if you decide to write your test from scratch, as
+it give you quick overview of the essential capabilities of the ATF
+framework (how to write test, how to make checks, pass or fail test
etc.). Do not forget to add your new file to git via "git add
yourtest_unittest.c".
@@ -190,14 +206,15 @@ yourtest_unittest.c".
name to ATF_TESTS. The tests directory will be built only in case where
ATF is enabled, using --with-atf during configure phase.
-<b>4. Modify Atffile to include your new test</b>, if needed. Tests in the
-specified directory must be registered in Atffile. See server/tests/Atffile for
-an example. Currently every executable with name of the form *_unittest will be
-executed automatically. If you followed naming convention proposed in a previous
-step, your test will be included and will be included automatically.
+<b>4. Modify Atffile to include your new test</b>, if needed. Tests in
+the specified directory must be registered in Atffile. See
+server/tests/Atffile for an example. Currently every executable with
+name of the form *_unittest will be executed automatically. If you
+followed naming convention proposed in a previous step, your test will
+be included and will be included automatically.
-<b>5. Enjoy your improved confidence in the code</b>, as you can run the tests after
-any change you may want to do:
+<b>5. Enjoy your improved confidence in the code</b>, as you can run
+the tests after any change you may want to do:
@verbatim
$ make check
diff --git a/dst/Makefile.in b/dst/Makefile.in
index ff12ff95..846877de 100644
--- a/dst/Makefile.in
+++ b/dst/Makefile.in
@@ -195,6 +195,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/includes/Makefile.in b/includes/Makefile.in
index b453cddb..45c31889 100644
--- a/includes/Makefile.in
+++ b/includes/Makefile.in
@@ -168,6 +168,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/omapip/Makefile.in b/omapip/Makefile.in
index 35e2f7f3..6086e9f0 100644
--- a/omapip/Makefile.in
+++ b/omapip/Makefile.in
@@ -211,6 +211,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/relay/Makefile.in b/relay/Makefile.in
index 2fc955d7..5d9f9859 100644
--- a/relay/Makefile.in
+++ b/relay/Makefile.in
@@ -192,6 +192,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/server/Makefile.in b/server/Makefile.in
index 80652313..939e47ee 100644
--- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -253,6 +253,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/server/tests/Makefile.in b/server/tests/Makefile.in
index 33669fe5..a103666e 100644
--- a/server/tests/Makefile.in
+++ b/server/tests/Makefile.in
@@ -259,6 +259,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 629339d7..64297ae4 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -163,6 +163,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/util/Makefile.bind b/util/Makefile.bind.in
index bd68319e..f972c71a 100644
--- a/util/Makefile.bind
+++ b/util/Makefile.bind.in
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2009-2012, 2015 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -13,14 +13,12 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.bind,v 1.8 2012/04/05 22:16:47 sar Exp $
-
# Configure and build the bind libraries for use by DHCP
include ./version.tmp
version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
-# bindvar.tmp is constructed by configure, it has the paths for
+# bindvar.tmp is constructed by configure, it has the paths for bind
# if GMAKE is blank the shell script couldn't find a gmake to use.
# binddir=
# GMAKE=
@@ -28,6 +26,16 @@ include ./bindvar.tmp
bindsrcdir=bind-${version}
+bindconfig = --disable-kqueue --disable-epoll --disable-devpoll
+bindconfig += --without-openssl --without-libxml2 --enable-exportlib
+bindconfig += --enable-threads=no --with-export-includedir=${binddir}/include
+bindconfig += --with-export-libdir=${binddir}/lib --with-gssapi=no
+bindconfig += @BINDCONFIG@
+
+cleandirs = ./lib ./include
+@BIND_ATF_TRUE@cleandirs += ./atf
+cleanfiles = ./configure.log ./build.log ./install.log
+
all:
# Extract the source from the tarball, if it hasn't been already.
@if test -d ${bindsrcdir} ; then \
@@ -42,19 +50,30 @@ all:
fi
# Configure the export libraries
-# Currently disable the epoll and devpoll options as they don't interact
-# well with the DHCP code.
+# Currently disable the epoll, devpoll and kqueue options as they
+# don't interact well with the DHCP code.
# If the top-level Bind Makefile exists we skip the configuration step
# as we assume it's done and won't change. Doing a make clean will
# reset things if necessary.
- @if test -f ${bindsrcdir}/Makefile ; then \
- echo Bind export libraries already configured ; \
- else \
- echo Configuring BIND Export libraries for DHCP. ; \
- rm -rf ./lib ./include ./configure.log ./build.log ./install.log ; \
- (cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log); \
+ @if test -f ${bindsrcdir}/Makefile ; then \
+ echo Bind export libraries already configured ; \
+ else \
+ echo Configuring BIND Export libraries for DHCP. ; \
+ rm -rf ${cleandirs} ${cleanfiles} ; \
+ (cd ${bindsrcdir} && \
+ ./configure ${bindconfig} > ${binddir}/configure.log); \
fi
+# Build and copy the ATF support if not yet installed.
+@BIND_ATF_TRUE@ @if test -d ./atf ; then \
+@BIND_ATF_TRUE@ echo ATF support already installed ; \
+@BIND_ATF_TRUE@ else \
+@BIND_ATF_TRUE@ echo Building ATF support ; \
+@BIND_ATF_TRUE@ (cd ${bindsrcdir}/unit; \
+@BIND_ATF_TRUE@ MAKE=${GMAKE} ${GMAKE} atf > ${binddir}/build.log ; \
+@BIND_ATF_TRUE@ cp -rp atf ${binddir}) ; \
+@BIND_ATF_TRUE@ fi
+
# Build and install the export libraries
# No need to do anything if we already have something installed.
@if test -d ${binddir}/lib ; then \
@@ -63,7 +82,7 @@ all:
echo Building BIND Export libraries - this takes some time. ;\
(cd ${bindsrcdir}/lib/export ; \
echo building in `pwd` ; \
- MAKE=${GMAKE} ${GMAKE} > ${binddir}/build.log) ; \
+ MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ; \
\
echo Installing BIND Export libraries to ${binddir}. ; \
(cd ${bindsrcdir}/lib/export ; \
@@ -72,8 +91,7 @@ all:
clean:
@echo Cleaning BIND export library.
- rm -rf ${bindsrcdir} ./lib ./include ./configure.log ./build.log \
- ./install.log
+ rm -rf ${bindsrcdir} ${cleandirs} ${cleanfiles}
# Include the following so that this Makefile is happy when the parent
# tries to use them.
diff --git a/util/bind.sh b/util/bind.sh
index c03639f5..81e4d9a4 100644
--- a/util/bind.sh
+++ b/util/bind.sh
@@ -99,7 +99,7 @@ rm -rf bind
# Make and move to our directory for all things bind
mkdir $binddir
-cp util/Makefile.bind bind/Makefile
+cp util/Makefile.bind.in bind/Makefile.in
cd $binddir
# Get the bind version file and move it to version.tmp
diff --git a/util/bindcus.sh b/util/bindcus.sh
deleted file mode 100644
index 6f0388ac..00000000
--- a/util/bindcus.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: bindcus.sh,v 1.2 2009/10/28 04:12:30 sar Exp $
-
-# Configure and build the bind libraries for use by DHCP
-#
-# Usage: sh bindcus.sh
-#
-# Currently no arguments
-#
-
-
-topdir=`pwd`
-binddir=$topdir/bind
-cd bind
-
-. ./version.tmp
-version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
-bindsrcdir=bind-$version
-
-# Extract the source from the tarball
-gunzip -c bind.tar.gz | tar xf -
-
-# Run the script to build and install the export libraries
-sh $topdir/util/bindlib.sh $binddir $bindsrcdir
diff --git a/util/bindlib.sh b/util/bindlib.sh
deleted file mode 100644
index 23cafef7..00000000
--- a/util/bindlib.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: bindlib.sh,v 1.5 2009/11/19 23:49:57 sar Exp $
-
-# Configure, build and install the bind export libraries for use by DHCP
-#
-# Usage: sh bindlib.sh <bind directory> <bind source directory>
-# The intention is for this script to be called by other scrips
-# (bind.sh or bindcus.sh) rather than be called directly.
-#
-# <bind directory> = directory for bind stuff within DHCP, typically
-# <dhcp>/bind
-#
-# <bind source directory> = directory for the unpacked bind source code
-# typically <dhcp>/bind/bind-<version>
-#
-
-binddir="$1"
-bindsrcdir="$2"
-
-gmake=
-for x in gmake gnumake make; do
- if $x --version 2>/dev/null | grep GNU > /dev/null; then
- gmake=$x
- break;
- fi
-done
-if test -z "$gmake"; then
- echo "unable to find gmake" 1>&2
- exit 1;
-fi
-
-# Configure the export libraries
-# Currently disable the epoll and devpoll options as they don't interact
-# well with the DHCP code.
-cd $bindsrcdir
-./configure --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=$binddir/include --with-export-libdir=$binddir/lib > $binddir/configure.log
-
-# Build the export libraries
-cd lib/export
-MAKE=$gmake $gmake > $binddir/build.log
-
-# Install the libraries and includes
-MAKE=$gmake $gmake install > $binddir/install.log