BIND 10 trac3028, updated. 507da494700d05fe55a928ad57757a4af3d5f2cb [3028] Get rid of the print_settings command completely
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Aug 19 11:18:09 UTC 2013
The branch, trac3028 has been updated
via 507da494700d05fe55a928ad57757a4af3d5f2cb (commit)
from e15d409632ae5408531051b3164c2e2b851b214e (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 507da494700d05fe55a928ad57757a4af3d5f2cb
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Aug 19 13:16:45 2013 +0200
[3028] Get rid of the print_settings command completely
It was used in tests only. We may abuse the shutdown command for that.
-----------------------------------------------------------------------
Summary of changes:
src/bin/cmdctl/cmdctl.py.in | 4 ----
src/bin/cmdctl/tests/cmdctl_test.py | 18 ++++++++++++++----
2 files changed, 14 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/cmdctl/cmdctl.py.in b/src/bin/cmdctl/cmdctl.py.in
index 117db1b..ea56da9 100755
--- a/src/bin/cmdctl/cmdctl.py.in
+++ b/src/bin/cmdctl/cmdctl.py.in
@@ -370,10 +370,6 @@ class CommandControl():
self._httpserver.shutdown()
self._serving = False
- elif command == 'print_settings':
- # This is a hidden testing command. It does nothing useful, just
- # returns the current configuration.
- answer = ccsession.create_answer(0, self._cmdctl_config_data)
else:
answer = ccsession.create_answer(1, 'unknown command: ' + command)
diff --git a/src/bin/cmdctl/tests/cmdctl_test.py b/src/bin/cmdctl/tests/cmdctl_test.py
index dfd66ad..690df87 100644
--- a/src/bin/cmdctl/tests/cmdctl_test.py
+++ b/src/bin/cmdctl/tests/cmdctl_test.py
@@ -462,10 +462,20 @@ class TestCommandControl(unittest.TestCase):
answer = self.cmdctl.command_handler('unknown-command', None)
self._check_answer(answer, 1, 'unknown command: unknown-command')
- answer = self.cmdctl.command_handler('print_settings', None)
+ # Send a real command. Mock stuff so the shutdown command doesn't
+ # cause an exception.
+ class ModuleCC:
+ def send_stopping():
+ pass
+ self.cmdctl._module_cc = ModuleCC
+ class Server:
+ def shutdown():
+ pass
+ self.cmdctl._httpserver = Server
+ answer = self.cmdctl.command_handler('shutdown', None)
rcode, msg = ccsession.parse_answer(answer)
self.assertEqual(rcode, 0)
- self.assertTrue(msg != None)
+ self.assertIsNone(msg)
def test_command_handler_spec_update(self):
# Should not be present
@@ -543,10 +553,10 @@ class TestCommandControl(unittest.TestCase):
self.assertEqual(1, rcode)
# Send a command to cmdctl itself. Should be the same effect.
- rcode, value = self.cmdctl.send_command('Cmdctl', 'print_settings',
+ rcode, value = self.cmdctl.send_command('Cmdctl', 'shutdown',
None)
self.assertEqual(2, len(self.cmdctl.sent_messages))
- self.assertEqual(({'command': ['print_settings']}, 'Cmdctl'),
+ self.assertEqual(({'command': ['shutdown']}, 'Cmdctl'),
self.cmdctl.sent_messages[-1])
self.assertEqual(1, rcode)
More information about the bind10-changes
mailing list