BIND 10 trac433, updated. 6ff2610c28228d3a91b428b178517ff2bb7fbe69 [433] Improve test and make status variable local in scope

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Oct 22 14:18:06 UTC 2013


The branch, trac433 has been updated
       via  6ff2610c28228d3a91b428b178517ff2bb7fbe69 (commit)
      from  9cb427b4940ed7531facf3420f3bdd94afc37f64 (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 6ff2610c28228d3a91b428b178517ff2bb7fbe69
Author: Kean Johnston <kean at isc.org>
Date:   Tue Oct 22 16:17:39 2013 +0200

    [433] Improve test and make status variable local in scope

-----------------------------------------------------------------------

Summary of changes:
 src/bin/msgq/msgq.py.in             |    8 ++++----
 src/bin/msgq/msgq_messages.mes      |    6 +++---
 src/bin/msgq/tests/msgq_run_test.py |    5 +++++
 3 files changed, 12 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index 9fb0e71..a28d97e 100755
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -275,18 +275,18 @@ 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.
-            self._existing = True
+            existing_msgq = True
             try:
                 self._session = isc.cc.Session(self.socket_file)
             except isc.cc.session.SessionError:
-                self._existing = False
+                existing_msgq = False
 
             self._session.close()
             self._session = None
 
-            if self._existing:
+            if existing_msgq:
                 logger.fatal(MSGQ_ALREADY_RUNNING)
-                raise MsgQRunningError("Message Queue daemon already running")
+                raise MsgQRunningError("b10-msgq already running")
 
             os.remove(self.socket_file)
 
diff --git a/src/bin/msgq/msgq_messages.mes b/src/bin/msgq/msgq_messages.mes
index 25ffff0..6f61771 100644
--- a/src/bin/msgq/msgq_messages.mes
+++ b/src/bin/msgq/msgq_messages.mes
@@ -19,9 +19,9 @@
 # <topsrcdir>/tools/reorder_message_file.py to make sure the
 # messages are in the correct order.
 
-% MSGQ_ALREADY_RUNNING Another copy of the message queue daemon is already running.
-Only a single instance of the message queue daemon should ever be run at one
-time. This instance will now terminate.
+% MSGQ_ALREADY_RUNNING Another copy of b10-msgq is already running.
+Only a single instance of b10-msgq should ever be run at one time.
+This instance will now terminate.
 
 % MSGQ_CFGMGR_SUBSCRIBED The config manager subscribed to message queue
 This is a debug message. The message queue has little bit of special handling
diff --git a/src/bin/msgq/tests/msgq_run_test.py b/src/bin/msgq/tests/msgq_run_test.py
index f595535..71bffd6 100644
--- a/src/bin/msgq/tests/msgq_run_test.py
+++ b/src/bin/msgq/tests/msgq_run_test.py
@@ -333,9 +333,14 @@ class MsgqRunTest(unittest.TestCase):
         Check to make sure that an attempt to start a second copy of the MsgQ
         daemon fails.
         """
+
+        self.assertTrue (os.path.exists(SOCKET_PATH))
         self.__retcode = subprocess.call([MSGQ_PATH, '-s', SOCKET_PATH])
         self.assertNotEqual(self.__retcode, 0)
 
+        # Verify that the socket still exists
+        self.assertTrue (os.path.exists(SOCKET_PATH))
+
 if __name__ == '__main__':
     isc.log.init("msgq-tests")
     isc.log.resetUnitTestRootLogger()



More information about the bind10-changes mailing list