BIND 10 trac526, updated. 661ee8d341d0a24b6cab13302b028a9efb40daa4 [trac526] More CNAME tests
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 27 10:12:57 UTC 2011
The branch, trac526 has been updated
via 661ee8d341d0a24b6cab13302b028a9efb40daa4 (commit)
via 1dd7c3d6806b8694fa315f55c105884245e486ea (commit)
from 94b0beeb606dedc3c8fc44856e0a6f2d3c9754b4 (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 661ee8d341d0a24b6cab13302b028a9efb40daa4
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Jan 27 11:09:49 2011 +0100
[trac526] More CNAME tests
They are almost the same right now, but they will be different once the
CNAME chaining is implemented.
commit 1dd7c3d6806b8694fa315f55c105884245e486ea
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Jan 27 10:47:10 2011 +0100
[trac526] Cosmetic comment fix
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/query.cc | 1 -
src/bin/auth/tests/query_unittest.cc | 46 ++++++++++++++++++++++++++++++++-
2 files changed, 44 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc
index 3dc9604..51ad5e8 100644
--- a/src/bin/auth/query.cc
+++ b/src/bin/auth/query.cc
@@ -150,7 +150,6 @@ Query::process() const {
* what we expected. It means no exceptions in ANY or NS
* on the origin (though CNAME in origin is probably
* forbidden anyway).
- *
*/
// No break; here, fall trough.
case Zone::SUCCESS:
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index e6f5a8f..86c9ab6 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -70,6 +70,11 @@ const char* const mx_txt =
const char* const www_a_txt = "www.example.com. 3600 IN A 192.0.2.80\n";
const char* const cname_txt =
"cname.example.com. 3600 IN CNAME www.example.com.\n";
+const char* const cname_nxdom_txt =
+ "cnamenxdom.example.com. 3600 IN CNAME nxdomain.example.com.\n";
+// CNAME Leading out of zone
+const char* const cname_out_txt =
+ "cnameout.example.com. 3600 IN CNAME www.example.org.\n";
// The rest of data won't be referenced from the test cases.
const char* const other_zone_rrs =
"cnamemailer.example.com. 3600 IN CNAME www.example.com.\n"
@@ -97,7 +102,7 @@ public:
stringstream zone_stream;
zone_stream << soa_txt << zone_ns_txt << ns_addrs_txt <<
delegation_txt << mx_txt << www_a_txt << cname_txt <<
- other_zone_rrs;
+ cname_nxdom_txt << cname_out_txt << other_zone_rrs;
masterLoad(zone_stream, origin_, rrclass_,
boost::bind(&MockZone::loadRRset, this, _1));
@@ -399,7 +404,10 @@ TEST_F(QueryTest, MXAlias) {
}
/*
- * Test encountering a cname.
+ * Tests encountering a cname.
+ *
+ * There are tests leading to successful answers, NXRRSET, NXDOMAIN and
+ * out of the zone.
*
* TODO: We currently don't do chaining, so only the CNAME itself should be
* returned.
@@ -412,4 +420,38 @@ TEST_F(QueryTest, CNAME) {
cname_txt, zone_ns_txt, ns_addrs_txt);
}
+TEST_F(QueryTest, CNAME_NX_RRSET) {
+ // Leads to www.example.com, it doesn't have TXT
+ Query(memory_datasrc, Name("cname.example.com"), RRType::TXT(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, CNAME_NX_DOMAIN) {
+ // Leads to nxdomain.example.com
+ Query(memory_datasrc, Name("cnamenxdom.example.com"), RRType::A(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_nxdom_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, CNAME_OUT) {
+ /*
+ * This leads out of zone. This should have only the CNAME even
+ * when we do chaining.
+ *
+ * TODO: We should be able to have two zones in the mock data source.
+ * Then the same test should be done with .org included there and
+ * see what it does (depends on what we want to do)
+ */
+ Query(memory_datasrc, Name("cnameout.example.com"), RRType::A(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_out_txt, zone_ns_txt, ns_addrs_txt);
+}
+
}
More information about the bind10-changes
mailing list