BIND 10 trac1429, updated. 88f94cf8e025558b14091af5050e2ce424237ea0 [1429] IPv6 address in test

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 6 13:02:08 UTC 2011


The branch, trac1429 has been updated
       via  88f94cf8e025558b14091af5050e2ce424237ea0 (commit)
       via  4db174c8f096e2b54b3a5d384a6cffc25b9d9024 (commit)
       via  3bb1cc7d961930edc38d9f8b34d0cccd3d69dd96 (commit)
      from  6583a47dde1b851aee99de3c38c6331a22ede260 (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 88f94cf8e025558b14091af5050e2ce424237ea0
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Dec 6 13:47:04 2011 +0100

    [1429] IPv6 address in test

commit 4db174c8f096e2b54b3a5d384a6cffc25b9d9024
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Dec 6 13:35:36 2011 +0100

    [1429] Use set_creator, not insert_creator
    
    Just a naming convention

commit 3bb1cc7d961930edc38d9f8b34d0cccd3d69dd96
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Dec 6 11:16:26 2011 +0100

    [1429] Docstring update

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

Summary of changes:
 src/bin/bind10/bind10_src.py.in                |    2 +-
 src/bin/bind10/tests/bind10_test.py.in         |   12 ++++++------
 src/lib/python/isc/bind10/socket_cache.py      |    8 ++++----
 src/lib/python/isc/bind10/special_component.py |    2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/bind10/bind10_src.py.in b/src/bin/bind10/bind10_src.py.in
index da0514c..de8ac8c 100755
--- a/src/bin/bind10/bind10_src.py.in
+++ b/src/bin/bind10/bind10_src.py.in
@@ -895,7 +895,7 @@ class BoB:
             # rare, though.
             pass
 
-    def insert_creator(self, creator):
+    def set_creator(self, creator):
         """
         Registeres a socket creator into the boss. The socket creator is not
         used directly, but through a cache. The cache is created in this
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index 8dd1921..f6ad0e9 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -117,7 +117,7 @@ class TestCacheCommands(unittest.TestCase):
         self.__raise_exception = None
         self.__socket_args = {
             "port": 53,
-            "address": "0.0.0.0",
+            "address": "::",
             "protocol": "UDP",
             "share_mode": "ANY",
             "share_name": "app"
@@ -242,7 +242,7 @@ class TestCacheCommands(unittest.TestCase):
         }, answer)
         addr = self.__get_token_called[1]
         self.assertTrue(isinstance(addr, IPAddr))
-        self.assertEqual("0.0.0.0", str(addr))
+        self.assertEqual("::", str(addr))
         self.assertEqual(("UDP", addr, 53, "ANY", "app"),
                          self.__get_token_called)
 
@@ -339,20 +339,20 @@ class TestBoB(unittest.TestCase):
         self.assertEqual(bob.nocache, False)
         self.assertIsNone(bob._socket_cache)
 
-    def test_insert_creator(self):
+    def test_set_creator(self):
         """
-        Test the call to insert_creator. First time, the cache is created
+        Test the call to set_creator. First time, the cache is created
         with the passed creator. The next time, it throws an exception.
         """
         bob = BoB()
         # The cache doesn't use it at start, so just create an empty class
         class Creator: pass
         creator = Creator()
-        bob.insert_creator(creator)
+        bob.set_creator(creator)
         self.assertTrue(isinstance(bob._socket_cache,
                         isc.bind10.socket_cache.Cache))
         self.assertEqual(creator, bob._socket_cache._creator)
-        self.assertRaises(ValueError, bob.insert_creator, creator)
+        self.assertRaises(ValueError, bob.set_creator, creator)
 
     def test_init_alternate_socket(self):
         bob = BoB("alt_socket_file")
diff --git a/src/lib/python/isc/bind10/socket_cache.py b/src/lib/python/isc/bind10/socket_cache.py
index f58ea1c..7be19ce 100644
--- a/src/lib/python/isc/bind10/socket_cache.py
+++ b/src/lib/python/isc/bind10/socket_cache.py
@@ -102,10 +102,10 @@ class Cache:
         only once to receive the socket.
 
         The application is a token representing the application that requested
-        it. It is not clear now if that would be the PID of application, it's
-        address on message bus or filehandle of the unix domain socket used
-        to request it, but the same application handle should be used in case
-        the application crashes to call drop_application.
+        it. Currently, boss uses the file descriptor of connection from the
+        application, but anything which can be a key in a dict is OK from the
+        cache's point of view. You just need to use the same thing in
+        drop_application.
 
         In case the token is considered invalid (it doesn't come from the
         get_token, it was already used, the socket wasn't picked up soon
diff --git a/src/lib/python/isc/bind10/special_component.py b/src/lib/python/isc/bind10/special_component.py
index 7d35814..ebba333 100644
--- a/src/lib/python/isc/bind10/special_component.py
+++ b/src/lib/python/isc/bind10/special_component.py
@@ -42,7 +42,7 @@ class SockCreator(BaseComponent):
         self.__creator = isc.bind10.sockcreator.Creator(LIBEXECDIR + ':' +
                                                         os.environ['PATH'])
         self._boss.register_process(self.pid(), self)
-        self._boss.insert_creator(self.__creator)
+        self._boss.set_creator(self.__creator)
         self._boss.log_started(self.pid())
 
     def _stop_internal(self):




More information about the bind10-changes mailing list