BIND 10 trac2835, updated. 97a7be5ddb8f5a89206912eae174bacf3d230a8e [2835] Test the uniqueness of names is enforced

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Mar 14 10:03:19 UTC 2013


The branch, trac2835 has been updated
       via  97a7be5ddb8f5a89206912eae174bacf3d230a8e (commit)
      from  f37600d5ae721b626b9e9323dbff17a404908e46 (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 97a7be5ddb8f5a89206912eae174bacf3d230a8e
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Mar 14 11:01:38 2013 +0100

    [2835] Test the uniqueness of names is enforced
    
    Which isn't at the moment, so it fails.

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

Summary of changes:
 src/bin/cfgmgr/plugins/tests/datasrc_test.py |   76 ++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/bin/cfgmgr/plugins/tests/datasrc_test.py b/src/bin/cfgmgr/plugins/tests/datasrc_test.py
index 83ec4ca..8de5f42 100644
--- a/src/bin/cfgmgr/plugins/tests/datasrc_test.py
+++ b/src/bin/cfgmgr/plugins/tests/datasrc_test.py
@@ -153,6 +153,82 @@ class DatasrcTest(unittest.TestCase):
             }
         }]})
 
+    def test_names_present(self):
+        """
+        Test we don't choke on configuration with the "name" being present on
+        some items.
+        """
+        self.accept({"IN": [{
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {},
+            "name": "Whatever"
+        }]})
+
+    def test_names_default_classes(self):
+        """
+        Test we can have a client of the same type in different classes
+        without specified name. The defaults should be derived both from
+        the type and the class.
+        """
+        self.accept({
+        "IN": [{
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {}
+        }],
+        "CH": [{
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {}
+        }]})
+
+    def test_names_collision(self):
+        """
+        Reject when two names are the same.
+
+        Cases are:
+        - Explicit names.
+        - Two default names turn out to be the same (same type and class).
+        - One explicit is set to the same as the default one.
+        """
+        self.reject({"IN": [
+        {
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {},
+            "name": "Whatever"
+        },
+        {
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {},
+            "name": "Whatever"
+        }]})
+        self.reject({"IN": [
+        {
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {}
+        },
+        {
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {}
+        }]})
+        self.reject({"IN": [
+        {
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {},
+            "name": "IN/MasterFiles"
+        },
+        {
+            "type": "MasterFiles",
+            "cache-enable": True,
+            "params": {}
+        }]})
+
 if __name__ == '__main__':
     isc.log.init("bind10")
     isc.log.resetUnitTestRootLogger()



More information about the bind10-changes mailing list