Commit c05af906 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

sync with trunk


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac310@2801 e5f2f494-b856-4b98-b285-d166d9295462
parents 5e931bbf 7b0c9a8d
90. [build] jinmei
(Darwin/Mac OS X specific) Specify DYLD_LIBRARY_PATH for tests and
experimental run under the source tree. Without this loadable
python modules refer to installation paths, which may confuse the
operation due to version mismatch or even trigger run time errors
due to missing libraries. (Trac #313, r2782)
89. [build] jinmei
Generate b10-config.db for tests at build time so that the source
tree does not have to be writable. (Trac #315, r2776)
88. [func] jelte
Blocking reads on the msgq command channel now have a timeout
(defaults to 4 seconds, modifiable as needed by modules).
Because of this, modules will no longer block indefinitely
if they are waiting for a message that is not sent for whatever
reason. (Trac #296, r2761)
87. [func] zhanglikun
lib/python/isc/notifyout: Add the feature of notify-out, when
zone axfr/ixfr finishing, the server will notify its slaves.
......
......@@ -28,6 +28,7 @@ report-coverage:
c++/4.4\*/ext/\* \
c++/4.4\*/\*-\*/bits/\* \
boost/\* \
ext/asio/\* \
gtest/\* \
usr/include/\* \
tests/\* \
......
......@@ -40,14 +40,30 @@ AC_HELP_STRING([--enable-static-link],
[enable_static_link=yes], [enable_static_link=no])
AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
# OS dependent compiler flags
# OS dependent configuration
SET_ENV_LIBRARY_PATH=no
ENV_LIBRARY_PATH=LD_LIBRARY_PATH
case "$host" in
*-solaris*)
# Solaris requires special definitions to get some standard libraries
# (e.g. getopt(3)) available with common used header files.
CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
;;
*-apple-darwin*)
# libtool doesn't work pefectly with Darwin: libtool embeds the
# final install path in dynamic libraries and our loadable python
# modules always refer to that path even if it's loaded within the
# source tree. This prevents pre-install tests from working.
# To work around this problem we explicitly specify paths to dynamic
# libraries when we use them in the source tree.
SET_ENV_LIBRARY_PATH=yes
ENV_LIBRARY_PATH=DYLD_LIBRARY_PATH
;;
esac
AM_CONDITIONAL(SET_ENV_LIBRARY_PATH, test $SET_ENV_LIBRARY_PATH = yes)
AC_SUBST(SET_ENV_LIBRARY_PATH)
AC_SUBST(ENV_LIBRARY_PATH)
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
AC_ARG_WITH([pythonpath],
......@@ -433,6 +449,7 @@ AC_CONFIG_FILES([Makefile
src/lib/python/isc/notify/tests/Makefile
src/lib/config/Makefile
src/lib/config/tests/Makefile
src/lib/config/testdata/Makefile
src/lib/dns/Makefile
src/lib/dns/tests/Makefile
src/lib/dns/python/Makefile
......@@ -487,6 +504,7 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/lib/python/bind10_config.py
src/lib/dns/tests/testdata/gen-wiredata.py
src/lib/cc/session_config.h.pre
src/lib/cc/tests/session_unittests_config.h
], [
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/xfrin/run_b10-xfrin.sh
......
......@@ -207,7 +207,7 @@ public:
/// will be thrown.
///
/// Memory for the created object will be dynamically allocated. It's
/// caller's responsibility to \c delete it later.
/// the caller's responsibility to \c delete it later.
/// If resource allocation for the new object fails, a corresponding
/// standard exception will be thrown.
///
......
......@@ -95,6 +95,8 @@ private:
virtual void startRead(boost::function<void()> read_callback);
virtual int reply(ConstElementPtr envelope, ConstElementPtr newmsg);
virtual bool hasQueuedMsgs() const;
virtual void setTimeout(size_t timeout UNUSED_PARAM) {};
virtual size_t getTimeout() const { return 0; };
void setMessage(ConstElementPtr msg) { msg_ = msg; }
void disableSend() { send_ok_ = false; }
......@@ -543,7 +545,6 @@ TEST_F(AuthSrvTest, notify) {
EXPECT_EQ("example.com.", notify_args->get("zone_name")->stringValue());
EXPECT_EQ(DEFAULT_REMOTE_ADDRESS,
notify_args->get("master")->stringValue());
cout << "[XX] ARGS: " << notify_args << endl;
EXPECT_EQ("IN", notify_args->get("zone_class")->stringValue());
// On success, the server should return a response to the notify.
......
......@@ -18,7 +18,7 @@
"""\
This file implements the Boss of Bind (BoB, or bob) program.
It's purpose is to start up the BIND 10 system, and then manage the
Its purpose is to start up the BIND 10 system, and then manage the
processes, by starting and stopping processes, plus restarting
processes that exit.
......
......@@ -24,9 +24,16 @@ PATH=@abs_top_builddir@/src/bin/msgq:@abs_top_builddir@/src/bin/auth:@abs_top_bu
export PATH
PYTHONPATH=@abs_top_builddir@/src/lib/python:@abs_top_builddir@/src/lib/dns/python/.libs:@abs_top_builddir@/src/lib/xfr/.libs
#PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/python:@abs_top_builddir@/src/lib/dns/.libs:@abs_top_builddir@/src/lib/xfr/.libs
export PYTHONPATH
# If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules.
SET_ENV_LIBRARY_PATH=@SET_ENV_LIBRARY_PATH@
if test $SET_ENV_LIBRARY_PATH = yes; then
@ENV_LIBRARY_PATH@=@abs_top_builddir@/src/lib/dns/.libs:@abs_top_builddir@/src/lib/exceptions/.libs:$@ENV_LIBRARY_PATH@
export @ENV_LIBRARY_PATH@
fi
B10_FROM_SOURCE=@abs_top_srcdir@
export B10_FROM_SOURCE
# TODO: We need to do this feature based (ie. no general from_source)
......
......@@ -8,5 +8,5 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/bind10 \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -8,5 +8,5 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_srcdir)/src/bin \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -9,5 +9,5 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/cfgmgr \
$(PYCOVERAGE) $(abs_builddir)/$$pytest ; \
$(PYCOVERAGE) $(abs_builddir)/$$pytest || exit ; \
done
......@@ -10,5 +10,5 @@ check-local:
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/cmdctl \
CMDCTL_SPEC_PATH=$(abs_top_builddir)/src/bin/cmdctl \
CMDCTL_SRC_PATH=$(abs_top_srcdir)/src/bin/cmdctl \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -21,5 +21,5 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/loadzone \
$(SHELL) $(abs_builddir)/$$pytest ; \
$(SHELL) $(abs_builddir)/$$pytest || exit ; \
done
......@@ -21,5 +21,5 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/bin/loadzone \
$(SHELL) $(abs_builddir)/$$pytest ; \
$(SHELL) $(abs_builddir)/$$pytest || exit ; \
done
......@@ -212,7 +212,10 @@ class MsgQ:
EOF."""
received = b''
while len(received) < length:
data = sock.recv(length - len(received))
try:
data = sock.recv(length - len(received))
except socket.error:
raise MsgQReceiveError(socket.error)
if len(data) == 0:
raise MsgQReceiveError("EOF")
received += data
......
......@@ -8,6 +8,6 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/msgq:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
PYTESTS = xfrin_test.py
EXTRA_DIST = $(PYTESTS)
# If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules.
LIBRARY_PATH_PLACEHOLDER =
if SET_ENV_LIBRARY_PATH
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/xfr/.libs:$$$(ENV_LIBRARY_PATH)
endif
# later will have configure option to choose this, like: coverage run --branch
PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
......@@ -8,5 +15,6 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(LIBRARY_PATH_PLACEHOLDER) \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -559,7 +559,7 @@ def raise_interrupt():
def raise_ccerror():
raise isc.cc.session.SessionError('test error')
def raise_excpetion():
def raise_exception():
raise Exception('test exception')
class TestMain(unittest.TestCase):
......@@ -581,7 +581,7 @@ class TestMain(unittest.TestCase):
main(MockXfrin, False)
def test_startup_generalerror(self):
MockXfrin.check_command_hook = raise_excpetion
MockXfrin.check_command_hook = raise_exception
main(MockXfrin, False)
if __name__== "__main__":
......
PYTESTS = xfrout_test.py
EXTRA_DIST = $(PYTESTS)
# If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules.
LIBRARY_PATH_PLACEHOLDER =
if SET_ENV_LIBRARY_PATH
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/xfr/.libs:$$$(ENV_LIBRARY_PATH)
endif
# later will have configure option to choose this, like: coverage run --branch
PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
......@@ -8,5 +15,6 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/xfrout:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(LIBRARY_PATH_PLACEHOLDER) \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -8,5 +8,5 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/zonemgr:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -388,16 +388,20 @@ class TestZonemgrRefresh(unittest.TestCase):
'zone_state': ZONE_OK}
}
master_socket, slave_socket = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
self.zone_refresh._socket = master_socket
master_socket.close()
self.assertRaises(ZonemgrException, self.zone_refresh.run_timer)
self.zone_refresh._socket = slave_socket
listener = threading.Thread(target = self.zone_refresh.run_timer, args = ())
listener.setDaemon(True)
listener.start()
slave_socket.close()
time.sleep(1)
zone_state = self.zone_refresh._zonemgr_refresh_info[ZONE_NAME_CLASS1_IN]["zone_state"]
self.assertTrue("refresh_timeout" in self.zone_refresh._zonemgr_refresh_info[ZONE_NAME_CLASS1_IN].keys())
self.assertTrue(zone_state == ZONE_REFRESHING)
self.assertRaises(ZonemgrException, self.zone_refresh.run_timer)
def tearDown(self):
sys.stdout = self.stdout_backup
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment