BIND 10 trac2108_3, updated. 5a70502ad2679d135e26db9f3eb0a523eefd83e6 [2108] Add tests for out of zone names

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Sep 10 01:15:04 UTC 2012


The branch, trac2108_3 has been updated
       via  5a70502ad2679d135e26db9f3eb0a523eefd83e6 (commit)
      from  0a9b4b2a90c9021bb875ace73a82b5507d92f08a (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 5a70502ad2679d135e26db9f3eb0a523eefd83e6
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Sep 10 06:44:25 2012 +0530

    [2108] Add tests for out of zone names

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

Summary of changes:
 .../datasrc/memory/tests/memory_client_unittest.cc |   23 ++++++++++++++++++++
 src/lib/datasrc/memory/tests/testdata/Makefile.am  |    1 +
 ...s-nothing.zone => example.org-out-of-zone.zone} |    4 ++--
 3 files changed, 26 insertions(+), 2 deletions(-)
 copy src/lib/datasrc/memory/tests/testdata/{example.org-rrsig-follows-nothing.zone => example.org-out-of-zone.zone} (56%)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
index fb9d339..18dacab 100644
--- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -281,6 +281,15 @@ TEST_F(MemoryClientTest, loadMultipleNSEC3PARAMThrows) {
     // Teardown checks for memory segment leaks
 }
 
+TEST_F(MemoryClientTest, loadOutOfZoneThrows) {
+    // Out of zone names should throw.
+    EXPECT_THROW(client_->load(Name("example.org"),
+                               TEST_DATA_DIR
+                               "/example.org-out-of-zone.zone"),
+                 MasterLoadError);
+    // Teardown checks for memory segment leaks
+}
+
 TEST_F(MemoryClientTest, loadRRSIGFollowsNothing) {
     EXPECT_THROW(client_->load(Name("example.org"),
                                TEST_DATA_DIR
@@ -389,6 +398,20 @@ TEST_F(MemoryClientTest, addRRsetToNonExistentZoneThrows) {
     EXPECT_THROW(client_->add(Name("example.org"), rrset_a), DataSourceError);
 }
 
+TEST_F(MemoryClientTest, addOutOfZoneThrows) {
+    // Out of zone names should throw.
+    client_->load(Name("example.org"),
+                  TEST_DATA_DIR "/example.org-empty.zone");
+
+    RRsetPtr rrset_a(new RRset(Name("a.example.com"),
+                               RRClass::IN(), RRType::A(), RRTTL(300)));
+    rrset_a->addRdata(rdata::in::A("192.0.2.1"));
+
+    EXPECT_THROW(client_->add(Name("example.org"), rrset_a),
+                 OutOfZone);
+    // Teardown checks for memory segment leaks
+}
+
 TEST_F(MemoryClientTest, addNullRRsetThrows) {
     client_->load(Name("example.org"),
                   TEST_DATA_DIR "/example.org-rrsigs.zone");
diff --git a/src/lib/datasrc/memory/tests/testdata/Makefile.am b/src/lib/datasrc/memory/tests/testdata/Makefile.am
index d523972..50d68b3 100644
--- a/src/lib/datasrc/memory/tests/testdata/Makefile.am
+++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am
@@ -17,3 +17,4 @@ EXTRA_DIST += example.org-multiple-nsec3.zone
 EXTRA_DIST += example.org-multiple-nsec3param.zone
 EXTRA_DIST += example.org-nsec3-signed.zone
 EXTRA_DIST += example.org-nsec3-signed-no-param.zone
+EXTRA_DIST += example.org-out-of-zone.zone
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-out-of-zone.zone b/src/lib/datasrc/memory/tests/testdata/example.org-out-of-zone.zone
new file mode 100644
index 0000000..e3afb74
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-out-of-zone.zone
@@ -0,0 +1,5 @@
+;; test zone file used for ZoneFinderContext tests.
+;; RRSIGs are (obviouslly) faked ones for testing.
+
+example.org. 3600 IN SOA	ns1.example.org. bugs.x.w.example.org. 75 3600 300 3600000 3600
+a.example.com.	  		      3600 IN A	 	192.168.0.1



More information about the bind10-changes mailing list