BIND 10 trac2108_3, updated. 26abb2819f66a4a247ce1ebf77831d3979c85018 [2108] result::EXIST is no longer returned by add()

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 7 04:46:03 UTC 2012


The branch, trac2108_3 has been updated
       via  26abb2819f66a4a247ce1ebf77831d3979c85018 (commit)
       via  b9c899265d584b9399afc061e431c9a35af276b6 (commit)
      from  d4026adcbe1cf9c969b2cff4064b2ebc5ff85b54 (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 26abb2819f66a4a247ce1ebf77831d3979c85018
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri Sep 7 10:15:22 2012 +0530

    [2108] result::EXIST is no longer returned by add()

commit b9c899265d584b9399afc061e431c9a35af276b6
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri Sep 7 10:14:35 2012 +0530

    [2108] Add tests for duplicate types in load()

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

Summary of changes:
 src/lib/datasrc/memory/memory_client.cc            |    5 -----
 .../datasrc/memory/tests/memory_client_unittest.cc |   13 +++++++++++++
 src/lib/datasrc/memory/tests/testdata/Makefile.am  |    2 ++
 .../testdata/example.org-duplicate-type-bad.zone   |    4 ++++
 .../tests/testdata/example.org-duplicate-type.zone |    4 ++++
 5 files changed, 23 insertions(+), 5 deletions(-)
 create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type-bad.zone
 create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type.zone

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/memory_client.cc b/src/lib/datasrc/memory/memory_client.cc
index bbaa40e..fb2a8e2 100644
--- a/src/lib/datasrc/memory/memory_client.cc
+++ b/src/lib/datasrc/memory/memory_client.cc
@@ -528,11 +528,6 @@ public:
                      const Name& zone_name, ZoneData* zone_data)
     {
         switch (add(set, zone_name, *zone_data)) {
-        case result::EXIST:
-            LOG_ERROR(logger, DATASRC_MEM_DUP_RRSET).
-                arg(set->getName()).arg(set->getType());
-            isc_throw(dns::MasterLoadError, "Duplicate rrset: " <<
-                      set->toText());
         case result::SUCCESS:
             return;
         default:
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
index 81e054a..b0b2371 100644
--- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -221,6 +221,19 @@ TEST_F(MemoryClientTest, loadReloadZone) {
     // Teardown checks for memory segment leaks
 }
 
+TEST_F(MemoryClientTest, loadDuplicateType) {
+    // This should not result in any exceptions:
+    client_->load(Name("example.org"),
+                  TEST_DATA_DIR "/example.org-duplicate-type.zone");
+
+    // This should throw:
+    EXPECT_THROW(client_->load(Name("example.org"),
+                               TEST_DATA_DIR
+                               "/example.org-duplicate-type-bad.zone"),
+                 InMemoryClient::AddError);
+    // Teardown checks for memory segment leaks
+}
+
 TEST_F(MemoryClientTest, loadRRSIGFollowsNothing) {
     EXPECT_THROW(client_->load(Name("example.org"),
                                TEST_DATA_DIR
diff --git a/src/lib/datasrc/memory/tests/testdata/Makefile.am b/src/lib/datasrc/memory/tests/testdata/Makefile.am
index 4ef70a5..a8a0ddf 100644
--- a/src/lib/datasrc/memory/tests/testdata/Makefile.am
+++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am
@@ -9,3 +9,5 @@ EXTRA_DIST += example.org-rrsig-follows-nothing.zone
 EXTRA_DIST += example.org-rrsig-name-unmatched.zone
 EXTRA_DIST += example.org-rrsig-type-unmatched.zone
 EXTRA_DIST += example.org-rrsigs.zone
+EXTRA_DIST += example.org-duplicate-type.zone
+EXTRA_DIST += example.org-duplicate-type-bad.zone
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type-bad.zone b/src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type-bad.zone
new file mode 100644
index 0000000..06c7dff
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type-bad.zone
@@ -0,0 +1,4 @@
+example.org. 3600 IN SOA	ns1.example.org. bugs.x.w.example.org. 77 3600 300 3600000 3600
+ns1.example.org.		      3600 IN A	 	192.168.0.1
+ns1.example.org.		      3600 IN AAAA 	::1
+ns1.example.org.		      3600 IN A	 	192.168.0.2
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type.zone b/src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type.zone
new file mode 100644
index 0000000..6e5c1b8
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-duplicate-type.zone
@@ -0,0 +1,4 @@
+example.org. 3600 IN SOA	ns1.example.org. bugs.x.w.example.org. 76 3600 300 3600000 3600
+ns1.example.org.		      3600 IN A	 	192.168.0.1
+ns1.example.org.		      3600 IN A	 	192.168.0.2
+ns1.example.org.		      3600 IN AAAA 	::1



More information about the bind10-changes mailing list