BIND 10 trac1429, updated. 4220ef5ac9c8fdd4b506b3579f0e5eec98e3f3d8 [1429] More thorough test
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Dec 7 14:57:27 UTC 2011
The branch, trac1429 has been updated
via 4220ef5ac9c8fdd4b506b3579f0e5eec98e3f3d8 (commit)
via 56be59fbcdc0ba54ccea0d09d49ef28dace3d65d (commit)
via 1341209064bc7afd8e720e3b12060239c368bcdd (commit)
from 88f94cf8e025558b14091af5050e2ce424237ea0 (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 4220ef5ac9c8fdd4b506b3579f0e5eec98e3f3d8
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Dec 7 15:57:10 2011 +0100
[1429] More thorough test
commit 56be59fbcdc0ba54ccea0d09d49ef28dace3d65d
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Dec 7 15:35:11 2011 +0100
[1429] Comment explaining importing twice
commit 1341209064bc7afd8e720e3b12060239c368bcdd
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Dec 7 15:32:05 2011 +0100
[1429] Logging fixes
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/bind10_messages.mes | 2 +-
src/bin/bind10/bind10_src.py.in | 4 ++--
src/bin/bind10/tests/bind10_test.py.in | 20 +++++++++++---------
3 files changed, 14 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/bind10_messages.mes b/src/bin/bind10/bind10_messages.mes
index 82c1b99..79635fd 100644
--- a/src/bin/bind10/bind10_messages.mes
+++ b/src/bin/bind10/bind10_messages.mes
@@ -99,7 +99,7 @@ The boss module is sending a kill signal to process with the given name,
as part of the process of killing all started processes during a failed
startup, as described for BIND10_KILLING_ALL_PROCESSES
-% BIND10_LOST_SOCKET_CONSUMER consumer of sockets disconnected, considering all its sockets closed
+% BIND10_LOST_SOCKET_CONSUMER consumer %1 of sockets disconnected, considering all its sockets closed
A connection from one of the applications which requested a socket was
closed. This means the application has terminated, so all the sockets it was
using are now closed and bind10 process can release them as well, unless the
diff --git a/src/bin/bind10/bind10_src.py.in b/src/bin/bind10/bind10_src.py.in
index de8ac8c..209899c 100755
--- a/src/bin/bind10/bind10_src.py.in
+++ b/src/bin/bind10/bind10_src.py.in
@@ -876,7 +876,7 @@ class BoB:
unix_socket.sendall(CREATOR_SOCKET_OK)
libutil_io_python.send_fd(unix_socket.fileno(), fd)
except Exception as e:
- logger.error(BIND10_NO_SOCKET, token, e)
+ logger.info(BIND10_NO_SOCKET, token, e)
unix_socket.sendall(CREATOR_SOCKET_UNAVAILABLE)
def socket_consumer_dead(self, unix_socket):
@@ -885,7 +885,7 @@ class BoB:
sockets sent to it are to be considered closed. This function signals
so to the _socket_cache.
"""
- logger.error(BIND10_LOST_SOCKET_CONSUMER, unix_socket.fileno())
+ logger.info(BIND10_LOST_SOCKET_CONSUMER, unix_socket.fileno())
try:
self._socket_cache.drop_application(unix_socket.fileno())
except ValueError:
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index f6ad0e9..d2e0d56 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -13,6 +13,9 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# Most of the time, we omit the "bind10_src" for brevity. Sometimes,
+# we want to be explicit about what we do, like when hijacking a library
+# call used by the bind10_src.
from bind10_src import ProcessInfo, BoB, parse_args, dump_pid, unlink_pid_file, _BASETIME
import bind10_src
@@ -427,12 +430,12 @@ class TestBoB(unittest.TestCase):
self.assertEqual(bob.command_handler("__UNKNOWN__", None),
isc.config.ccsession.create_answer(1, "Unknown command"))
- # Fake the _get_socket, which is complicated and tested elsewhere
- # We just want to pass the parameters in and let it create a response
- def get_socket(args):
- return isc.config.ccsession.create_answer(0, args)
-
- bob._get_socket = get_socket
+ # Fake the get_token of cache and test the command works
+ bob._socket_path = '/socket/path'
+ class cache:
+ def get_token(self, protocol, addr, port, share_mode, share_name):
+ return str(addr) + ':' + str(port)
+ bob._socket_cache = cache()
args = {
"port": 53,
"address": "0.0.0.0",
@@ -440,10 +443,9 @@ class TestBoB(unittest.TestCase):
"share_mode": "ANY",
"share_name": "app"
}
- # Test it just returns whatever it got. The real function doesn't
- # work like this, but we don't want the command_handler to touch it
# at all and this is the easiest way to check.
- self.assertEqual({'result': [0, args]},
+ self.assertEqual({'result': [0, {'token': '0.0.0.0:53',
+ 'path': '/socket/path'}]},
bob.command_handler("get_socket", args))
# The drop_socket is not tested here, but in TestCacheCommands.
# It needs the cache mocks to be in place and they are there.
More information about the bind10-changes
mailing list