diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/d2/d2_hooks.dox | 2 | ||||
-rw-r--r-- | src/bin/d2/tests/Makefile.am | 4 | ||||
-rw-r--r-- | src/bin/d2/tests/configured_library.cc | 21 | ||||
-rw-r--r-- | src/lib/d2srv/d2_messages.mes | 2 |
4 files changed, 17 insertions, 12 deletions
diff --git a/src/bin/d2/d2_hooks.dox b/src/bin/d2/d2_hooks.dox index 66749c6389..7cf4ee38a7 100644 --- a/src/bin/d2/d2_hooks.dox +++ b/src/bin/d2/d2_hooks.dox @@ -46,7 +46,7 @@ packet processing, but the exact order depends on the actual processing. Hook po that are not specific to packet processing (e.g. lease expiration) will be added to the end of this list. - @subsection d2HooksD2SrvConfigured dhcp2_srv_configured + @subsection d2HooksD2SrvConfigured d2_srv_configured - @b Arguments: - name: @b io_context, type: isc::asiolink::IOServicePtr, direction: <b>in</b> - name: @b json_config, type: isc::data::ConstElementPtr, direction: <b>in</b> diff --git a/src/bin/d2/tests/Makefile.am b/src/bin/d2/tests/Makefile.am index 2d0013561c..334f4df745 100644 --- a/src/bin/d2/tests/Makefile.am +++ b/src/bin/d2/tests/Makefile.am @@ -111,14 +111,14 @@ libcallout_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere # The d2_srv_configured callout library libconfigured_la_SOURCES = configured_library.cc libconfigured_la_CXXFLAGS = $(AM_CXXFLAGS) -libconfigured_la_CPPFLAGS = $(AM_CPPFLAGS) +libconfigured_la_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) libconfigured_la_LIBADD = $(top_builddir)/src/lib/hooks/libkea-hooks.la libconfigured_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la libconfigured_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la libconfigured_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la libconfigured_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la libconfigured_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la -libconfigured_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) +libconfigured_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD) libconfigured_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere noinst_LTLIBRARIES = libcallout.la libconfigured.la diff --git a/src/bin/d2/tests/configured_library.cc b/src/bin/d2/tests/configured_library.cc index 6bf872f636..a6353cfd63 100644 --- a/src/bin/d2/tests/configured_library.cc +++ b/src/bin/d2/tests/configured_library.cc @@ -9,6 +9,7 @@ #include <config.h> #include <cc/data.h> #include <hooks/hooks.h> +#include <gtest/gtest.h> using namespace isc::data; using namespace isc::hooks; @@ -22,18 +23,22 @@ extern "C" { int d2_srv_configured(CalloutHandle& handle) { // Get the parameters. + EXPECT_EQ(CalloutHandle::NEXT_STEP_CONTINUE, handle.getStatus()); ConstElementPtr cfg; - string error; handle.getArgument("json_config", cfg); + EXPECT_TRUE(cfg); + if (!cfg) { + return (1); + } + string error; handle.getArgument("error", error); + EXPECT_TRUE(error.empty()); - if (cfg) { - ConstElementPtr uc = cfg->get("user-context"); - if (uc) { - ConstElementPtr msg = uc->get("error"); - if (msg && (msg->getType() == Element::string)) { - error = msg->stringValue(); - } + ConstElementPtr uc = cfg->get("user-context"); + if (uc) { + ConstElementPtr msg = uc->get("error"); + if (msg && (msg->getType() == Element::string)) { + error = msg->stringValue(); } } diff --git a/src/lib/d2srv/d2_messages.mes b/src/lib/d2srv/d2_messages.mes index cb62f9010b..75bf8da1aa 100644 --- a/src/lib/d2srv/d2_messages.mes +++ b/src/lib/d2srv/d2_messages.mes @@ -43,7 +43,7 @@ has been invoked. % DHCP_DDNS_CONFIGURED_CALLOUT_DROP configuration was rejected because a callout set the next step to 'drop': %1 This error message indicates that the DHCP-DDNS had failed configuration -attempt because the next stop of the configured callout was set to 'drop' +attempt because the next step of the configured callout was set to 'drop' by a hook library. The error message provided by the hook library is displayed. % DHCP_DDNS_CONFIG_CHECK_FAIL DHCP-DDNS server configuration check failed: %1 |