]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2225_xfrout] raise again an exception after incrementing the counter
authorNaoki Kambe <kambe@jprs.co.jp>
Wed, 6 Feb 2013 11:56:30 +0000 (20:56 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Wed, 6 Feb 2013 11:56:30 +0000 (20:56 +0900)
It should raises again an exception after incrementing the counter if it's
raised while initializing ThreadingUnixStreamServer.

src/bin/xfrout/tests/xfrout_test.py.in
src/bin/xfrout/xfrout.py.in

index 1f264e36486783468e46e1baf31591cc992050c2..020f28c385cac0409d7c1c7c36ff8a1c1982ad5c 100644 (file)
@@ -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(
index cd4fc9aad176f3200813417f20236e86d61e9af6..a3737190cc6c859a264928368896a9c925b41edf 100755 (executable)
@@ -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