BIND 10 trac2833, updated. ec52d37b4554e01d70afa67c64d203c445a9aac6 [2833] use example.com zone for tests using in-memory data source (cache)

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Apr 3 19:55:22 UTC 2013


The branch, trac2833 has been updated
       via  ec52d37b4554e01d70afa67c64d203c445a9aac6 (commit)
      from  ce1d57a6341ca867ce6624424043b13cfa3d5f39 (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 ec52d37b4554e01d70afa67c64d203c445a9aac6
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Apr 3 12:54:24 2013 -0700

    [2833] use example.com zone for tests using in-memory data source (cache)
    
    instead of the "static" BIND zone.  there's no difference between these two
    any more, so this is just a matter of style.

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

Summary of changes:
 src/lib/python/isc/datasrc/tests/datasrc_test.py   |   26 ++++++++------------
 .../python/isc/datasrc/tests/zone_loader_test.py   |   21 ++++++----------
 2 files changed, 18 insertions(+), 29 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/datasrc/tests/datasrc_test.py b/src/lib/python/isc/datasrc/tests/datasrc_test.py
index 81c732f..1649fc1 100644
--- a/src/lib/python/isc/datasrc/tests/datasrc_test.py
+++ b/src/lib/python/isc/datasrc/tests/datasrc_test.py
@@ -33,11 +33,11 @@ WRITE_ZONE_DB_FILE = TESTDATA_WRITE_PATH + "rwtest.sqlite3.copied"
 
 READ_ZONE_DB_CONFIG = "{ \"database_file\": \"" + READ_ZONE_DB_FILE + "\" }"
 WRITE_ZONE_DB_CONFIG = "{ \"database_file\": \"" + WRITE_ZONE_DB_FILE + "\"}"
-# Static zone must be built from client list.
-STATIC_ZONE_CONFIG = '''[{
+# In-memory data source must be built via client list.
+INMEMORY_ZONE_CONFIG = '''[{
    "type": "MasterFiles",
    "cache-enable": true,
-   "params": {"BIND": "''' + TESTDATA_PATH + 'static.zone"}}]'
+   "params": {"example.com": "''' + TESTDATA_PATH + 'example.com"}}]'
 
 def add_rrset(rrset_list, name, rrclass, rrtype, ttl, rdatas):
     rrset_to_add = isc.dns.RRset(name, rrclass, rrtype, ttl)
@@ -566,13 +566,10 @@ class DataSrcUpdater(unittest.TestCase):
         self.assertEqual(updater_refs, sys.getrefcount(updater))
 
     def test_two_modules(self):
-        # load two modules, and check if they don't interfere; as the
-        # memory datasource module no longer exists, we check the static
-        # datasource instead (as that uses the memory datasource
-        # anyway).
-        clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.CH)
-        clist.configure(STATIC_ZONE_CONFIG, True)
-        dsc_static = clist.find(isc.dns.Name("bind"), True, False)[0]
+        # load two modules, and check if they don't interfere.
+        clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.IN)
+        clist.configure(INMEMORY_ZONE_CONFIG, True)
+        dsc_static = clist.find(isc.dns.Name("example.com"), True, False)[0]
         dsc_sql = isc.datasrc.DataSourceClient("sqlite3", READ_ZONE_DB_CONFIG)
 
         # check if exceptions are working
@@ -729,12 +726,9 @@ class DataSrcUpdater(unittest.TestCase):
         self.assertTrue(dsc.delete_zone(zone_name))
 
     def test_create_zone_not_implemented(self):
-        # As the memory datasource module no longer exists, we check the
-        # static datasource instead (as that uses the memory datasource
-        # anyway).
-        clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.CH)
-        clist.configure(STATIC_ZONE_CONFIG, True)
-        dsc = clist.find(isc.dns.Name("bind"), True, False)[0]
+        clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.IN)
+        clist.configure(INMEMORY_ZONE_CONFIG, True)
+        dsc = clist.find(isc.dns.Name("example.com"), True, False)[0]
         self.assertRaises(isc.datasrc.NotImplemented, dsc.create_zone,
                           isc.dns.Name("example.com"))
 
diff --git a/src/lib/python/isc/datasrc/tests/zone_loader_test.py b/src/lib/python/isc/datasrc/tests/zone_loader_test.py
index 7917671..4811aba 100644
--- a/src/lib/python/isc/datasrc/tests/zone_loader_test.py
+++ b/src/lib/python/isc/datasrc/tests/zone_loader_test.py
@@ -34,11 +34,11 @@ ORIG_DB_FILE = TESTDATA_PATH + '/example.com.sqlite3'
 DB_FILE = TESTDATA_WRITE_PATH + '/zoneloadertest.sqlite3'
 DB_CLIENT_CONFIG = '{ "database_file": "' + DB_FILE + '" }'
 DB_SOURCE_CLIENT_CONFIG = '{ "database_file": "' + SOURCE_DB_FILE + '" }'
-# Static zone must be built from client list.
-STATIC_ZONE_CONFIG = '''[{
+# In-memory data source must be built via client list.
+INMEMORY_ZONE_CONFIG = '''[{
    "type": "MasterFiles",
    "cache-enable": true,
-   "params": {"BIND": "''' + TESTDATA_PATH + '/static.zone"}}]'
+   "params": {"example.com": "''' + TESTDATA_PATH + '/example.com"}}]'
 
 ORIG_SOA_TXT = 'example.com. 3600 IN SOA master.example.com. ' +\
                'admin.example.com. 1234 3600 1800 2419200 7200\n'
@@ -220,16 +220,11 @@ class ZoneLoaderTests(unittest.TestCase):
                           self.client, zone_name, self.source_client)
 
     def test_no_ds_load_support(self):
-        # As the memory datasource module no longer exists, we check the
-        # static datasource instead (as that uses the memory datasource
-        # anyway).
-        #
-        # This may change in the future, but ATM, the static ds does not
-        # support the API the zone loader uses (it has direct load
-        # calls).
-        clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.CH)
-        clist.configure(STATIC_ZONE_CONFIG, True)
-        inmem_client = clist.find(isc.dns.Name("bind"), True, False)[0]
+        # This may change in the future, but ATM, in-memory ds does not
+        # support the API the zone loader uses.
+        clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.IN)
+        clist.configure(INMEMORY_ZONE_CONFIG, True)
+        inmem_client = clist.find(isc.dns.Name("example.com"), True, False)[0]
         self.assertRaises(isc.datasrc.NotImplemented,
                           isc.datasrc.ZoneLoader,
                           inmem_client, self.test_name, self.test_file)



More information about the bind10-changes mailing list