BIND 10 trac2353, updated. de66fdd73b8f545768166b7406be878c137cc019 [2353] Test BoB.startup() when socket already exists
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 6 03:20:12 UTC 2012
The branch, trac2353 has been updated
via de66fdd73b8f545768166b7406be878c137cc019 (commit)
from cdbe6dedf437b052cb60777c470cfda312f50b43 (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 de66fdd73b8f545768166b7406be878c137cc019
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Dec 6 08:50:03 2012 +0530
[2353] Test BoB.startup() when socket already exists
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/tests/bind10_test.py.in | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index 1d68393..4201cdc 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -1234,6 +1234,7 @@ class TestBossComponents(unittest.TestCase):
self._tmp_time = None
self._tmp_sleep = None
self._tmp_module_cc_session = None
+ self._tmp_cc_session = None
def tearDown(self):
if self._tmp_time is not None:
@@ -1242,6 +1243,8 @@ class TestBossComponents(unittest.TestCase):
time.sleep = self._tmp_sleep
if self._tmp_module_cc_session is not None:
isc.config.ModuleCCSession = self._tmp_module_cc_session
+ if self._tmp_cc_session is not None:
+ isc.cc.Session = self._tmp_cc_session
def __unary_hook(self, param):
"""
@@ -1997,6 +2000,17 @@ class TestBossComponents(unittest.TestCase):
def kill_started_components(self):
self.killed = True
+ class DummySession():
+ def __init__(self, socket_file):
+ raise isc.cc.session.SessionError('This is the expected case.')
+
+ class DummySessionSocketExists():
+ def __init__(self, socket_file):
+ # simulate that connect passes
+ return
+
+ isc.cc.Session = DummySession
+
# All is well case, where all components are started
# successfully. We check that the actual call to
# start_all_components() is made, and BoB.runnable is true.
@@ -2026,6 +2040,14 @@ class TestBossComponents(unittest.TestCase):
r = bob.startup()
self.assertEqual({'BIND10_MSGQ_SOCKET_FILE': 'foo'}, bob.c_channel_env)
+ # Check the case when socket file already exists
+ isc.cc.Session = DummySessionSocketExists
+ bob = MockBobStartup(False)
+ r = bob.startup()
+ self.assertIn('already running', r)
+
+ # isc.cc.Session is restored during tearDown().
+
class SocketSrvTest(unittest.TestCase):
"""
This tests some methods of boss related to the unix domain sockets used
More information about the bind10-changes
mailing list