BIND 10 trac1643, updated. 766508d03d1304dc4d66b814a7a21d160b3404c2 [1643] Test name mismatch

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Feb 23 13:42:06 UTC 2012


The branch, trac1643 has been updated
       via  766508d03d1304dc4d66b814a7a21d160b3404c2 (commit)
       via  a4789bb27d209a54652bc2d7c6bf0992613c18df (commit)
      from  920106980b5a66212397f5f699f2aac9e6d69cbc (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 766508d03d1304dc4d66b814a7a21d160b3404c2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Feb 23 14:41:41 2012 +0100

    [1643] Test name mismatch

commit a4789bb27d209a54652bc2d7c6bf0992613c18df
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Feb 23 13:49:23 2012 +0100

    [1643] Error checking

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

Summary of changes:
 src/lib/python/isc/config/ccsession.py            |   17 +++++++++++++----
 src/lib/python/isc/config/tests/ccsession_test.py |   11 +++++++++--
 2 files changed, 22 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/config/ccsession.py b/src/lib/python/isc/config/ccsession.py
index ea2c817..703d196 100644
--- a/src/lib/python/isc/config/ccsession.py
+++ b/src/lib/python/isc/config/ccsession.py
@@ -340,7 +340,7 @@ class ModuleCCSession(ConfigData):
         seq = self._session.group_sendmsg(create_command(COMMAND_GET_CONFIG, { "module_name": module_name }), "ConfigManager")
 
         try:
-            answer, env = self._session.group_recvmsg(False, seq)
+            answer, _ = self._session.group_recvmsg(False, seq)
         except isc.cc.SessionTimeout:
             raise ModuleCCSessionError("No answer from ConfigManager when "
                                        "asking about Remote module " +
@@ -349,9 +349,18 @@ class ModuleCCSession(ConfigData):
         if answer:
             rcode, value = parse_answer(answer)
             if rcode == 0:
-                if value != None and module_spec.validate_config(False, value):
-                    module_cfg.set_local_config(value)
-                    call_callback = True
+                if value != None:
+                    if module_spec.validate_config(False, value):
+                        module_cfg.set_local_config(value)
+                        call_callback = True
+                    else:
+                        raise ModuleCCSessionError("Bad config data for " +
+                                                   module_name + ": " +
+                                                   str(value))
+            else:
+                raise ModuleCCSessionError("Failure requesting remote " +
+                                           "configuration data for " +
+                                           module_name)
 
         # all done, add it
         self._remote_module_configs[module_name] = module_cfg
diff --git a/src/lib/python/isc/config/tests/ccsession_test.py b/src/lib/python/isc/config/tests/ccsession_test.py
index 0692f8b..2380446 100644
--- a/src/lib/python/isc/config/tests/ccsession_test.py
+++ b/src/lib/python/isc/config/tests/ccsession_test.py
@@ -614,8 +614,8 @@ class TestModuleCCSession(unittest.TestCase):
         fake_session = FakeModuleCCSession()
         mccs = self.create_session("spec1.spec", None, None, fake_session)
         function = function_lambda(mccs)
-        # override the default config value for "item1".  add_remote_config()
-        # should incorporate the overridden value, and we should be abel to
+        # override the default config value for "item1". add_remote_config[_by_name]()
+        # should incorporate the overridden value, and we should be able to
         # get it via get_remote_config_value().
         fill_other_messages(fake_session)
         fake_session.group_sendmsg({'result': [0, {"item1": 10}]}, 'Spec2')
@@ -775,6 +775,13 @@ class TestModuleCCSession(unittest.TestCase):
         self._common_remote_module_by_name_test(
             self._internal_check_command_without_recvmsg_remote_module2)
 
+    def test_module_name_mismatch(self):
+        fake_session = FakeModuleCCSession()
+        mccs = self.create_session("spec1.spec", None, None, fake_session)
+        mccs.set_config_handler(self.my_config_handler_ok)
+        self._prepare_spec_message(fake_session, 'spec1.spec')
+        self.assertRaises(isc.config.ModuleCCSessionError,
+                          mccs.add_remote_config_by_name, "Spec2")
 
     def test_logconfig_handler(self):
         # test whether default_logconfig_handler reacts nicely to



More information about the bind10-changes mailing list