BIND 10 trac2854, updated. befc536e55419f950791c6b32398ed6416d1abdd [2854] clarify some test scenario assumptions in comments

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Jun 24 05:56:53 UTC 2013


The branch, trac2854 has been updated
       via  befc536e55419f950791c6b32398ed6416d1abdd (commit)
       via  dd35de3a43c6aec1cb67135da6195e8eabf028e8 (commit)
       via  0af5b54f1c40328d94b053bbac09811bbdf3b116 (commit)
       via  1e82366eb6afcaf56fefd13f3158487f02935e13 (commit)
       via  7341eefceabf675af89a4514b89f0a45ba4a711d (commit)
       via  29827fea890f2657705256b70bd38e6295d37588 (commit)
       via  ee27d69e45c9632a482d610b28268f22af85ab5f (commit)
       via  de12157bbf027dd4bdf90201a4699c1a7287a819 (commit)
       via  3b778c9a251f470985f330efa1a314869f5cca1d (commit)
       via  edf1ae8f84a9bd9ff5725c80c9f61872c8658fc3 (commit)
      from  efe8fae1cf4f3a272c8da437113f1c7b90c9607a (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 befc536e55419f950791c6b32398ed6416d1abdd
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 14:53:03 2013 +0900

    [2854] clarify some test scenario assumptions in comments

commit dd35de3a43c6aec1cb67135da6195e8eabf028e8
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 13:45:22 2013 +0900

    [2854] use @unittest.skipIf to skip shmem specific tests conditionally.

commit 0af5b54f1c40328d94b053bbac09811bbdf3b116
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 13:34:13 2013 +0900

    [2854] replaced expressions using xor with minux.
    
    for some readers the latter seems to be more understandable

commit 1e82366eb6afcaf56fefd13f3158487f02935e13
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 13:22:48 2013 +0900

    [2854] cleanup: removed unnecessary reraise of exceptions

commit 7341eefceabf675af89a4514b89f0a45ba4a711d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 13:19:45 2013 +0900

    [2854] updated a log message description so it makes more sense.

commit 29827fea890f2657705256b70bd38e6295d37588
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 13:09:17 2013 +0900

    [2854] cleanup: removed a commented-out line

commit ee27d69e45c9632a482d610b28268f22af85ab5f
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 11:16:33 2013 +0900

    [2854] wording update for man page, per review comments.

commit de12157bbf027dd4bdf90201a4699c1a7287a819
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 11:14:17 2013 +0900

    [2854] corrected man page yearstamp

commit 3b778c9a251f470985f330efa1a314869f5cca1d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 11:11:40 2013 +0900

    [2854] untabify

commit edf1ae8f84a9bd9ff5725c80c9f61872c8658fc3
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jun 24 11:08:03 2013 +0900

    [2854] use revised interface of DataSrcClientsMgr.reconfigure() for tests.

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

Summary of changes:
 configure.ac                                       |    4 +--
 src/bin/memmgr/b10-memmgr.xml                      |    4 +--
 src/bin/memmgr/memmgr.py.in                        |    1 -
 src/bin/memmgr/memmgr_messages.mes                 |   12 ++++---
 src/bin/memmgr/tests/memmgr_test.py                |    5 ++-
 src/lib/python/isc/memmgr/datasrc_info.py          |    4 +--
 .../python/isc/memmgr/tests/datasrc_info_tests.py  |   34 ++++++++++++--------
 .../isc/server_common/tests/bind10_server_test.py  |    3 +-
 8 files changed, 38 insertions(+), 29 deletions(-)

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 285d09e..8c01aa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1192,8 +1192,8 @@ AC_CONFIG_FILES([Makefile
                  src/bin/loadzone/Makefile
                  src/bin/loadzone/tests/Makefile
                  src/bin/loadzone/tests/correct/Makefile
-		 src/bin/memmgr/Makefile
-		 src/bin/memmgr/tests/Makefile
+                 src/bin/memmgr/Makefile
+                 src/bin/memmgr/tests/Makefile
                  src/bin/msgq/Makefile
                  src/bin/msgq/tests/Makefile
                  src/bin/auth/Makefile
diff --git a/src/bin/memmgr/b10-memmgr.xml b/src/bin/memmgr/b10-memmgr.xml
index 5813e832..ee7fee2 100644
--- a/src/bin/memmgr/b10-memmgr.xml
+++ b/src/bin/memmgr/b10-memmgr.xml
@@ -20,7 +20,7 @@
 <refentry>
 
   <refentryinfo>
-    <date>June 11, 2012</date>
+    <date>June 11, 2013</date>
   </refentryinfo>
 
   <refmeta>
@@ -49,7 +49,7 @@
 
   <refsect1>
     <title>DESCRIPTION</title>
-    <para>The <command>b10-memmgr</command> daemon manages sharable
+    <para>The <command>b10-memmgr</command> daemon manages shared
       memory segments storing in-memory DNS zone data, and
       communicates with other BIND 10 modules about the segment
       information so the entire system will use these segments
diff --git a/src/bin/memmgr/memmgr.py.in b/src/bin/memmgr/memmgr.py.in
index e011b71..6f3d0c6 100755
--- a/src/bin/memmgr/memmgr.py.in
+++ b/src/bin/memmgr/memmgr.py.in
@@ -22,7 +22,6 @@ import signal
 
 sys.path.append('@@PYTHONPATH@@')
 import isc.log
-#from isc.log import DBGLVL_TRACE_BASIC
 from isc.config import ModuleSpecError, ModuleCCSessionError
 from isc.log_messages.memmgr_messages import *
 from isc.server_common.bind10_server import BIND10Server, BIND10ServerFatal
diff --git a/src/bin/memmgr/memmgr_messages.mes b/src/bin/memmgr/memmgr_messages.mes
index 721ce04..6ca5c0f 100644
--- a/src/bin/memmgr/memmgr_messages.mes
+++ b/src/bin/memmgr/memmgr_messages.mes
@@ -42,8 +42,10 @@ and has successfully applied it to the local state.  Loading of new zone
 data into memory will possibly take place.
 
 % MEMMGR_NO_DATASRC_CONF failed to add data source configuration: %1
-The memmgr daemon tried to incorporate data source configuration
-on its startup but failed to do so.  The most likely cause of this
-is that data sources are not simply configured.  If so, they must be.
-The memmgr daemon cannot do any meaningful work without data sources,
-so it immediately terminates itself.
+The memmgr daemon tried to incorporate data source configuration on
+its startup but failed to do so.  Due to internal implementation
+details this shouldn't happen as long as the BIND 10 system has been
+installed correctly.  So, if this error message is logged, you should
+probably reinstall the entire system, preferably from the scratch, and
+see if it still happens.  The memmgr daemon cannot do any meaningful
+work without data sources, so it immediately terminates itself.
diff --git a/src/bin/memmgr/tests/memmgr_test.py b/src/bin/memmgr/tests/memmgr_test.py
index 9f5ef9a..0fec7e3 100755
--- a/src/bin/memmgr/tests/memmgr_test.py
+++ b/src/bin/memmgr/tests/memmgr_test.py
@@ -47,8 +47,6 @@ class MockMemmgr(memmgr.Memmgr):
         isc.config.ModuleCCSession = MyCCSession
         try:
             super()._setup_ccsession()
-        except Exception:
-            raise
         finally:
             isc.config.ModuleCCSession = orig_cls
 
@@ -148,7 +146,8 @@ class TestMemmgr(unittest.TestCase):
                            self.__mgr._datasrc_config_handler)],
                          self.__mgr.mod_ccsession.add_remote_params)
 
-        # If data source isn't configured it's considered fatal.
+        # If data source isn't configured it's considered fatal (checking the
+        # same scenario with two possible exception types)
         self.__mgr.mod_ccsession.add_remote_exception = \
             isc.config.ModuleCCSessionError('faked exception')
         self.assertRaises(isc.server_common.bind10_server.BIND10ServerFatal,
diff --git a/src/lib/python/isc/memmgr/datasrc_info.py b/src/lib/python/isc/memmgr/datasrc_info.py
index ecb7fce..00e03d8 100644
--- a/src/lib/python/isc/memmgr/datasrc_info.py
+++ b/src/lib/python/isc/memmgr/datasrc_info.py
@@ -146,12 +146,12 @@ class MappedSegmentInfo(SegmentInfo):
 
     def switch_versions(self):
         # Swith the versions as noted in the constructor.
-        self.__writer_ver ^= 1
+        self.__writer_ver = 1 - self.__writer_ver
 
         if self.__reader_ver is None:
             self.__reader_ver = 0
         else:
-            self.__reader_ver ^= 1
+            self.__reader_ver = 1 - self.__reader_ver
 
         # Versions should be different
         assert(self.__reader_ver != self.__writer_ver)
diff --git a/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py b/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
index ba1322c..cc44863 100644
--- a/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
+++ b/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
@@ -24,6 +24,15 @@ import isc.log
 from isc.server_common.datasrc_clients_mgr import DataSrcClientsMgr
 from isc.memmgr.datasrc_info import *
 
+# Defined for easier tests with DataSrcClientsMgr.reconfigure(), which
+# only needs get_value() method
+class MockConfigData:
+    def __init__(self, data):
+        self.__data = data
+
+    def get_value(self, identifier):
+        return self.__data[identifier], False
+
 class TestSegmentInfo(unittest.TestCase):
     def setUp(self):
         self.__mapped_file_dir = os.environ['TESTDATA_PATH']
@@ -148,6 +157,10 @@ class TestDataSrcInfo(unittest.TestCase):
         self.assertEqual(42, datasrc_info.gen_id)
         self.assertEqual(0, len(datasrc_info.segment_info_map))
 
+    # This test uses real "mmaped" segment and doesn't work without shared
+    # memory support.
+    @unittest.skipIf(os.environ['HAVE_SHARED_MEMORY'] != 'yes',
+                     'shared memory support is not available')
     def test_production(self):
         """Check the behavior closer to a production environment.
 
@@ -155,20 +168,15 @@ class TestDataSrcInfo(unittest.TestCase):
         something.
 
         """
-        # This test uses real "mmaped" segment and doesn't work without
-        # shared memory support
-        if os.environ['HAVE_SHARED_MEMORY'] != 'yes':
-            return
-
-        datasrc_config = {
-            "classes": {
-                "IN": [{"type": "sqlite3", "cache-enable": True,
-                        "cache-type": "mapped", "cache-zones": [],
-                        "params": {"database_file": self.__sqlite3_dbfile}}]
-                }
-            }
+        cfg_data = MockConfigData(
+            {"classes":
+                 {"IN": [{"type": "sqlite3", "cache-enable": True,
+                          "cache-type": "mapped", "cache-zones": [],
+                          "params": {"database_file": self.__sqlite3_dbfile}}]
+                  }
+             })
         cmgr = DataSrcClientsMgr(use_cache=True)
-        cmgr.reconfigure(datasrc_config)
+        cmgr.reconfigure({}, cfg_data)
 
         genid, clients_map = cmgr.get_clients_map()
         datasrc_info = DataSrcInfo(genid, clients_map, self.__mgr_config)
diff --git a/src/lib/python/isc/server_common/tests/bind10_server_test.py b/src/lib/python/isc/server_common/tests/bind10_server_test.py
index e20d59f..a447269 100755
--- a/src/lib/python/isc/server_common/tests/bind10_server_test.py
+++ b/src/lib/python/isc/server_common/tests/bind10_server_test.py
@@ -227,7 +227,8 @@ class TestBIND10Server(unittest.TestCase):
         # EINTR will be ignored and select() will be called again.
         self.assertEqual([([TEST_FILENO], [], []), ([TEST_FILENO], [], [])],
                           self.select_params)
-        # check_command() shouldn't have been called
+        # check_command() shouldn't have been called (select_wrapper returns
+        # empty lists by default).
         self.assertIsNone(self.__server.mod_ccsession.check_command_param)
         self.assertTrue(self.__server.mod_ccsession.stopped)
 



More information about the bind10-changes mailing list