From: Naoki Kambe Date: Wed, 6 Feb 2013 11:56:30 +0000 (+0900) Subject: [2225_xfrout] raise again an exception after incrementing the counter X-Git-Tag: bind10-1.1.0beta1-release~72^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67b451a114650c1e4ccfc903a124c797fa6dc6fe;p=thirdparty%2Fkea.git [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. --- diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in index 1f264e3648..020f28c385 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( diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in index cd4fc9aad1..a3737190cc 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