BIND 10 trac433, updated. 83950286387c7e41661c810dc173171e8b9e1fd9 [433] Verify the existing daemon behaves correctly after multiple invocations
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 24 16:35:39 UTC 2013
The branch, trac433 has been updated
via 83950286387c7e41661c810dc173171e8b9e1fd9 (commit)
via d67f893b43f1c293d7342dbd02a6cbf044d3a201 (commit)
from 6ff2610c28228d3a91b428b178517ff2bb7fbe69 (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 83950286387c7e41661c810dc173171e8b9e1fd9
Author: Kean Johnston <kean at isc.org>
Date: Thu Oct 24 18:26:23 2013 +0200
[433] Verify the existing daemon behaves correctly after multiple invocations
As per review, update the tests to ensure that the existing message
queue daemon still works even after we have had a failed attempt to
start a second copy of the daemon.
commit d67f893b43f1c293d7342dbd02a6cbf044d3a201
Author: Kean Johnston <kean at isc.org>
Date: Thu Oct 24 17:49:06 2013 +0200
[433] Use a local variable rather than one larger in scope
As per review, don't use self._session for the check to see if there is
an existing message queue running. Rather, use a localally scoped
variable that will get cleaned up when the function exits.
-----------------------------------------------------------------------
Summary of changes:
src/bin/msgq/msgq.py.in | 10 ++++------
src/bin/msgq/tests/msgq_run_test.py | 5 ++++-
2 files changed, 8 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index a28d97e..7346f7e 100755
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -275,16 +275,14 @@ class MsgQ:
# connect to the existing socket to see if there is an existing
# msgq running. Only if that fails do we remove the file and
# attempt to create a new socket.
- existing_msgq = True
+ existing_msgq = None
try:
- self._session = isc.cc.Session(self.socket_file)
+ existing_msgq = isc.cc.Session(self.socket_file)
except isc.cc.session.SessionError:
- existing_msgq = False
-
- self._session.close()
- self._session = None
+ existing_msgq = None
if existing_msgq:
+ existing_msgq.close()
logger.fatal(MSGQ_ALREADY_RUNNING)
raise MsgQRunningError("b10-msgq already running")
diff --git a/src/bin/msgq/tests/msgq_run_test.py b/src/bin/msgq/tests/msgq_run_test.py
index 71bffd6..5b0c711 100644
--- a/src/bin/msgq/tests/msgq_run_test.py
+++ b/src/bin/msgq/tests/msgq_run_test.py
@@ -338,8 +338,11 @@ class MsgqRunTest(unittest.TestCase):
self.__retcode = subprocess.call([MSGQ_PATH, '-s', SOCKET_PATH])
self.assertNotEqual(self.__retcode, 0)
- # Verify that the socket still exists
+ # Verify that the socket still exists and works. We re-call
+ # test_send_direct as a means of testing that the existing
+ # daemon is still behaving correctly.
self.assertTrue (os.path.exists(SOCKET_PATH))
+ self.test_send_direct()
if __name__ == '__main__':
isc.log.init("msgq-tests")
More information about the bind10-changes
mailing list