BIND 10 master, updated. 1ecbd2b16b44b6439030fd245f951fe5a538ecc5 [master] update changelog
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Dec 2 09:06:57 UTC 2011
The branch, master has been updated
via 1ecbd2b16b44b6439030fd245f951fe5a538ecc5 (commit)
via 83ce13c2d85068a1bec015361e4ef8c35590a5d0 (commit)
via 5f34cb40976859771ab996113f78937310e7bda5 (commit)
via 6690b8985d656aba3f25082cb62c9c02e5ad5a0b (commit)
via 4464612807e6c4bd120298ca105b0503af0d3110 (commit)
via ada65c7115b9840f509f2b0c640368735fe69520 (commit)
via 966fdcc69001cd2562ca96b392b9a45e7c336224 (commit)
via 4ca30d27a1149bf5c445f382c4767b5c4e168d95 (commit)
via f6def2435fe72e00a782244461e8a186a4a23e63 (commit)
via 75fc5817606b892c8eeb4964dc2f3d2f044f5491 (commit)
via 3e1a6afcabbef24f9501d8f4e3ed27d824db4309 (commit)
from 8ee52fc304388aef162a819e2e59066bb70f0618 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1ecbd2b16b44b6439030fd245f951fe5a538ecc5
Author: Jelte Jansen <jelte at isc.org>
Date: Fri Dec 2 10:05:05 2011 +0100
[master] update changelog
commit 83ce13c2d85068a1bec015361e4ef8c35590a5d0
Merge: 8ee52fc304388aef162a819e2e59066bb70f0618 5f34cb40976859771ab996113f78937310e7bda5
Author: Jelte Jansen <jelte at isc.org>
Date: Fri Dec 2 09:37:25 2011 +0100
Merge branch 'trac1292_2'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 16 +++++
configure.ac | 1 +
src/bin/bind10/bind10_src.py.in | 43 -------------
src/bin/bind10/bob.spec | 4 +-
src/bin/bind10/tests/bind10_test.py.in | 9 ++-
src/bin/xfrin/tests/Makefile.am | 1 +
src/lib/datasrc/Makefile.am | 12 +++-
.../datasrc_config.h.pre.in} | 28 ++++-----
src/lib/datasrc/factory.cc | 51 +++++++++++++++-
src/lib/datasrc/factory.h | 11 +++-
src/lib/datasrc/tests/Makefile.am | 25 ++++++--
src/lib/datasrc/tests/factory_unittest.cc | 65 ++++++++++++++++++++
src/lib/python/isc/bind10/special_component.py | 13 ----
src/lib/python/isc/bind10/tests/component_test.py | 4 -
src/lib/python/isc/datasrc/tests/Makefile.am | 1 +
src/lib/python/isc/notify/tests/Makefile.am | 1 +
tests/lettuce/features/terrain/bind10_control.py | 7 ++-
tests/lettuce/features/xfrin_bind10.feature | 1 +
18 files changed, 198 insertions(+), 95 deletions(-)
copy src/lib/{python/isc/datasrc/client_python.h => datasrc/datasrc_config.h.pre.in} (60%)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 5f74851..d7cbf83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+335. [bug]* jelte
+ The DataSourceClientContainer class that dynamically loads
+ datasource backend libraries no longer provides just a .so file name
+ to its call to dlopen(), but passes it an absolute path. This means
+ that it is no longer an system implementation detail that depends on
+ [DY]LD_LIBRARY_PATH which file is chosen, should there be multiple
+ options (for instance, when test-running a new build while a
+ different version is installed).
+ These loadable libraries are also no longer installed in the default
+ library path, but in a subdirectory of the libexec directory of the
+ target ($prefix/libexec/[version]/backends).
+ This also removes the need to handle b10-xfin and b10-xfrout as
+ 'special' hardcoded components, and they are now started as regular
+ components as dictated by the configuration of the boss process.
+ (Trac #1292, git 83ce13c2d85068a1bec015361e4ef8c35590a5d0)
+
334. [bug] jinmei
b10-xfrout could potentially create an overflow response message
(exceeding the 64KB max) or could create unnecessarily small
diff --git a/configure.ac b/configure.ac
index 095fdb8..917a32d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -992,6 +992,7 @@ AC_OUTPUT([doc/version.ent
src/lib/python/bind10_config.py
src/lib/cc/session_config.h.pre
src/lib/cc/tests/session_unittests_config.h
+ src/lib/datasrc/datasrc_config.h.pre
src/lib/log/tests/console_test.sh
src/lib/log/tests/destination_test.sh
src/lib/log/tests/init_logger_test.sh
diff --git a/src/bin/bind10/bind10_src.py.in b/src/bin/bind10/bind10_src.py.in
index 13cd3e3..f9816fb 100755
--- a/src/bin/bind10/bind10_src.py.in
+++ b/src/bin/bind10/bind10_src.py.in
@@ -574,33 +574,6 @@ class BoB:
# ... and start
return self.start_process("b10-resolver", resargs, self.c_channel_env)
- def __ld_path_hack(self):
- # XXX: a quick-hack workaround. xfrin/out will implicitly use
- # dynamically loadable data source modules, which will be installed in
- # $(libdir).
- # On some OSes (including MacOS X and *BSDs) the main process (python)
- # cannot find the modules unless they are located in a common shared
- # object path or a path in the (DY)LD_LIBRARY_PATH. We should seek
- # a cleaner solution, but for a short term workaround we specify the
- # path here, unconditionally, and without even bothering which
- # environment variable should be used.
- #
- # We reuse the ADD_LIBEXEC_PATH variable to see whether we need to
- # do this, as the conditions that make this workaround needed are
- # the same as for the libexec path addition
- # TODO: Once #1292 is finished, remove this method and the special
- # component, use it as normal component.
- env = dict(self.c_channel_env)
- if ADD_LIBEXEC_PATH:
- cur_path = os.getenv('DYLD_LIBRARY_PATH')
- cur_path = '' if cur_path is None else ':' + cur_path
- env['DYLD_LIBRARY_PATH'] = "@@LIBDIR@@" + cur_path
-
- cur_path = os.getenv('LD_LIBRARY_PATH')
- cur_path = '' if cur_path is None else ':' + cur_path
- env['LD_LIBRARY_PATH'] = "@@LIBDIR@@" + cur_path
- return env
-
def start_cmdctl(self):
"""
Starts the command control process
@@ -613,22 +586,6 @@ class BoB:
return self.start_process("b10-cmdctl", args, self.c_channel_env,
self.cmdctl_port)
- def start_xfrin(self):
- # Set up the command arguments.
- args = ['b10-xfrin']
- if self.verbose:
- args += ['-v']
-
- return self.start_process("b10-xfrin", args, self.__ld_path_hack())
-
- def start_xfrout(self):
- # Set up the command arguments.
- args = ['b10-xfrout']
- if self.verbose:
- args += ['-v']
-
- return self.start_process("b10-xfrout", args, self.__ld_path_hack())
-
def start_all_components(self):
"""
Starts up all the components. Any exception generated during the
diff --git a/src/bin/bind10/bob.spec b/src/bin/bind10/bob.spec
index 4267b70..adc9798 100644
--- a/src/bin/bind10/bob.spec
+++ b/src/bin/bind10/bob.spec
@@ -14,8 +14,8 @@
"priority": 5,
"kind": "dispensable"
},
- "b10-xfrin": { "special": "xfrin", "kind": "dispensable" },
- "b10-xfrout": { "special": "xfrout", "kind": "dispensable" },
+ "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
+ "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
"b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
"b10-stats": { "address": "Stats", "kind": "dispensable" },
"b10-stats-httpd": {
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index b7b741c..c917d33 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -268,7 +268,9 @@ class MockBob(BoB):
'b10-stats-httpd': self.start_stats_httpd,
'b10-cmdctl': self.start_cmdctl,
'b10-dhcp6': self.start_dhcp6,
- 'b10-dhcp4': self.start_dhcp4 }
+ 'b10-dhcp4': self.start_dhcp4,
+ 'b10-xfrin': self.start_xfrin,
+ 'b10-xfrout': self.start_xfrout }
return procmap[name]()
def start_xfrout(self):
@@ -463,8 +465,9 @@ class TestStartStopProcessesBob(unittest.TestCase):
if start_auth:
config['b10-auth'] = { 'kind': 'needed', 'special': 'auth' }
config['b10-xfrout'] = { 'kind': 'dispensable',
- 'special': 'xfrout' }
- config['b10-xfrin'] = { 'kind': 'dispensable', 'special': 'xfrin' }
+ 'address': 'Xfrout' }
+ config['b10-xfrin'] = { 'kind': 'dispensable',
+ 'address': 'Xfrin' }
config['b10-zonemgr'] = { 'kind': 'dispensable',
'address': 'Zonemgr' }
if start_resolver:
diff --git a/src/bin/xfrin/tests/Makefile.am b/src/bin/xfrin/tests/Makefile.am
index cffafe1..cba98ae 100644
--- a/src/bin/xfrin/tests/Makefile.am
+++ b/src/bin/xfrin/tests/Makefile.am
@@ -27,5 +27,6 @@ endif
PYTHONPATH=$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/bin/xfrin:$(COMMON_PYTHON_PATH) \
TESTDATASRCDIR=$(abs_top_srcdir)/src/bin/xfrin/tests/testdata/ \
TESTDATAOBJDIR=$(abs_top_builddir)/src/bin/xfrin/tests/testdata/ \
+ B10_FROM_BUILD=$(abs_top_builddir) \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
diff --git a/src/lib/datasrc/Makefile.am b/src/lib/datasrc/Makefile.am
index bf1171e..90c772e 100644
--- a/src/lib/datasrc/Makefile.am
+++ b/src/lib/datasrc/Makefile.am
@@ -7,9 +7,15 @@ AM_CPPFLAGS += $(SQLITE_CFLAGS)
AM_CXXFLAGS = $(B10_CXXFLAGS)
+pkglibexecdir = $(libexecdir)/@PACKAGE@/backends
+
+datasrc_config.h: datasrc_config.h.pre
+ $(SED) -e "s|@@PKGLIBEXECDIR@@|$(pkglibexecdir)|" datasrc_config.h.pre >$@
+
CLEANFILES = *.gcno *.gcda datasrc_messages.h datasrc_messages.cc
+CLEANFILES += datasrc_config.h
-lib_LTLIBRARIES = libdatasrc.la sqlite3_ds.la memory_ds.la
+lib_LTLIBRARIES = libdatasrc.la
libdatasrc_la_SOURCES = data_source.h data_source.cc
libdatasrc_la_SOURCES += static_datasrc.h static_datasrc.cc
libdatasrc_la_SOURCES += sqlite3_datasrc.h sqlite3_datasrc.cc
@@ -25,6 +31,8 @@ libdatasrc_la_SOURCES += database.h database.cc
libdatasrc_la_SOURCES += factory.h factory.cc
nodist_libdatasrc_la_SOURCES = datasrc_messages.h datasrc_messages.cc
+pkglibexec_LTLIBRARIES = sqlite3_ds.la memory_ds.la
+
sqlite3_ds_la_SOURCES = sqlite3_accessor.h sqlite3_accessor.cc
sqlite3_ds_la_LDFLAGS = -module
sqlite3_ds_la_LIBADD = $(top_builddir)/src/lib/exceptions/libexceptions.la
@@ -42,7 +50,7 @@ libdatasrc_la_LIBADD += $(top_builddir)/src/lib/log/liblog.la
libdatasrc_la_LIBADD += $(top_builddir)/src/lib/cc/libcc.la
libdatasrc_la_LIBADD += $(SQLITE_LIBS)
-BUILT_SOURCES = datasrc_messages.h datasrc_messages.cc
+BUILT_SOURCES = datasrc_config.h datasrc_messages.h datasrc_messages.cc
datasrc_messages.h datasrc_messages.cc: Makefile datasrc_messages.mes
$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/datasrc/datasrc_messages.mes
diff --git a/src/lib/datasrc/datasrc_config.h.pre.in b/src/lib/datasrc/datasrc_config.h.pre.in
new file mode 100644
index 0000000..ff99601
--- /dev/null
+++ b/src/lib/datasrc/datasrc_config.h.pre.in
@@ -0,0 +1,31 @@
+// Copyright (C) 2011 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.
+#ifndef __DATASRC_CONFIG_H
+#define __DATASRC_CONFIG_H 1
+
+namespace isc {
+namespace datasrc {
+
+/// \brief Default directory to find the loadable data source libraries
+///
+/// This is the directory where, once installed, loadable backend libraries
+/// such as memory_ds.so and sqlite3_ds.so are found. It is used by the
+/// DataSourceClient loader if no absolute path is used and
+/// B10_FROM_BUILD is not set in the environment.
+const char* const BACKEND_LIBRARY_PATH = "@@PKGLIBEXECDIR@@/";
+
+} // end namespace datasrc
+} // end namespace isc
+
+#endif // __DATASRC_CONFIG_H
diff --git a/src/lib/datasrc/factory.cc b/src/lib/datasrc/factory.cc
index 1818c70..085ab52 100644
--- a/src/lib/datasrc/factory.cc
+++ b/src/lib/datasrc/factory.cc
@@ -19,6 +19,8 @@
#include "sqlite3_accessor.h"
#include "memory_datasrc.h"
+#include "datasrc_config.h"
+
#include <datasrc/logger.h>
#include <dlfcn.h>
@@ -26,6 +28,48 @@
using namespace isc::data;
using namespace isc::datasrc;
+namespace {
+// This helper function takes the 'type' string as passed to
+// the DataSourceClient container below, and, unless it
+// already specifies a specific loadable .so file, will
+// convert the short-name to the full file.
+// I.e. it will add '_ds.so' (if necessary), and prepend
+// it with an absolute path (if necessary).
+// Returns the resulting string to use with LibraryContainer.
+const std::string
+getDataSourceLibFile(const std::string& type) {
+ if (type.empty()) {
+ isc_throw(DataSourceLibraryError,
+ "DataSourceClient container called with empty type value");
+ }
+ if (type == ".so") {
+ isc_throw(DataSourceLibraryError, "DataSourceClient container called "
+ "with bad type or file name");
+ }
+
+ // Type can be either a short name, in which case we need to
+ // append "_ds.so", or it can be a direct .so library.
+ std::string lib_file = type;
+ const int ext_pos = lib_file.rfind(".so");
+ if (ext_pos == std::string::npos || ext_pos + 3 != lib_file.length()) {
+ lib_file.append("_ds.so");
+ }
+ // And if it is not an absolute path, prepend it with our
+ // loadable backend library path
+ if (type[0] != '/') {
+ // When running from the build tree, we do NOT want
+ // to load the installed loadable library
+ if (getenv("B10_FROM_BUILD") != NULL) {
+ lib_file = std::string(getenv("B10_FROM_BUILD")) +
+ "/src/lib/datasrc/.libs/" + lib_file;
+ } else {
+ lib_file = isc::datasrc::BACKEND_LIBRARY_PATH + lib_file;
+ }
+ }
+ return (lib_file);
+}
+} // end anonymous namespace
+
namespace isc {
namespace datasrc {
@@ -34,7 +78,10 @@ LibraryContainer::LibraryContainer(const std::string& name) {
// are recognized as such
ds_lib_ = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL);
if (ds_lib_ == NULL) {
- isc_throw(DataSourceLibraryError, dlerror());
+ // This may cause the filename to appear twice in the actual
+ // error, but the output of dlerror is implementation-dependent
+ isc_throw(DataSourceLibraryError, "dlopen failed for " << name <<
+ ": " << dlerror());
}
}
@@ -61,7 +108,7 @@ LibraryContainer::getSym(const char* name) {
DataSourceClientContainer::DataSourceClientContainer(const std::string& type,
ConstElementPtr config)
-: ds_lib_(type + "_ds.so")
+: ds_lib_(getDataSourceLibFile(type))
{
// We are casting from a data to a function pointer here
// Some compilers (rightfully) complain about that, but
diff --git a/src/lib/datasrc/factory.h b/src/lib/datasrc/factory.h
index 0284067..9d0a762 100644
--- a/src/lib/datasrc/factory.h
+++ b/src/lib/datasrc/factory.h
@@ -68,7 +68,7 @@ public:
/// the library path.
///
/// \exception DataSourceLibraryError If the library cannot be found or
- /// cannot be loaded.
+ /// cannot be loaded, or if name is an empty string.
LibraryContainer(const std::string& name);
/// \brief Destructor
@@ -115,6 +115,15 @@ private:
/// easy recognition and to reduce potential mistakes.
/// For example, the sqlite3 implementation has the type 'sqlite3', and the
/// derived filename 'sqlite3_ds.so'
+/// The value of type can be a specific loadable library; if it already ends
+/// with '.so', the loader will not add '_ds.so'.
+/// It may also be an absolute path; if it starts with '/', nothing is
+/// prepended. If it does not, the loadable library will be taken from the
+/// installation directory, see the value of
+/// isc::datasrc::BACKEND_LIBRARY_PATH in datasrc_config.h for the exact path.
+///
+/// \note When 'B10_FROM_BUILD' is set in the environment, the build
+/// directory is used instead of the install directory.
///
/// There are of course some demands to an implementation, not all of which
/// can be verified compile-time. It must provide a creator and destructor
diff --git a/src/lib/datasrc/tests/Makefile.am b/src/lib/datasrc/tests/Makefile.am
index 70f2999..6dd6b0a 100644
--- a/src/lib/datasrc/tests/Makefile.am
+++ b/src/lib/datasrc/tests/Makefile.am
@@ -55,13 +55,6 @@ run_unittests_SOURCES += test_datasrc.h test_datasrc.cc
run_unittests_SOURCES += rbtree_unittest.cc
run_unittests_SOURCES += logger_unittest.cc
run_unittests_SOURCES += client_unittest.cc
-if !USE_STATIC_LINK
-# This test uses dynamically loadable module. It will cause various
-# troubles with static link such as "missing" symbols in the static object
-# for the module. As a workaround we disable this particualr test
-# in this case.
-run_unittests_SOURCES += factory_unittest.cc
-endif
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
@@ -110,3 +103,21 @@ EXTRA_DIST += testdata/test.sqlite3
EXTRA_DIST += testdata/test.sqlite3.nodiffs
EXTRA_DIST += testdata/rwtest.sqlite3
EXTRA_DIST += testdata/diffs.sqlite3
+
+# For the factory unit tests, we need to specify that we want
+# the loadable backend libraries from the build tree, and not from
+# the installation directory. Therefore we build it into a separate
+# binary, and call that from check-local with B10_FROM_BUILD set.
+# Also, we only want to do this when static building is not used,
+# since it will cause various troubles with static link such as
+# "missing" symbols in the static object for the module.
+if !USE_STATIC_LINK
+noinst_PROGRAMS+=run_unittests_factory
+run_unittests_factory_SOURCES = $(common_sources)
+run_unittests_factory_SOURCES += factory_unittest.cc
+run_unittests_factory_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
+run_unittests_factory_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
+run_unittests_factory_LDADD = $(common_ldadd)
+check-local:
+ B10_FROM_BUILD=${abs_top_builddir} ./run_unittests_factory
+endif
diff --git a/src/lib/datasrc/tests/factory_unittest.cc b/src/lib/datasrc/tests/factory_unittest.cc
index 0133508..e98f9bc 100644
--- a/src/lib/datasrc/tests/factory_unittest.cc
+++ b/src/lib/datasrc/tests/factory_unittest.cc
@@ -14,6 +14,7 @@
#include <boost/scoped_ptr.hpp>
+#include <datasrc/datasrc_config.h>
#include <datasrc/factory.h>
#include <datasrc/data_source.h>
#include <datasrc/sqlite3_accessor.h>
@@ -30,6 +31,70 @@ std::string SQLITE_DBFILE_EXAMPLE_ORG = TEST_DATA_DIR "/example.org.sqlite3";
namespace {
+// note this helper only checks the error that is received up to the length
+// of the expected string. It will always pass if you give it an empty
+// expected_error
+void
+pathtestHelper(const std::string& file, const std::string& expected_error) {
+ std::string error;
+ try {
+ DataSourceClientContainer(file, ElementPtr());
+ } catch (const DataSourceLibraryError& dsle) {
+ error = dsle.what();
+ }
+ ASSERT_LT(expected_error.size(), error.size());
+ EXPECT_EQ(expected_error, error.substr(0, expected_error.size()));
+}
+
+TEST(FactoryTest, paths) {
+ // Test whether the paths are made absolute if they are not,
+ // by inspecting the error that is raised when they are wrong
+ const std::string error("dlopen failed for ");
+ // With the current implementation, we can safely assume this has
+ // been set for this test (as the loader would otherwise also fail
+ // unless the loadable backend library happens to be installed)
+ const std::string builddir(getenv("B10_FROM_BUILD"));
+
+ // Absolute and ending with .so should have no change
+ pathtestHelper("/no_such_file.so", error + "/no_such_file.so");
+
+ // If no ending in .so, it should get _ds.so
+ pathtestHelper("/no_such_file", error + "/no_such_file_ds.so");
+
+ // If not starting with /, path should be added. For this test that
+ // means the build directory as set in B10_FROM_BUILD
+ pathtestHelper("no_such_file.so", error + builddir +
+ "/src/lib/datasrc/.libs/no_such_file.so");
+ pathtestHelper("no_such_file", error + builddir +
+ "/src/lib/datasrc/.libs/no_such_file_ds.so");
+
+ // Some tests with '.so' in the name itself
+ pathtestHelper("no_such_file.so.something", error + builddir +
+ "/src/lib/datasrc/.libs/no_such_file.so.something_ds.so");
+ pathtestHelper("/no_such_file.so.something", error +
+ "/no_such_file.so.something_ds.so");
+ pathtestHelper("/no_such_file.so.something.so", error +
+ "/no_such_file.so.something.so");
+ pathtestHelper("/no_such_file.so.so", error +
+ "/no_such_file.so.so");
+ pathtestHelper("no_such_file.so.something", error + builddir +
+ "/src/lib/datasrc/.libs/no_such_file.so.something_ds.so");
+
+ // Temporarily unset B10_FROM_BUILD to see that BACKEND_LIBRARY_PATH
+ // is used
+ unsetenv("B10_FROM_BUILD");
+ pathtestHelper("no_such_file.so", error + BACKEND_LIBRARY_PATH +
+ "no_such_file.so");
+ // Put it back just in case
+ setenv("B10_FROM_BUILD", builddir.c_str(), 1);
+
+ // Test some bad input values
+ ASSERT_THROW(DataSourceClientContainer("", ElementPtr()),
+ DataSourceLibraryError);
+ ASSERT_THROW(DataSourceClientContainer(".so", ElementPtr()),
+ DataSourceLibraryError);
+}
+
TEST(FactoryTest, sqlite3ClientBadConfig) {
// We start out by building the configuration data bit by bit,
// testing each form of 'bad config', until we have a good one.
diff --git a/src/lib/python/isc/bind10/special_component.py b/src/lib/python/isc/bind10/special_component.py
index 9972200..dad10bb 100644
--- a/src/lib/python/isc/bind10/special_component.py
+++ b/src/lib/python/isc/bind10/special_component.py
@@ -108,16 +108,6 @@ class CmdCtl(Component):
Component.__init__(self, process, boss, kind, 'Cmdctl', None,
boss.start_cmdctl)
-class XfrIn(Component):
- def __init__(self, process, boss, kind, address=None, params=None):
- Component.__init__(self, process, boss, kind, 'Xfrin', None,
- boss.start_xfrin)
-
-class XfrOut(Component):
- def __init__(self, process, boss, kind, address=None, params=None):
- Component.__init__(self, process, boss, kind, 'Xfrout', None,
- boss.start_xfrout)
-
class SetUID(BaseComponent):
"""
This is a pseudo-component which drops root privileges when started
@@ -157,9 +147,6 @@ def get_specials():
'auth': Auth,
'resolver': Resolver,
'cmdctl': CmdCtl,
- # FIXME: Temporary workaround before #1292 is done
- 'xfrin': XfrIn,
- 'xfrout': XfrOut,
# TODO: Remove when not needed, workaround before sockcreator works
'setuid': SetUID
}
diff --git a/src/lib/python/isc/bind10/tests/component_test.py b/src/lib/python/isc/bind10/tests/component_test.py
index 7e18e60..3b49b18 100644
--- a/src/lib/python/isc/bind10/tests/component_test.py
+++ b/src/lib/python/isc/bind10/tests/component_test.py
@@ -86,9 +86,6 @@ class BossUtils:
def start_cmdctl(self):
pass
- def start_xfrin(self):
- pass
-
class ComponentTests(BossUtils, unittest.TestCase):
"""
Tests for the bind10.component.Component class
@@ -511,7 +508,6 @@ class ComponentTests(BossUtils, unittest.TestCase):
isc.bind10.special_component.Auth,
isc.bind10.special_component.Resolver,
isc.bind10.special_component.CmdCtl,
- isc.bind10.special_component.XfrIn,
isc.bind10.special_component.SetUID]:
component = component_type('none', self, 'needed')
self.assertIsNone(component.pid())
diff --git a/src/lib/python/isc/datasrc/tests/Makefile.am b/src/lib/python/isc/datasrc/tests/Makefile.am
index 400abcf..ab89b93 100644
--- a/src/lib/python/isc/datasrc/tests/Makefile.am
+++ b/src/lib/python/isc/datasrc/tests/Makefile.am
@@ -34,5 +34,6 @@ endif
PYTHONPATH=:$(COMMON_PYTHON_PATH):$(abs_top_builddir)/src/lib/python/isc/log:$(abs_top_builddir)/src/lib/python/isc/datasrc/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs \
TESTDATA_PATH=$(abs_srcdir)/testdata \
TESTDATA_WRITE_PATH=$(abs_builddir) \
+ B10_FROM_BUILD=$(abs_top_builddir) \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
diff --git a/src/lib/python/isc/notify/tests/Makefile.am b/src/lib/python/isc/notify/tests/Makefile.am
index 6b62b90..3af5991 100644
--- a/src/lib/python/isc/notify/tests/Makefile.am
+++ b/src/lib/python/isc/notify/tests/Makefile.am
@@ -29,5 +29,6 @@ endif
PYTHONPATH=$(COMMON_PYTHON_PATH):$(abs_top_builddir)/src/lib/dns/python/.libs \
$(LIBRARY_PATH_PLACEHOLDER) \
TESTDATASRCDIR=$(abs_top_srcdir)/src/lib/python/isc/notify/tests/testdata/ \
+ B10_FROM_BUILD=$(abs_top_builddir) \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
diff --git a/tests/lettuce/features/terrain/bind10_control.py b/tests/lettuce/features/terrain/bind10_control.py
index fbbb3a2..5248316 100644
--- a/tests/lettuce/features/terrain/bind10_control.py
+++ b/tests/lettuce/features/terrain/bind10_control.py
@@ -137,5 +137,8 @@ def send_command(step, command, cmdctl_port):
subprocess.PIPE, None)
bindctl.stdin.write(command + "\n")
bindctl.stdin.write("quit\n")
- result = bindctl.wait()
- assert result == 0, "bindctl exit code: " + str(result)
+ (stdout, stderr) = bindctl.communicate()
+ result = bindctl.returncode
+ assert result == 0, "bindctl exit code: " + str(result) +\
+ "\nstdout:\n" + str(stdout) +\
+ "stderr:\n" + str(stderr)
diff --git a/tests/lettuce/features/xfrin_bind10.feature b/tests/lettuce/features/xfrin_bind10.feature
index 23b2eda..70c3571 100644
--- a/tests/lettuce/features/xfrin_bind10.feature
+++ b/tests/lettuce/features/xfrin_bind10.feature
@@ -5,6 +5,7 @@ Feature: Xfrin
Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
And I have bind10 running with configuration xfrin/retransfer_slave.conf
A query for www.example.org should have rcode REFUSED
+ Wait for bind10 stderr message CMDCTL_STARTED
When I send bind10 the command Xfrin retransfer example.org IN 127.0.0.1 47807
Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
A query for www.example.org should have rcode NOERROR
More information about the bind10-changes
mailing list