]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2108] Test when RRSIG doesn't follow its covered RRset
authorMukund Sivaraman <muks@isc.org>
Thu, 6 Sep 2012 01:34:18 +0000 (07:04 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 6 Sep 2012 01:34:18 +0000 (07:04 +0530)
src/lib/datasrc/memory/tests/memory_client_unittest.cc
src/lib/datasrc/memory/tests/testdata/Makefile.am
src/lib/datasrc/memory/tests/testdata/example.org-rrsig-follows-nothing.zone [new file with mode: 0644]

index 74071fc74d0a2b0afb9835331e7870eac6cfe40e..de93e2f2a8a41aac52747808b856d5579738ec91 100644 (file)
@@ -128,6 +128,14 @@ TEST_F(MemoryClientTest, load) {
     client_->load(Name("example.org"), TEST_DATA_DIR "/example.org.zone");
 }
 
+TEST_F(MemoryClientTest, loadRRSIGFollowsNothing) {
+    EXPECT_THROW(client_->load(Name("example.org"),
+                               TEST_DATA_DIR
+                               "/example.org-rrsig-follows-nothing.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");
index f2a26568fd1f0f39fcfabf49727438387da2f95c..e0e4b3cb34a46978d756216a5037312169e56277 100644 (file)
@@ -4,3 +4,4 @@ EXTRA_DIST =  example.org.zone
 EXTRA_DIST += example.org-empty.zone
 EXTRA_DIST += example.org-broken1.zone
 EXTRA_DIST += example.org-broken2.zone
+EXTRA_DIST += example.org-rrsig-follows-nothing.zone
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-rrsig-follows-nothing.zone b/src/lib/datasrc/memory/tests/testdata/example.org-rrsig-follows-nothing.zone
new file mode 100644 (file)
index 0000000..ef5f887
--- /dev/null
@@ -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. 68 3600 300 3600000 3600
+ns1.example.org.                     3600 IN RRSIG     A 7 3 3600 20150420235959 20051021000000 40430 example.org. FAKEFAKE