Browse Source

[2108] Test when RRSIG doesn't match the type it is supposed to cover

Mukund Sivaraman 12 years ago
parent
commit
723fcfb3c1

+ 9 - 1
src/lib/datasrc/memory/tests/memory_client_unittest.cc

@@ -144,6 +144,14 @@ TEST_F(MemoryClientTest, loadRRSIGNameUnmatched) {
     // Teardown checks for memory segment leaks
 }
 
+TEST_F(MemoryClientTest, loadRRSIGTypeUnmatched) {
+    EXPECT_THROW(client_->load(Name("example.org"),
+                               TEST_DATA_DIR
+                               "/example.org-rrsig-type-unmatched.zone"),
+                 InMemoryClient::AddError);
+    // Teardown checks for memory segment leaks
+}
+
 TEST_F(MemoryClientTest, getZoneCount) {
     EXPECT_EQ(0, client_->getZoneCount());
     client_->load(Name("example.org"), TEST_DATA_DIR "/example.org-empty.zone");
@@ -237,5 +245,5 @@ TEST_F(MemoryClientTest, getJournalReaderNotImplemented) {
 
 // TODO:
 // Add test for add() with separate_rrs=true
-
+// Add test for ZoneIterator variant of load()
 }

+ 1 - 0
src/lib/datasrc/memory/tests/testdata/Makefile.am

@@ -6,3 +6,4 @@ EXTRA_DIST += example.org-broken1.zone
 EXTRA_DIST += example.org-broken2.zone
 EXTRA_DIST += example.org-rrsig-follows-nothing.zone
 EXTRA_DIST += example.org-rrsig-name-unmatched.zone
+EXTRA_DIST += example.org-rrsig-type-unmatched.zone

+ 6 - 0
src/lib/datasrc/memory/tests/testdata/example.org-rrsig-type-unmatched.zone

@@ -0,0 +1,6 @@
+;; 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. 72 3600 300 3600000 3600
+ns1.example.org.		      3600 IN AAAA	2001:db8::1
+ns1.example.org.		      3600 IN RRSIG	A 7 3 3600 20150420235959 20051021000000 40430 example.org. FAKEFAKE