BIND 10 trac1175, updated. d07924557750d327b2cfbe5762e83a6153e0f85e [1175] - The stats httpd doesn't need to return an argument when it's shutting down. - The testcase sends the 'status' command or the 'shutdown' command to the stats or the stats httpd when they started, and then their returned values are checked.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Sep 5 08:14:44 UTC 2011


The branch, trac1175 has been updated
       via  d07924557750d327b2cfbe5762e83a6153e0f85e (commit)
      from  31fff87f0e451bd542549fcbf8ef54111fb8db2d (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 d07924557750d327b2cfbe5762e83a6153e0f85e
Author: Naoki Kambe <kambe at jprs.co.jp>
Date:   Mon Sep 5 17:14:11 2011 +0900

    [1175]
     - The stats httpd doesn't need to return an argument when it's shutting down.
     - The testcase sends the 'status' command or the 'shutdown' command to the
       stats or the stats httpd when they started, and then their returned values
       are checked.

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

Summary of changes:
 src/bin/stats/stats_httpd.py.in             |    3 +--
 src/bin/stats/tests/b10-stats-httpd_test.py |    9 +++++----
 src/bin/stats/tests/b10-stats_test.py       |    4 +++-
 3 files changed, 9 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/stats/stats_httpd.py.in b/src/bin/stats/stats_httpd.py.in
index 58fadc6..22c2c4c 100644
--- a/src/bin/stats/stats_httpd.py.in
+++ b/src/bin/stats/stats_httpd.py.in
@@ -328,8 +328,7 @@ class StatsHttpd:
             logger.debug(DBG_STATHTTPD_MESSAGING,
                          STATHTTPD_RECEIVED_SHUTDOWN_COMMAND)
             self.running = False
-            return isc.config.ccsession.create_answer(
-                0, "Stats Httpd is shutting down.")
+            return isc.config.ccsession.create_answer(0)
         else:
             logger.debug(DBG_STATHTTPD_MESSAGING,
                          STATHTTPD_RECEIVED_UNKNOWN_COMMAND, command)
diff --git a/src/bin/stats/tests/b10-stats-httpd_test.py b/src/bin/stats/tests/b10-stats-httpd_test.py
index c76ab8a..526d5f2 100644
--- a/src/bin/stats/tests/b10-stats-httpd_test.py
+++ b/src/bin/stats/tests/b10-stats-httpd_test.py
@@ -37,7 +37,7 @@ import signal
 import isc
 import stats_httpd
 import stats
-from test_utils import BaseModules, ThreadingServerManager, MyStats, MyStatsHttpd, send_shutdown
+from test_utils import BaseModules, ThreadingServerManager, MyStats, MyStatsHttpd, send_command, send_shutdown
 
 DUMMY_DATA = {
     'Boss' : {
@@ -449,8 +449,10 @@ class TestStatsHttpd(unittest.TestCase):
         self.stats_httpd = self.stats_httpd_server.server
         self.assertFalse(self.stats_httpd.running)
         self.stats_httpd_server.run()
+        self.assertEqual(send_command("status", "StatsHttpd"),
+                         (0, "Stats Httpd is up. (PID " + str(os.getpid()) + ")"))
         self.assertTrue(self.stats_httpd.running)
-        send_shutdown("StatsHttpd")
+        self.assertEqual(send_shutdown("StatsHttpd"), (0, None))
         self.assertFalse(self.stats_httpd.running)
         self.stats_httpd_server.shutdown()
 
@@ -519,8 +521,7 @@ class TestStatsHttpd(unittest.TestCase):
                 0, "Stats Httpd is up. (PID " + str(os.getpid()) + ")"))
         self.stats_httpd.running = True
         self.assertEqual(self.stats_httpd.command_handler("shutdown", None),
-                         isc.config.ccsession.create_answer(
-                0, "Stats Httpd is shutting down."))
+                         isc.config.ccsession.create_answer(0))
         self.assertFalse(self.stats_httpd.running)
         self.assertEqual(
             self.stats_httpd.command_handler("__UNKNOWN_COMMAND__", None),
diff --git a/src/bin/stats/tests/b10-stats_test.py b/src/bin/stats/tests/b10-stats_test.py
index a52ce63..5982595 100644
--- a/src/bin/stats/tests/b10-stats_test.py
+++ b/src/bin/stats/tests/b10-stats_test.py
@@ -201,8 +201,10 @@ class TestStats(unittest.TestCase):
         self.stats = self.stats_server.server
         self.assertFalse(self.stats.running)
         self.stats_server.run()
+        self.assertEqual(send_command("status", "Stats"),
+                (0, "Stats is up. (PID " + str(os.getpid()) + ")"))
         self.assertTrue(self.stats.running)
-        send_shutdown("Stats")
+        self.assertEqual(send_shutdown("Stats"), (0, None))
         self.assertFalse(self.stats.running)
         self.stats_server.shutdown()
 




More information about the bind10-changes mailing list