BIND 10 trac1819, updated. a77e76fd1656202a76d3e7ec67dd4e1930aba0c9 bug #1819: Add some comments to testcases
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Mar 26 06:06:24 UTC 2012
The branch, trac1819 has been updated
via a77e76fd1656202a76d3e7ec67dd4e1930aba0c9 (commit)
via 6551207483e37994d742f4b75663ba8f71fe528e (commit)
from 32cd7d8e520bee62c7873a486bf8b1057e794db0 (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 a77e76fd1656202a76d3e7ec67dd4e1930aba0c9
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Mar 26 11:36:00 2012 +0530
bug #1819: Add some comments to testcases
commit 6551207483e37994d742f4b75663ba8f71fe528e
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Mar 26 11:32:57 2012 +0530
bug #1819: Check that BoB doesn't kill during shutdown when asked not to
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/tests/bind10_test.py.in | 53 ++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index cd3ff62..fa01d11 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -1204,7 +1204,60 @@ class TestBossComponents(unittest.TestCase):
bob.shutdown()
self.assertTrue(bob.ccs.stopped)
+
+ # Here, killed is an array where False is added if SIGTERM
+ # should be sent, or True if SIGKILL should be sent, in order in
+ # which they're sent.
self.assertEqual([False, True], killed)
+
+ self.assertTrue(self.__called)
+
+ bob._component_configurator.shutdown = orig
+
+ def test_nokill(self):
+ """
+ Test that the boss *doesn't* kill components which don't want to
+ stop, when asked not to (by passing the --no-kill option which
+ sets bob.nokill to True).
+ """
+ bob = MockBob()
+ bob.nokill = True
+
+ killed = []
+ class ImmortalComponent:
+ """
+ An immortal component. It does not stop when it is told so
+ (anyway it is not told so). It does not die if it is killed
+ the first time. It dies only when killed forcefully.
+ """
+ def kill(self, forceful=False):
+ killed.append(forceful)
+ if forceful:
+ bob.components = {}
+ def pid(self):
+ return 1
+ def name(self):
+ return "Immortal"
+ bob.components = {}
+ bob.register_process(1, ImmortalComponent())
+
+ # While at it, we check the configurator shutdown is actually called
+ orig = bob._component_configurator.shutdown
+ bob._component_configurator.shutdown = self.__nullary_hook
+ self.__called = False
+
+ bob.ccs = MockModuleCCSession()
+ self.assertFalse(bob.ccs.stopped)
+
+ bob.shutdown()
+
+ self.assertTrue(bob.ccs.stopped)
+
+ # Here, killed is an array where False is added if SIGTERM
+ # should be sent, or True if SIGKILL should be sent, in order in
+ # which they're sent.
+ self.assertEqual([], killed)
+
self.assertTrue(self.__called)
bob._component_configurator.shutdown = orig
More information about the bind10-changes
mailing list