From: Mukund Sivaraman Date: Mon, 10 Sep 2012 01:32:58 +0000 (+0530) Subject: [2108] Check that loading a zone with wildcard DNAME names throws an exception X-Git-Tag: trac2351_base~70^2~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15bdb89898addbb7149479a083af674c545755d7;p=thirdparty%2Fkea.git [2108] Check that loading a zone with wildcard DNAME names throws an exception --- diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc index 69bf5baf48..64214d978d 100644 --- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc +++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc @@ -299,6 +299,15 @@ TEST_F(MemoryClientTest, loadWildcardNSThrows) { // Teardown checks for memory segment leaks } +TEST_F(MemoryClientTest, loadWildcardDNAMEThrows) { + // Wildcard NS names should throw + EXPECT_THROW(client_->load(Name("example.org"), + TEST_DATA_DIR + "/example.org-wildcard-dname.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 a674a8b887..ad810b0e05 100644 --- a/src/lib/datasrc/memory/tests/testdata/Makefile.am +++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am @@ -19,3 +19,4 @@ EXTRA_DIST += example.org-nsec3-signed.zone EXTRA_DIST += example.org-nsec3-signed-no-param.zone EXTRA_DIST += example.org-out-of-zone.zone EXTRA_DIST += example.org-wildcard-ns.zone +EXTRA_DIST += example.org-wildcard-dname.zone diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-wildcard-dname.zone b/src/lib/datasrc/memory/tests/testdata/example.org-wildcard-dname.zone new file mode 100644 index 0000000000..0d03b0d5ae --- /dev/null +++ b/src/lib/datasrc/memory/tests/testdata/example.org-wildcard-dname.zone @@ -0,0 +1,4 @@ +;; test zone file with wildcard DNAME names + +example.org. 3600 IN SOA ns1.example.org. bugs.x.w.example.org. 79 3600 300 3600000 3600 +*.example.org. 3600 IN DNAME dname.example.com.