BIND 10 trac2108_3, updated. 1af7d120c3e58a3f503902d50ab5d3201c5cd2f9 [2108] Test when RRSIG doesn't match the name it is supposed to cover
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Sep 6 01:35:07 UTC 2012
The branch, trac2108_3 has been updated
via 1af7d120c3e58a3f503902d50ab5d3201c5cd2f9 (commit)
via b5efb671ff4bf5a570e00a626464eb7b97f9c8ae (commit)
via 222eefb4bd062a21bfac115a2d058655593836bc (commit)
via 1e1882f13e8e2739f394c5642878b32397cfd4f8 (commit)
from 4f132f47001567b8b9f48147546bc714dd28739f (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 1af7d120c3e58a3f503902d50ab5d3201c5cd2f9
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 6 07:04:47 2012 +0530
[2108] Test when RRSIG doesn't match the name it is supposed to cover
commit b5efb671ff4bf5a570e00a626464eb7b97f9c8ae
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 6 07:04:18 2012 +0530
[2108] Test when RRSIG doesn't follow its covered RRset
commit 222eefb4bd062a21bfac115a2d058655593836bc
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 6 07:03:10 2012 +0530
[2108] Test loading a non-existent zone file
commit 1e1882f13e8e2739f394c5642878b32397cfd4f8
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 6 06:45:39 2012 +0530
[2108] Add load() test for a full and correct zone
-----------------------------------------------------------------------
Summary of changes:
.../datasrc/memory/tests/memory_client_unittest.cc | 29 ++++++++++++++++++++
src/lib/datasrc/memory/tests/testdata/Makefile.am | 5 +++-
.../example.org-rrsig-follows-nothing.zone | 5 ++++
.../testdata/example.org-rrsig-name-unmatched.zone | 6 ++++
.../tests/testdata/example.org.zone} | 0
5 files changed, 44 insertions(+), 1 deletion(-)
create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-rrsig-follows-nothing.zone
create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-rrsig-name-unmatched.zone
copy src/lib/datasrc/{tests/testdata/contexttest.zone => memory/tests/testdata/example.org.zone} (100%)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
index a7a696e..0b40624 100644
--- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -115,6 +115,35 @@ TEST_F(MemoryClientTest, loadErrorsInParsingZoneMustNotLeak2) {
// Teardown checks for memory segment leaks
}
+TEST_F(MemoryClientTest, loadNonExistentZoneFile) {
+ EXPECT_THROW(client_->load(Name("example.org"),
+ TEST_DATA_DIR "/somerandomfilename"),
+ MasterLoadError);
+ // Teardown checks for memory segment leaks
+}
+
+TEST_F(MemoryClientTest, load) {
+ // This is a simple load check for a "full" and correct zone that
+ // should not result in any exceptions.
+ 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, loadRRSIGNameUnmatched) {
+ EXPECT_THROW(client_->load(Name("example.org"),
+ TEST_DATA_DIR
+ "/example.org-rrsig-name-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");
diff --git a/src/lib/datasrc/memory/tests/testdata/Makefile.am b/src/lib/datasrc/memory/tests/testdata/Makefile.am
index e8cd5d1..04f25bf 100644
--- a/src/lib/datasrc/memory/tests/testdata/Makefile.am
+++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am
@@ -1,5 +1,8 @@
CLEANFILES = *.copied
-EXTRA_DIST = example.org-empty.zone
+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
+EXTRA_DIST += example.org-rrsig-name-unmatched.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 0000000..ef5f887
--- /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
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-rrsig-name-unmatched.zone b/src/lib/datasrc/memory/tests/testdata/example.org-rrsig-name-unmatched.zone
new file mode 100644
index 0000000..dc1d728
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-rrsig-name-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. 70 3600 300 3600000 3600
+ns1.example.org. 3600 IN A 192.0.2.1
+ns2.example.org. 3600 IN RRSIG A 7 3 3600 20150420235959 20051021000000 40430 example.org. FAKEFAKE
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org.zone b/src/lib/datasrc/memory/tests/testdata/example.org.zone
new file mode 100644
index 0000000..e499e0d
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org.zone
@@ -0,0 +1,81 @@
+;; 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. 67 3600 300 3600000 3600
+example.org. 3600 IN NS ns1.example.org.
+example.org. 3600 IN NS ns2.example.org.
+example.org. 3600 IN MX 1 mx1.example.org.
+example.org. 3600 IN MX 2 mx2.example.org.
+example.org. 3600 IN MX 3 mx.a.example.org.
+
+ns1.example.org. 3600 IN A 192.0.2.1
+ns1.example.org. 3600 IN RRSIG A 7 3 3600 20150420235959 20051021000000 40430 example.org. FAKEFAKE
+ns1.example.org. 3600 IN AAAA 2001:db8::1
+ns1.example.org. 3600 IN RRSIG AAAA 7 3 3600 20150420235959 20051021000000 40430 example.org. FAKEFAKEFAKE
+ns2.example.org. 3600 IN A 192.0.2.2
+ns2.example.org. 3600 IN TXT "text data"
+
+mx1.example.org. 3600 IN A 192.0.2.10
+mx2.example.org. 3600 IN AAAA 2001:db8::10
+
+;; delegation
+a.example.org. 3600 IN NS ns1.a.example.org.
+a.example.org. 3600 IN NS ns2.a.example.org.
+a.example.org. 3600 IN NS ns.example.com.
+
+ns1.a.example.org. 3600 IN A 192.0.2.5
+ns2.a.example.org. 3600 IN A 192.0.2.6
+ns2.a.example.org. 3600 IN AAAA 2001:db8::6
+mx.a.example.org. 3600 IN A 192.0.2.7
+
+;; delegation, one of its NS names is at zone cut.
+b.example.org. 3600 IN NS ns.b.example.org.
+b.example.org. 3600 IN NS b.example.org.
+b.example.org. 3600 IN AAAA 2001:db8::8
+
+ns.b.example.org. 3600 IN A 192.0.2.9
+
+;; The MX name is at a zone cut. shouldn't be included in the
+;; additional section.
+mxatcut.example.org. 3600 IN MX 1 b.example.org.
+
+;; delegation, one of its NS names is under a DNAME delegation point;
+;; another is at that point; and yet another is under DNAME below a
+;; zone cut.
+c.example.org. 3600 IN NS ns.dname.example.org.
+c.example.org. 3600 IN NS dname.example.org.
+c.example.org. 3600 IN NS ns.deepdname.example.org.
+ns.dname.example.org. 3600 IN A 192.0.2.11
+dname.example.org. 3600 IN A 192.0.2.12
+ns.deepdname.example.org. 3600 IN AAAA 2001:db8::9
+
+;; delegation, one of its NS name is at an empty non terminal.
+d.example.org. 3600 IN NS ns.empty.example.org.
+d.example.org. 3600 IN NS ns1.example.org.
+;; by adding these two we can create an empty RB node for
+;; ns.empty.example.org in the in-memory zone
+foo.ns.empty.example.org. 3600 IN A 192.0.2.13
+bar.ns.empty.example.org. 3600 IN A 192.0.2.14
+
+;; delegation; the NS name matches a wildcard (and there's no exact
+;; match). One of the NS names matches an empty wildcard node, for
+;; which no additional record should be provided (or any other
+;; disruption should happen).
+e.example.org. 3600 IN NS ns.wild.example.org.
+e.example.org. 3600 IN NS ns.emptywild.example.org.
+e.example.org. 3600 IN NS ns2.example.org.
+*.wild.example.org. 3600 IN A 192.0.2.15
+a.*.emptywild.example.org. 3600 IN AAAA 2001:db8::2
+
+;; additional for an answer RRset (MX) as a result of wildcard
+;; expansion
+*.wildmx.example.org. 3600 IN MX 1 mx1.example.org.
+
+;; CNAME
+alias.example.org. 3600 IN CNAME cname.example.org.
+
+;; DNAME
+dname.example.org. 3600 IN DNAME dname.example.com.
+
+;; DNAME under a NS (strange one)
+deepdname.c.example.org. 3600 IN DNAME deepdname.example.com.
More information about the bind10-changes
mailing list