[svn] commit: r3371 - in /trunk/src/bin/msgq/tests: Makefile.am msgq_test.py

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Oct 27 10:08:28 UTC 2010


Author: jinmei
Date: Wed Oct 27 10:08:28 2010
New Revision: 3371

Log:
merged the proposed patch in trac #297: making msgq tests runnable in parallel with an installed version of BIND 10.  Typo identified via review was fixed.
(not plan to spam changelog for this change)

Modified:
    trunk/src/bin/msgq/tests/Makefile.am
    trunk/src/bin/msgq/tests/msgq_test.py

Modified: trunk/src/bin/msgq/tests/Makefile.am
==============================================================================
--- trunk/src/bin/msgq/tests/Makefile.am (original)
+++ trunk/src/bin/msgq/tests/Makefile.am Wed Oct 27 10:08:28 2010
@@ -8,6 +8,7 @@
 	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 \
+	BIND10_TEST_SOCKET_FILE=$(builddir)/test_msgq_socket.sock \
 	$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
 	done
 

Modified: trunk/src/bin/msgq/tests/msgq_test.py
==============================================================================
--- trunk/src/bin/msgq/tests/msgq_test.py (original)
+++ trunk/src/bin/msgq/tests/msgq_test.py Wed Oct 27 10:08:28 2010
@@ -79,9 +79,14 @@
 
     def test_open_socket_default(self):
         env_var = None
+        orig_socket_file = None
         if "BIND10_MSGQ_SOCKET_FILE" in os.environ:
             env_var = os.environ["BIND10_MSGQ_SOCKET_FILE"]
             del os.environ["BIND10_MSGQ_SOCKET_FILE"]
+        # temporarily replace the class "default" not to be disrupted by
+        # any running BIND 10 instance.
+        if "BIND10_TEST_SOCKET_FILE" in os.environ:
+            MsgQ.SOCKET_FILE = os.environ["BIND10_TEST_SOCKET_FILE"]
         socket_file = MsgQ.SOCKET_FILE
         self.assertFalse(os.path.exists(socket_file))
         msgq = MsgQ();
@@ -96,6 +101,8 @@
             pass
         if env_var is not None:
             os.environ["BIND10_MSGQ_SOCKET_FILE"] = env_var
+        if orig_socket_file is not None:
+            MsgQ.SOCKET_FILE = orig_socket_file
 
     def test_open_socket_bad(self):
         msgq = MsgQ("/does/not/exist")




More information about the bind10-changes mailing list