BIND 10 master, updated. 7ece6fb69d2791ea263c080083a725c36e7a12ea [master] use AF_UNIX socket.socket object instead of socket.socketpair()[0]

BIND 10 source code commits bind10-changes at lists.isc.org
Wed May 8 03:44:25 UTC 2013


The branch, master has been updated
       via  7ece6fb69d2791ea263c080083a725c36e7a12ea (commit)
      from  d2861efce4cf71c924de470c48594727e0eba80f (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 7ece6fb69d2791ea263c080083a725c36e7a12ea
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue May 7 20:43:17 2013 -0700

    [master] use AF_UNIX socket.socket object instead of socket.socketpair()[0]
    
    for "dummy" socket.  in python3.1 the latter is of _socket.socket, which
    breaks the assumption of a test.
    okayed on bind10-dev.

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

Summary of changes:
 src/bin/stats/tests/test_utils.py |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py
index 8b45f26..8886ad2 100644
--- a/src/bin/stats/tests/test_utils.py
+++ b/src/bin/stats/tests/test_utils.py
@@ -446,7 +446,7 @@ class MyStatsHttpd(stats_httpd.StatsHttpd):
     ORIG_SPECFILE_LOCATION = stats_httpd.SPECFILE_LOCATION
     def __init__(self, *server_address):
         self._started = threading.Event()
-        self.__dummy_socks = None # see below
+        self.__dummy_sock = None # see below
 
         # Prepare commonly used statistics schema and data requested in
         # stats-httpd tests.  For the purpose of these tests, the content of
@@ -501,10 +501,11 @@ class MyStatsHttpd(stats_httpd.StatsHttpd):
 
         # replace some (faked) ModuleCCSession methods so we can inspect/fake.
         # in order to satisfy select.select() we need some real socket.  We
-        # use a socketpair(), but won't actually use it for communication.
+        # use an unusable AF_UNIX socket; we won't actually use it for
+        # communication.
         self.cc_session.rpc_call = self.__rpc_call
-        self.__dummy_socks = socket.socketpair()
-        self.mccs.get_socket = lambda: self.__dummy_socks[0]
+        self.__dummy_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+        self.mccs.get_socket = lambda: self.__dummy_sock
 
     def open_mccs(self):
         self.mccs = MyModuleCCSession(stats_httpd.SPECFILE_LOCATION,
@@ -515,10 +516,9 @@ class MyStatsHttpd(stats_httpd.StatsHttpd):
 
     def close_mccs(self):
         super().close_mccs()
-        if self.__dummy_socks is not None:
-            self.__dummy_socks[0].close()
-            self.__dummy_socks[1].close()
-            self.__dummy_socks = None
+        if self.__dummy_sock is not None:
+            self.__dummy_sock.close()
+            self.__dummy_sock = None
 
     def __rpc_call(self, command, group, params={}):
         """Faked ModuleCCSession.rpc_call for tests.



More information about the bind10-changes mailing list