BIND 10 trac1611, updated. 196eb4d56de69eaec1bb87ea0c086db4e19d1eba [1611] revised some test cases for result flags: do exact match rather than testing a single flag. it's stricter and probably a better test.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Jan 25 20:26:42 UTC 2012
The branch, trac1611 has been updated
via 196eb4d56de69eaec1bb87ea0c086db4e19d1eba (commit)
via ad80da2f843962bc6a7b05c9c3b624cee48a72eb (commit)
via 470359f0cfef05cf9a5348b4255fd71208b2a6c2 (commit)
via fa538d5bf3b6ac1eb944008ff70aaf8dc3750730 (commit)
from 019980ab4aff6cc4f12682e4870f4f4745509301 (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 196eb4d56de69eaec1bb87ea0c086db4e19d1eba
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jan 25 12:12:22 2012 -0800
[1611] revised some test cases for result flags: do exact match rather than
testing a single flag. it's stricter and probably a better test.
commit ad80da2f843962bc6a7b05c9c3b624cee48a72eb
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jan 25 12:10:56 2012 -0800
[1611] added a missing case to findresultflags test.
commit 470359f0cfef05cf9a5348b4255fd71208b2a6c2
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jan 25 12:08:28 2012 -0800
[1611] added a note about how to identify whether zone is signed with NSEC(3)
in the database zone finder. right now it's a TODO and the current
implementation is a kind of workaround.
commit fa538d5bf3b6ac1eb944008ff70aaf8dc3750730
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jan 25 12:02:41 2012 -0800
[1611] pydoc updates: revise overall doc that referred to "FindResult"
(which was C++ version only); corrected the return value description of
find_all() which was accidentally broken.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/database.cc | 3 ++
src/lib/python/isc/datasrc/finder_inc.cc | 26 +++++++++++-----------
src/lib/python/isc/datasrc/tests/datasrc_test.py | 7 ++++-
3 files changed, 21 insertions(+), 15 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 9eaa162..1dc5359 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -704,6 +704,9 @@ DatabaseClient::Finder::findOnNameResult(const Name& name,
// For wildcard case with DNSSEC required, the caller would need to know
// whether it's NSEC or NSEC3 signed. So we need to do an additional
// search here, even though the NSEC RR may not be returned.
+ // TODO: this part should be revised when we support NSEC3; ideally we
+ // should use more effective and efficient way to identify (whether and)
+ // in which way the zone is signed.
if (wild && (options & FIND_DNSSEC) != 0 &&
found.second.find(RRType::NSEC()) != found.second.end()) {
flags = flags | RESULT_NSEC_SIGNED;
diff --git a/src/lib/python/isc/datasrc/finder_inc.cc b/src/lib/python/isc/datasrc/finder_inc.cc
index 01dba6e..c063c44 100644
--- a/src/lib/python/isc/datasrc/finder_inc.cc
+++ b/src/lib/python/isc/datasrc/finder_inc.cc
@@ -47,7 +47,7 @@ Return the RR class of the zone.\n\
// - NULL->None
// - exceptions
const char* const ZoneFinder_find_doc = "\
-find(name, type, options=FIND_DEFAULT) -> (integer, RRset, flags)\n\
+find(name, type, options=FIND_DEFAULT) -> (integer, RRset, integer)\n\
\n\
Search the zone for a given pair of domain name and RR type.\n\
\n\
@@ -70,13 +70,13 @@ answer for the search key. Specifically,\n\
- If the search name matches a delegation point of DNAME, it returns\n\
the code of DNAME and that DNAME RR.\n\
\n\
-No RRset will be returned in the NXDOMAIN and NXRRSET cases (rrset\n\
-member of FindResult will be None), unless DNSSEC data are required.\n\
-See below for the cases with DNSSEC.\n\
+No RRset will be returned in the NXDOMAIN and NXRRSET cases (the\n\
+second element of the tuple will be None), unless DNSSEC data are\n\
+required. See below for the cases with DNSSEC.\n\
\n\
-The returned FindResult object can also provide supplemental\n\
-information about the search result via its methods returning a\n\
-boolean value. Such information may be useful for the caller if the\n\
+The third element of the returned tuple provides supplemental\n\
+information about the search result in the form of a bitmask (called\n\
+\"flags\"). Such information may be useful for the caller if the\n\
caller wants to collect additional DNSSEC proofs based on the search\n\
result.\n\
\n\
@@ -131,7 +131,7 @@ In case it's signed with NSEC3, there is no further information\n\
returned from this method.\n\
\n\
In case it's signed with NSEC, this method will possibly return a\n\
-related NSEC RRset in the rrset member of FindResult. What kind of\n\
+related NSEC RRset in the second element of the tuple. What kind of\n\
NSEC is returned depends on the result code (NXDOMAIN or NXRRSET) and\n\
on whether it's a wildcard match:\n\
\n\
@@ -186,8 +186,8 @@ Likewise, if zone \"example.org\" has the following record,\n\
a.example.org. NSEC x.*.b.example.org.\n\
\n\
a call to find() for \"y.b.example.org\" with FIND_DNSSEC will\n\
-result in NXRRSET and this NSEC; isWildcard() on the returned\n\
-FindResult object will return true.\n\
+result in NXRRSET and this NSEC; RESULT_WILDCARD bit is set in the\n\
+returned flags.\n\
\n\
This method raises an isc.datasrc.Error exception if there is an\n\
internal error in the datasource.\n\
@@ -198,12 +198,12 @@ Parameters:\n\
options The search options.\n\
\n\
Return Value(s): A tuple of a result code (integer), an RRset object\n\
-and supplemental integer.\n\
+and flags bitmask (integer).\n\
";
const char* const ZoneFinder_findAll_doc = "\
find_all(isc.dns.Name, options=FIND_DEFAULT) ->\n\
- (integer, RRset, flags) | (integer, [RRset], flags)\
+ (integer, RRset, integer) | (integer, [RRset], integer)\
\n\
Finds all RRsets in the given name.\n\
\n\
@@ -217,7 +217,7 @@ wildcard information etc. The options parameter works the same way and\n\
it should conform to the same exception restrictions.\n\
\n\
Parameters:\n\
- target the successfull result is returned through this\n\
+ name The domain name to be searched for.\n\
options The search options.\n\
\n\
Return Value(s): A tuple of a result code (integer), an either\n\
diff --git a/src/lib/python/isc/datasrc/tests/datasrc_test.py b/src/lib/python/isc/datasrc/tests/datasrc_test.py
index 7a1bf24..a6f8f16 100644
--- a/src/lib/python/isc/datasrc/tests/datasrc_test.py
+++ b/src/lib/python/isc/datasrc/tests/datasrc_test.py
@@ -321,10 +321,13 @@ class DataSrcClient(unittest.TestCase):
self.assertNotEqual(ZoneFinder.CNAME, ZoneFinder.DNAME)
def test_findresultflags(self):
+ '''A simple test just confirming the flags are all different.'''
self.assertNotEqual(ZoneFinder.RESULT_WILDCARD,
ZoneFinder.RESULT_NSEC_SIGNED)
self.assertNotEqual(ZoneFinder.RESULT_NSEC_SIGNED,
ZoneFinder.RESULT_NSEC3_SIGNED)
+ self.assertNotEqual(ZoneFinder.RESULT_NSEC3_SIGNED,
+ ZoneFinder.RESULT_WILDCARD)
def test_findall(self):
"""
@@ -400,7 +403,7 @@ class DataSrcClient(unittest.TestCase):
finder.find(isc.dns.Name("foo.wild.example.com"),
isc.dns.RRType.A(), finder.FIND_DEFAULT)
self.assertEqual(finder.SUCCESS, result)
- self.assertTrue((flags & finder.RESULT_WILDCARD) != 0)
+ self.assertEqual(finder.RESULT_WILDCARD, flags)
self.assertEqual("foo.wild.example.com. 3600 IN A 192.0.2.255\n",
rrset.to_text())
@@ -408,7 +411,7 @@ class DataSrcClient(unittest.TestCase):
isc.dns.RRType.TXT(),
finder.FIND_DEFAULT)
self.assertEqual(finder.NXRRSET, result)
- self.assertTrue((flags & finder.RESULT_WILDCARD) != 0)
+ self.assertTrue(finder.RESULT_WILDCARD, flags)
self.assertEqual(None, rrset)
self.assertRaises(TypeError, finder.find,
More information about the bind10-changes
mailing list