BIND 10 trac2823, updated. 7ccddd64de7f7928d20f7eff23053b64c644349d [2823] updated test_init_hterr so it also checks close_mccs is called.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon May 6 23:25:31 UTC 2013


The branch, trac2823 has been updated
       via  7ccddd64de7f7928d20f7eff23053b64c644349d (commit)
      from  5bdee1a5056c8e3517d2dd3de954d40323027ee1 (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 7ccddd64de7f7928d20f7eff23053b64c644349d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon May 6 16:22:21 2013 -0700

    [2823] updated test_init_hterr so it also checks close_mccs is called.

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

Summary of changes:
 src/bin/stats/tests/stats-httpd_test.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/bin/stats/tests/stats-httpd_test.py b/src/bin/stats/tests/stats-httpd_test.py
index bf33895..37ea7e3 100644
--- a/src/bin/stats/tests/stats-httpd_test.py
+++ b/src/bin/stats/tests/stats-httpd_test.py
@@ -642,10 +642,24 @@ class TestStatsHttpd(unittest.TestCase):
                              get_module_spec().get_module_name())
 
     def test_init_hterr(self):
+        """Test the behavior of StatsHttpd constructor when open_httpd fails.
+
+        We specifically check the following two:
+        - close_mccs() is called (so stats-httpd tells ConfigMgr it's shutting
+          down)
+        - the constructor results in HttpServerError exception.
+
+        """
+        self.__mccs_closed = False
+        def __call_checker():
+            self.__mccs_closed = True
         class FailingStatsHttpd(MyStatsHttpd):
             def open_httpd(self):
                 raise stats_httpd.HttpServerError
+            def close_mccs(self):
+                __call_checker()
         self.assertRaises(stats_httpd.HttpServerError, FailingStatsHttpd)
+        self.assertTrue(self.__mccs_closed)
 
     def test_openclose_mccs(self):
         self.stats_httpd = MyStatsHttpd(get_availaddr())



More information about the bind10-changes mailing list