BIND 10 trac2225_xfrout, updated. 8bfa9b46bfef0f5282507ea0583897a7fd7ecd4a [2225_xfrout] remove an empty unittest

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Feb 6 13:02:02 UTC 2013


The branch, trac2225_xfrout has been updated
       via  8bfa9b46bfef0f5282507ea0583897a7fd7ecd4a (commit)
       via  6ed2eb91030b9935e97cd0fbdb6451adae34d65e (commit)
       via  67b451a114650c1e4ccfc903a124c797fa6dc6fe (commit)
       via  35c6e4a1b11669d7f82c5c4899e5ce0bc1be9ff0 (commit)
      from  e166275662c30de9f940643dace9f7844568b595 (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 8bfa9b46bfef0f5282507ea0583897a7fd7ecd4a
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 6 21:10:54 2013 +0900

    [2225_xfrout] remove an empty unittest

commit 6ed2eb91030b9935e97cd0fbdb6451adae34d65e
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 6 21:01:07 2013 +0900

    [2225_xfrout] counting closed unixdomain sockets doesn't need to be inside the try block

commit 67b451a114650c1e4ccfc903a124c797fa6dc6fe
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 6 20:56:30 2013 +0900

    [2225_xfrout] raise again an exception after incrementing the counter
    
    It should raises again an exception after incrementing the counter if it's
    raised while initializing ThreadingUnixStreamServer.

commit 35c6e4a1b11669d7f82c5c4899e5ce0bc1be9ff0
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Wed Feb 6 15:10:06 2013 +0900

    [2225_xfrout] setting SPECFILE_LOCATION is more simplified

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

Summary of changes:
 src/bin/xfrin/xfrin.py.in              |   14 ++++++--------
 src/bin/xfrout/tests/xfrout_test.py.in |   11 ++++++-----
 src/bin/xfrout/xfrout.py.in            |    5 +++--
 3 files changed, 15 insertions(+), 15 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in
index 10dc249..d70f3f1 100755
--- a/src/bin/xfrin/xfrin.py.in
+++ b/src/bin/xfrin/xfrin.py.in
@@ -57,16 +57,14 @@ isc.util.process.rename()
 # If B10_FROM_BUILD or B10_FROM_SOURCE is set in the environment, we
 # use data files from a directory relative to that, otherwise we use
 # the ones installed on the system
-PREFIX = "@prefix@"
-DATAROOTDIR = "@datarootdir@"
-if "B10_FROM_BUILD" in os.environ:
-    AUTH_SPECFILE_PATH = os.environ["B10_FROM_BUILD"] + "/src/bin/auth"
-else:
-    AUTH_SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
+SPECFILE_PATH = "@datadir@/@PACKAGE@"\
+    .replace("${datarootdir}", "@datarootdir@")\
+    .replace("${prefix}", "@prefix@")
+AUTH_SPECFILE_PATH = SPECFILE_PATH
 if "B10_FROM_SOURCE" in os.environ:
     SPECFILE_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/xfrin"
-else:
-    SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
+if "B10_FROM_BUILD" in os.environ:
+    AUTH_SPECFILE_PATH = os.environ["B10_FROM_BUILD"] + "/src/bin/auth"
 SPECFILE_LOCATION = SPECFILE_PATH + "/xfrin.spec"
 AUTH_SPECFILE_LOCATION = AUTH_SPECFILE_PATH + "/auth.spec"
 
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index 1f264e3..b90f419 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -1588,7 +1588,12 @@ class TestUnixSockServerForCounter(unittest.TestCase):
                           self.unix._counters.get,
                           'socket', 'unixdomain', 'openfail')
         xfrout.ThreadingUnixStreamServer = DummySocketserverException
-        self.unix = UnixSockServer(None, None, None, None, None)
+        try:
+            self.unix = UnixSockServer(None, None, None, None, None)
+        except Exception:
+            pass
+        else:
+            self.fail("an exception should be raised")
         self.assertEqual(
             self.unix._counters.get('socket', 'unixdomain', 'open'), 1)
         self.assertEqual(
@@ -1630,10 +1635,6 @@ class TestUnixSockServerForCounter(unittest.TestCase):
         self.assertEqual(
             self.unix._counters.get('socket', 'unixdomain', 'acceptfail'), 1)
 
-    def test_senderr(self):
-        # do inside of above TestXfroutSession
-        pass
-
     def test_recverr(self):
         # recverr
         self.assertRaises(isc.cc.data.DataNotFoundError,
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index cd4fc9a..a9b6e78 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -665,6 +665,7 @@ class UnixSockServer(socketserver_mixin.NoPollMixIn,
                                                    handle_class)
         except:
             self._counters.inc('socket', 'unixdomain', 'openfail')
+            raise
         else:
             self._counters.inc('socket', 'unixdomain', 'open')
         self._shutdown_event = shutdown_event
@@ -894,9 +895,9 @@ class UnixSockServer(socketserver_mixin.NoPollMixIn,
     def shutdown(self):
         self._write_sock.send(b"shutdown") #terminate the xfrout session thread
         super().shutdown() # call the shutdown() of class socketserver_mixin.NoPollMixIn
+        # count closed unixsockets
+        self._counters.inc('socket', 'unixdomain', 'close')
         try:
-            # count closed unixsockets
-            self._counters.inc('socket', 'unixdomain', 'close')
             os.unlink(self._sock_file)
         except Exception as e:
             logger.error(XFROUT_REMOVE_UNIX_SOCKET_FILE_ERROR, self._sock_file, str(e))



More information about the bind10-changes mailing list