Commit 6913a589 authored by Francis Dupont's avatar Francis Dupont
Browse files

new config option: build ATF stuff from bind [#38754]

parent cba7bc1c
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -239,6 +239,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -212,6 +212,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -246,6 +246,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -250,6 +250,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -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" ;;
......
......@@ -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
......
......@@ -214,6 +214,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -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
......
......@@ -195,6 +195,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -168,6 +168,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -211,6 +211,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -192,6 +192,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -253,6 +253,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -259,6 +259,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
......@@ -163,6 +163,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDCONFIG = @BINDCONFIG@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
......
#
# 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