From: Mukund Sivaraman Date: Thu, 6 Sep 2012 01:34:18 +0000 (+0530) Subject: [2108] Test when RRSIG doesn't follow its covered RRset X-Git-Tag: trac2351_base~70^2~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5efb671ff4bf5a570e00a626464eb7b97f9c8ae;p=thirdparty%2Fkea.git [2108] Test when RRSIG doesn't follow its covered RRset --- diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc index 74071fc74d..de93e2f2a8 100644 --- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc +++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc @@ -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"); diff --git a/src/lib/datasrc/memory/tests/testdata/Makefile.am b/src/lib/datasrc/memory/tests/testdata/Makefile.am index f2a26568fd..e0e4b3cb34 100644 --- a/src/lib/datasrc/memory/tests/testdata/Makefile.am +++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am @@ -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 index 0000000000..ef5f887916 --- /dev/null +++ b/src/lib/datasrc/memory/tests/testdata/example.org-rrsig-follows-nothing.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. 68 3600 300 3600000 3600 +ns1.example.org. 3600 IN RRSIG A 7 3 3600 20150420235959 20051021000000 40430 example.org. FAKEFAKE