DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
DISTCHECK_PREMIUM_CONFIGURE_FLAG=@DISTCHECK_PREMIUM_CONFIGURE_FLAG@
DISTCHECK_CONTRIB_CONFIGURE_FLAG=@DISTCHECK_CONTRIB_CONFIGURE_FLAG@
+DISTCHECK_MYSQL_CONFIGURE_FLAG=@DISTCHECK_MYSQL_CONFIGURE_FLAG@
+DISTCHECK_PGSQL_CONFIGURE_FLAG=@DISTCHECK_PGSQL_CONFIGURE_FLAG@
+DISTCHECK_GSSAPI_CONFIGURE_FLAG=@DISTCHECK_GSSAPI_CONFIGURE_FLAG@
+DISTCHECK_LIBYANG_CONFIGURE_FLAG=@DISTCHECK_LIBYANG_CONFIGURE_FLAG@
+DISTCHECK_SYSREPO_CONFIGURE_FLAG=@DISTCHECK_SYSREPO_CONFIGURE_FLAG@
OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html
# Keep the contrib config
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CONTRIB_CONFIGURE_FLAG)
+# Keep the mysql config
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_MYSQL_CONFIGURE_FLAG)
+
+# Keep the pgsql config
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PGSQL_CONFIGURE_FLAG)
+
+# Keep the gssapi config
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GSSAPI_CONFIGURE_FLAG)
+
+# Keep the libyang config
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_LIBYANG_CONFIGURE_FLAG)
+
+# Keep the sysrepo config
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_SYSREPO_CONFIGURE_FLAG)
+
dist_doc_DATA = AUTHORS COPYING ChangeLog README CONTRIBUTING.md platforms.rst code_of_conduct.md
.PHONY: check-valgrind check-valgrind-suppress
--ignore-errors gcov,source,graph \
--output report.info; \
sed --in-place --expression "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" report.info; \
- "$(GENHTML)" --frames --show-details --title 'Kea code coverage report' --legend \
- --function-coverage --ignore-errors source --demangle-cpp \
- --output "$(OVERALL_COVERAGE_DIR)" report.info; \
+ "$(GENHTML)" \
+ --frames --show-details --title 'Kea code coverage report' --legend \
+ --function-coverage --ignore-errors source --demangle-cpp \
+ --output "$(OVERALL_COVERAGE_DIR)" report.info; \
printf "Generated C++ code coverage report in HTML at %s.\n" "$(OVERALL_COVERAGE_DIR)"; \
else \
echo "C++ code coverage not enabled at configuration time." ; \
MYSQL_CONFIG="${withval}"
fi
+DISTCHECK_MYSQL_CONFIGURE_FLAG=
if test "$MYSQL_CONFIG" != "" ; then
if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
AC_MSG_ERROR([MySQL dependencies cannot be found. Please install MySQL libraries or point --with-mysql to mysql_config program if it is located in non-default directory, eg. --with-mysql=/opt/mysql/bin/mysql_config.])
fi
+ DISTCHECK_MYSQL_CONFIGURE_FLAG="--with-mysql=$MYSQL_CONFIG"
+
MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`
MYSQL_LIBS=`$MYSQL_CONFIG --libs`
MYSQL_LIBS="$MYSQL_LIBS $CRYPTO_LIBS"
AC_SUBST(MYSQL_CPPFLAGS)
AC_SUBST(MYSQL_LIBS)
+ AC_SUBST(DISTCHECK_MYSQL_CONFIGURE_FLAG)
# Check that a simple program using MySQL functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS"
PG_CONFIG="${withval}"
fi
+DISTCHECK_PGSQL_CONFIGURE_FLAG=
if test "$PG_CONFIG" != "" ; then
if test -d "$PG_CONFIG" -o ! -x "$PG_CONFIG" ; then
AC_MSG_ERROR([PostgreSQL dependencies cannot be found. Please install PostgreSQL libraries or point --with-pgsql to pg_config program if it is located in non-default directory, eg. --with-pgsql=/opt/pgsql/bin/pg_config.])
fi
+ DISTCHECK_PGSQL_CONFIGURE_FLAG="--with-pgsql=$PG_CONFIG"
+
PGSQL_CPPFLAGS=`$PG_CONFIG --cppflags`
PGSQL_INCLUDEDIR=`$PG_CONFIG --includedir`
PGSQL_INCLUDEDIR_SERVER=`$PG_CONFIG --includedir-server`
AC_SUBST(PGSQL_CPPFLAGS)
AC_SUBST(PGSQL_LIBS)
+ AC_SUBST(DISTCHECK_PGSQL_CONFIGURE_FLAG)
# Check that a simple program using PostgreSQL functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS"
clean-local:
rm -rf $(sphinxbuilddir)
- rm -f $(srcdir)/mes-files.txt $(srcdir)/api-files.txt
rm -f $(srcdir)/kea-messages.rst $(srcdir)/api.rst
rm -f $(srcdir)/arm/platforms.rst
described in the :ref:`hooks-cb-cmds` section. The general rule is that
scalar global parameters are set using
``remote-global-parameter4-set``; shared-network-specific parameters
-are set using ``remote-network4-set``; and subnet- and pool-level
+are set using ``remote-network4-set``; and subnet-level and pool-level
parameters are set using ``remote-subnet4-set``. Whenever
there is an exception to this general rule, it is highlighted in the
table. Non-scalar global parameters have dedicated commands; for example,
ENABLE_GSSAPI=no
GSSAPI_CFLAGS=
GSSAPI_LIBS=
+DISTCHECK_GSSAPI_CONFIGURE_FLAG="--with-gssapi=$gssapi_path"
AC_MSG_CHECKING([for gssapi support])
if test "x$gssapi_path" = "x" ; then
AC_SUBST(GSSAPI_CFLAGS)
AC_SUBST(GSSAPI_LIBS)
+AC_SUBST(DISTCHECK_GSSAPI_CONFIGURE_FLAG)
AM_CONDITIONAL([HAVE_GSSAPI], [test $ENABLE_GSSAPI = "yes"])
])dnl AX_GSS_API
[AS_HELP_STRING([--with-libyang[[=PATH]]], [optional path to the libyang installation directory])],
[with_libyang="${withval}"])
+ DISTCHECK_LIBYANG_CONFIGURE_FLAG="--with-libyang=$with_libyang"
+
AC_ARG_WITH([sysrepo],
[AS_HELP_STRING([--with-sysrepo[[=PATH]]], [optional path to the sysrepo installation directory])],
[with_sysrepo="${withval}"])
+ DISTCHECK_SYSREPO_CONFIGURE_FLAG="--with-sysrepo=$with_sysrepo"
+
# If --with-libyang was omitted, assume it was passed and give it the value
# from --with-sysrepo.
if test -z "${with_libyang}"; then
AC_SUBST(SRPD_PLUGINS_PATH)
AC_SUBST(SYSREPO_VERSION)
AC_SUBST(SYSREPOCPP_VERSION)
+ AC_SUBST(DISTCHECK_LIBYANG_CONFIGURE_FLAG)
+ AC_SUBST(DISTCHECK_SYSREPO_CONFIGURE_FLAG)
])
EXTRA_DIST = \
- lease4_dump_test.reference.csv \
- lease6_dump_test.reference.csv
+ lease4_dump_test.reference.csv \
+ lease6_dump_test.reference.csv
EXTRA_DIST += testdata/hiddenu
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
# Shell tests
SHTESTS = ca_process_tests.sh
EXTRA_DIST += testdata/get_config.json
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
# Shell tests
SHTESTS = d2_process_tests.sh
EXTRA_DIST = get_config_unittest.cc.skel
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
# Shell tests
SHTESTS = dhcp4_process_tests.sh
EXTRA_DIST = get_config_unittest.cc.skel
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
# Shell tests
SHTESTS = dhcp6_process_tests.sh
# Install keactrl in sbin and the keactrl.conf required by the keactrl
# in etc. keactrl will look for its configuration file in the etc folder.
sbin_SCRIPTS = keactrl
-KEA_CONFIGFILES = kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf \
- kea-ctrl-agent.conf
+KEA_CONFIGFILES = \
+ kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf kea-ctrl-agent.conf
+
if HAVE_SYSREPO
KEA_CONFIGFILES += kea-netconf.conf
endif
DISTCLEANFILES = keactrl keactrl.conf
CLEANFILES = $(KEA_CONFIGFILES)
-EXTRA_DIST = keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \
- kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \
- kea-ctrl-agent.conf.pre kea-netconf.conf.pre
+EXTRA_DIST = \
+ keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \
+ kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \
+ kea-ctrl-agent.conf.pre kea-netconf.conf.pre
# *.conf files are not really sources used for building other targets, but we need
# these files to be generated before make install is called.
kea-dhcp4.conf: kea-dhcp4.conf.pre
$(top_builddir)/tools/path_replacer.sh \
- $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@
+ $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@
kea-dhcp6.conf: kea-dhcp6.conf.pre
$(top_builddir)/tools/path_replacer.sh \
- $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@
+ $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@
kea-dhcp-ddns.conf: kea-dhcp-ddns.conf.pre
$(top_builddir)/tools/path_replacer.sh \
- $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@
+ $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@
kea-ctrl-agent.conf: kea-ctrl-agent.conf.pre
$(top_builddir)/tools/path_replacer.sh \
- $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@
+ $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@
kea-netconf.conf: kea-netconf.conf.pre
$(top_builddir)/tools/path_replacer.sh \
- $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@
+ $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@
if INSTALL_CONFIGURATIONS
endif
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
TESTS =
if HAVE_GTEST
endif
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
TESTS =
if HAVE_GTEST
CLEANFILES += test1.hex test2.hex test3.hex test4.hex test5.hex
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
TESTS =
if HAVE_GTEST
DISTCLEANFILES = test_libraries.h
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
TESTS =
if HAVE_GTEST
#include <dhcpsrv/lease_mgr_factory.h>
#include <dhcpsrv/mysql_lease_mgr.h>
#include <dhcpsrv/testutils/test_utils.h>
+#include <dhcpsrv/testutils/mysql_generic_backend_unittest.h>
#include <dhcpsrv/tests/generic_lease_mgr_unittest.h>
#include <exceptions/exceptions.h>
#include <mysql/mysql_connection.h>
testLeaseStatsQueryAttribution6();
}
+/// @brief This test is a basic check for the generic backend test class,
+/// rather than any production code check.
+TEST_F(MySqlGenericBackendTest, leaseCount) {
+
+ // Create database connection parameter list
+ DatabaseConnection::ParameterMap params;
+ params["name"] = "keatest";
+ params["user"] = "keatest";
+ params["password"] = "keatest";
+
+ // Create and open the database connection
+ MySqlConnection conn(params);
+ conn.openDatabase();
+
+ // Check that the countRows is working. It's used extensively in other
+ // tests, so basic check is enough here.
+ EXPECT_EQ(0, countRows(conn, "lease4"));
+}
+
/// @brief Checks that no exceptions are thrown when inquiring about JSON
/// support and prints an informative message.
TEST_F(MySqlLeaseMgrTest, isJsonSupported) {
#include <config.h>
#include <dhcpsrv/testutils/mysql_generic_backend_unittest.h>
+#include <mysql/testutils/mysql_schema.h>
using namespace isc::db;
+using namespace isc::db::test;
namespace isc {
namespace dhcp {
MySqlGenericBackendTest::MySqlGenericBackendTest()
: GenericBackendTest() {
+ createMySQLSchema();
}
size_t
#include <config.h>
#include <dhcpsrv/testutils/pgsql_generic_backend_unittest.h>
+#include <pgsql/testutils/pgsql_schema.h>
using namespace isc::db;
+using namespace isc::db::test;
namespace isc {
namespace dhcp {
PgSqlGenericBackendTest::PgSqlGenericBackendTest()
: GenericBackendTest() {
+ createPgSQLSchema();
}
size_t
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.
-noinst_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la \
- liblecl.la libucl.la libfcl.la libpcl.la libacl.la
+noinst_LTLIBRARIES = \
+ libnvl.la libivl.la libfxl.la libbcl.la liblcl.la \
+ liblecl.la libucl.la libfcl.la libpcl.la libacl.la
# -rpath /nowhere is a hack to trigger libtool to not create a
# convenience archive, resulting in shared modules
CLEANFILES = *.gcno *.gcda
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
TESTS =
if HAVE_GTEST
CLEANFILES += *.csv
TESTS_ENVIRONMENT = \
- $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
TESTS =
if HAVE_GTEST