BIND 10 master, updated. b8f67d200e64a2a9931b6d664781caf835f2ecd4 [master] use the updated API from #1384 in xfrout
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Nov 18 08:56:29 UTC 2011
The branch, master has been updated
via b8f67d200e64a2a9931b6d664781caf835f2ecd4 (commit)
via 46bd9a8e6e3a543f97af6213bc7e43d619064aa7 (commit)
via c41c32c11999a34a46d2e20155358438d769f767 (commit)
via 11a4fe2def28da2ae83c94647a11fbb2114ec467 (commit)
via c2213ce7281be2aed47023a6f052bbec868a6028 (commit)
via 5e2238494ec665b558a6bf3b6a2c7351c1e022ba (commit)
via 755cd222be64019ea3b8db62e6d2643e6b6374c7 (commit)
via 5720f2262f0a1e4b8b2dcb1b66b94431e0dc6ff2 (commit)
via 8780f998204e96767785b29cd5b0e58cbeb10e1f (commit)
from 3e19362bc1ba7dc67a87768e2b172c48b32417f5 (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 b8f67d200e64a2a9931b6d664781caf835f2ecd4
Author: Jelte Jansen <jelte at isc.org>
Date: Fri Nov 18 09:55:29 2011 +0100
[master] use the updated API from #1384 in xfrout
commit 46bd9a8e6e3a543f97af6213bc7e43d619064aa7
Merge: 3e19362bc1ba7dc67a87768e2b172c48b32417f5 c41c32c11999a34a46d2e20155358438d769f767
Author: Jelte Jansen <jelte at isc.org>
Date: Fri Nov 18 08:33:26 2011 +0100
Merge branch 'trac1384'
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrout/xfrout.py.in | 4 +-
src/lib/datasrc/client.h | 15 +++---
src/lib/datasrc/database.cc | 29 ++++++------
src/lib/datasrc/database.h | 13 +++--
src/lib/datasrc/memory_datasrc.cc | 55 +++++++++++++++++-----
src/lib/datasrc/memory_datasrc.h | 2 +-
src/lib/datasrc/tests/database_unittest.cc | 4 +-
src/lib/datasrc/tests/memory_datasrc_unittest.cc | 48 +++++++++++++++++++
src/lib/python/isc/datasrc/client_inc.cc | 13 +++--
src/lib/python/isc/datasrc/client_python.cc | 20 ++++----
src/lib/python/isc/datasrc/tests/datasrc_test.py | 39 +++++++++++-----
11 files changed, 169 insertions(+), 73 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index a473322..32dabbf 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -316,11 +316,11 @@ class XfroutSession():
self._server.get_db_file() + '"}'
self._datasrc_client = self.ClientClass('sqlite3', datasrc_config)
try:
- # Note that we disable 'adjust_ttl'. In xfr-out we need to
+ # Note that we enable 'separate_rrs'. In xfr-out we need to
# preserve as many things as possible (even if it's half broken)
# stored in the zone.
self._iterator = self._datasrc_client.get_iterator(zone_name,
- False)
+ True)
except isc.datasrc.Error:
# If the current name server does not have authority for the
# zone, xfrout can't serve for it, return rcode NOTAUTH.
diff --git a/src/lib/datasrc/client.h b/src/lib/datasrc/client.h
index 5fd0af5..18d04f7 100644
--- a/src/lib/datasrc/client.h
+++ b/src/lib/datasrc/client.h
@@ -215,18 +215,19 @@ public:
///
/// \param name The name of zone apex to be traversed. It doesn't do
/// nearest match as findZone.
- /// \param adjust_ttl If true, the iterator will treat RRs with the same
- /// name and type but different TTL values to be of the
- /// same RRset, and will adjust the TTL to the lowest
- /// value found. If false, it will consider the RR to
- /// belong to a different RRset.
+ /// \param separate_rrs If true, the iterator will return each RR as a
+ /// new RRset object. If false, the iterator will
+ /// combine consecutive RRs with the name and type
+ /// into 1 RRset. The capitalization of the RRset will
+ /// be that of the first RR read, and TTLs will be
+ /// adjusted to the lowest one found.
/// \return Pointer to the iterator.
virtual ZoneIteratorPtr getIterator(const isc::dns::Name& name,
- bool adjust_ttl = true) const {
+ bool separate_rrs = false) const {
// This is here to both document the parameter in doxygen (therefore it
// needs a name) and avoid unused parameter warning.
static_cast<void>(name);
- static_cast<void>(adjust_ttl);
+ static_cast<void>(separate_rrs);
isc_throw(isc::NotImplemented,
"Data source doesn't support iteration");
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 5000680..0e867ba 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -707,11 +707,11 @@ public:
DatabaseIterator(shared_ptr<DatabaseAccessor> accessor,
const Name& zone_name,
const RRClass& rrclass,
- bool adjust_ttl) :
+ bool separate_rrs) :
accessor_(accessor),
class_(rrclass),
ready_(true),
- adjust_ttl_(adjust_ttl)
+ separate_rrs_(separate_rrs)
{
// Get the zone
const pair<bool, int> zone(accessor_->getZone(zone_name.toText()));
@@ -769,20 +769,19 @@ public:
const RRType rtype(rtype_str);
RRsetPtr rrset(new RRset(name, class_, rtype, RRTTL(ttl)));
while (data_ready_ && name_ == name_str && rtype_str == rtype_) {
- if (adjust_ttl_) {
- if (ttl_ != ttl) {
- if (ttl < ttl_) {
- ttl_ = ttl;
- rrset->setTTL(RRTTL(ttl));
- }
- LOG_WARN(logger, DATASRC_DATABASE_ITERATE_TTL_MISMATCH).
- arg(name_).arg(class_).arg(rtype_).arg(rrset->getTTL());
+ if (ttl_ != ttl) {
+ if (ttl < ttl_) {
+ ttl_ = ttl;
+ rrset->setTTL(RRTTL(ttl));
}
- } else if (ttl_ != ttl) {
- break;
+ LOG_WARN(logger, DATASRC_DATABASE_ITERATE_TTL_MISMATCH).
+ arg(name_).arg(class_).arg(rtype_).arg(rrset->getTTL());
}
rrset->addRdata(rdata::createRdata(rtype, class_, rdata_));
getData();
+ if (separate_rrs_) {
+ break;
+ }
}
LOG_DEBUG(logger, DBG_TRACE_DETAILED, DATASRC_DATABASE_ITERATE_NEXT).
arg(rrset->getName()).arg(rrset->getType());
@@ -814,18 +813,18 @@ private:
string name_, rtype_, rdata_, ttl_;
// Whether to modify differing TTL values, or treat a different TTL as
// a different RRset
- bool adjust_ttl_;
+ bool separate_rrs_;
};
}
ZoneIteratorPtr
DatabaseClient::getIterator(const isc::dns::Name& name,
- bool adjust_ttl) const
+ bool separate_rrs) const
{
ZoneIteratorPtr iterator = ZoneIteratorPtr(new DatabaseIterator(
accessor_->clone(), name,
- rrclass_, adjust_ttl));
+ rrclass_, separate_rrs));
LOG_DEBUG(logger, DBG_TRACE_DETAILED, DATASRC_DATABASE_ITERATE).
arg(name);
diff --git a/src/lib/datasrc/database.h b/src/lib/datasrc/database.h
index e3d99b4..2ac10e7 100644
--- a/src/lib/datasrc/database.h
+++ b/src/lib/datasrc/database.h
@@ -913,15 +913,16 @@ public:
* \exception Anything else the underlying DatabaseConnection might
* want to throw.
* \param name The origin of the zone to iterate.
- * \param adjust_ttl If true, the iterator will treat RRs with the same
- * name and type but different TTL values to be of the
- * same RRset, and will adjust the TTL to the lowest
- * value found. If false, it will consider the RR to
- * belong to a different RRset.
+ * \param separate_rrs If true, the iterator will return each RR as a
+ * new RRset object. If false, the iterator will
+ * combine consecutive RRs with the name and type
+ * into 1 RRset. The capitalization of the RRset will
+ * be that of the first RR read, and TTLs will be
+ * adjusted to the lowest one found.
* \return Shared pointer to the iterator (it will never be NULL)
*/
virtual ZoneIteratorPtr getIterator(const isc::dns::Name& name,
- bool adjust_ttl = true) const;
+ bool separate_rrs = false) const;
/// This implementation internally clones the accessor from the one
/// used in the client and starts a separate transaction using the cloned
diff --git a/src/lib/datasrc/memory_datasrc.cc b/src/lib/datasrc/memory_datasrc.cc
index 765b50f..1bf17f6 100644
--- a/src/lib/datasrc/memory_datasrc.cc
+++ b/src/lib/datasrc/memory_datasrc.cc
@@ -729,10 +729,14 @@ private:
Domain::const_iterator dom_iterator_;
const DomainTree& tree_;
const DomainNode* node_;
+ // Only used when separate_rrs_ is true
+ RdataIteratorPtr rdata_iterator_;
+ bool separate_rrs_;
bool ready_;
public:
- MemoryIterator(const DomainTree& tree, const Name& origin) :
+ MemoryIterator(const DomainTree& tree, const Name& origin, bool separate_rrs) :
tree_(tree),
+ separate_rrs_(separate_rrs),
ready_(true)
{
// Find the first node (origin) and preserve the node chain for future
@@ -747,6 +751,9 @@ public:
// Initialize the iterator if there's somewhere to point to
if (node_ != NULL && node_->getData() != DomainPtr()) {
dom_iterator_ = node_->getData()->begin();
+ if (separate_rrs_ && dom_iterator_ != node_->getData()->end()) {
+ rdata_iterator_ = dom_iterator_->second->getRdataIterator();
+ }
}
}
@@ -766,6 +773,10 @@ public:
// if the map is empty or not
if (node_ != NULL && node_->getData() != NULL) {
dom_iterator_ = node_->getData()->begin();
+ // New RRset, so get a new rdata iterator
+ if (separate_rrs_) {
+ rdata_iterator_ = dom_iterator_->second->getRdataIterator();
+ }
}
}
if (node_ == NULL) {
@@ -773,12 +784,35 @@ public:
ready_ = false;
return (ConstRRsetPtr());
}
- // The iterator points to the next yet unused RRset now
- ConstRRsetPtr result(dom_iterator_->second);
- // This one is used, move it to the next time for next call
- ++dom_iterator_;
- return (result);
+ if (separate_rrs_) {
+ // For separate rrs, reconstruct a new RRset with just the
+ // 'current' rdata
+ RRsetPtr result(new RRset(dom_iterator_->second->getName(),
+ dom_iterator_->second->getClass(),
+ dom_iterator_->second->getType(),
+ dom_iterator_->second->getTTL()));
+ result->addRdata(rdata_iterator_->getCurrent());
+ rdata_iterator_->next();
+ if (rdata_iterator_->isLast()) {
+ // all used up, next.
+ ++dom_iterator_;
+ // New RRset, so get a new rdata iterator, but only if this
+ // was not the final RRset in the chain
+ if (dom_iterator_ != node_->getData()->end()) {
+ rdata_iterator_ = dom_iterator_->second->getRdataIterator();
+ }
+ }
+ return (result);
+ } else {
+ // The iterator points to the next yet unused RRset now
+ ConstRRsetPtr result(dom_iterator_->second);
+
+ // This one is used, move it to the next time for next call
+ ++dom_iterator_;
+
+ return (result);
+ }
}
virtual ConstRRsetPtr getSOA() const {
@@ -789,11 +823,7 @@ public:
} // End of anonymous namespace
ZoneIteratorPtr
-InMemoryClient::getIterator(const Name& name, bool) const {
- // note: adjust_ttl argument is ignored, as the RRsets are already
- // individually stored, and hence cannot have different TTLs anymore at
- // this point
-
+InMemoryClient::getIterator(const Name& name, bool separate_rrs) const {
ZoneTable::FindResult result(impl_->zone_table.findZone(name));
if (result.code != result::SUCCESS) {
isc_throw(DataSourceError, "No such zone: " + name.toText());
@@ -811,7 +841,8 @@ InMemoryClient::getIterator(const Name& name, bool) const {
isc_throw(Unexpected, "The zone at " + name.toText() +
" is not InMemoryZoneFinder");
}
- return (ZoneIteratorPtr(new MemoryIterator(zone->impl_->domains_, name)));
+ return (ZoneIteratorPtr(new MemoryIterator(zone->impl_->domains_, name,
+ separate_rrs)));
}
ZoneUpdaterPtr
diff --git a/src/lib/datasrc/memory_datasrc.h b/src/lib/datasrc/memory_datasrc.h
index 15e7058..a9764fe 100644
--- a/src/lib/datasrc/memory_datasrc.h
+++ b/src/lib/datasrc/memory_datasrc.h
@@ -273,7 +273,7 @@ public:
/// \brief Implementation of the getIterator method
virtual ZoneIteratorPtr getIterator(const isc::dns::Name& name,
- bool adjust_ttl = true) const;
+ bool separate_rrs = false) const;
/// In-memory data source is read-only, so this derived method will
/// result in a NotImplemented exception.
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index 984c6e8..007c634 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -1340,8 +1340,8 @@ TEST_F(MockDatabaseClientTest, ttldiff) {
// Unless we ask for individual RRs in our iterator request. In that case
// every RR should go into its own 'rrset'
-TEST_F(MockDatabaseClientTest, ttldiff_no_adjust_ttl) {
- ZoneIteratorPtr it(this->client_->getIterator(Name("example.org"), false));
+TEST_F(MockDatabaseClientTest, ttldiff_separate_rrs) {
+ ZoneIteratorPtr it(this->client_->getIterator(Name("example.org"), true));
// Walk through the full iterator, we should see 1 rrset with name
// ttldiff1.example.org., and two rdatas. Same for ttldiff2
diff --git a/src/lib/datasrc/tests/memory_datasrc_unittest.cc b/src/lib/datasrc/tests/memory_datasrc_unittest.cc
index 2b854db..a1bd94e 100644
--- a/src/lib/datasrc/tests/memory_datasrc_unittest.cc
+++ b/src/lib/datasrc/tests/memory_datasrc_unittest.cc
@@ -177,6 +177,54 @@ TEST_F(InMemoryClientTest, iterator) {
EXPECT_EQ(ConstRRsetPtr(), iterator->getNextRRset());
}
+TEST_F(InMemoryClientTest, iterator_separate_rrs) {
+ // Exactly the same tests as for iterator, but now with separate_rrs = true
+ // For the one that returns actual data, the AAAA should now be split up
+ boost::shared_ptr<InMemoryZoneFinder>
+ zone(new InMemoryZoneFinder(RRClass::IN(), Name("a")));
+ RRsetPtr aRRsetA(new RRset(Name("a"), RRClass::IN(), RRType::A(),
+ RRTTL(300)));
+ aRRsetA->addRdata(rdata::in::A("192.0.2.1"));
+ RRsetPtr aRRsetAAAA(new RRset(Name("a"), RRClass::IN(), RRType::AAAA(),
+ RRTTL(300)));
+ aRRsetAAAA->addRdata(rdata::in::AAAA("2001:db8::1"));
+ aRRsetAAAA->addRdata(rdata::in::AAAA("2001:db8::2"));
+ RRsetPtr aRRsetAAAA_r1(new RRset(Name("a"), RRClass::IN(), RRType::AAAA(),
+ RRTTL(300)));
+ aRRsetAAAA_r1->addRdata(rdata::in::AAAA("2001:db8::1"));
+ RRsetPtr aRRsetAAAA_r2(new RRset(Name("a"), RRClass::IN(), RRType::AAAA(),
+ RRTTL(300)));
+ aRRsetAAAA_r2->addRdata(rdata::in::AAAA("2001:db8::2"));
+
+ RRsetPtr subRRsetA(new RRset(Name("sub.x.a"), RRClass::IN(), RRType::A(),
+ RRTTL(300)));
+ subRRsetA->addRdata(rdata::in::A("192.0.2.2"));
+ EXPECT_EQ(result::SUCCESS, memory_client.addZone(zone));
+
+ // First, the zone is not there, so it should throw
+ EXPECT_THROW(memory_client.getIterator(Name("b"), true), DataSourceError);
+ // This zone is not there either, even when there's a zone containing this
+ EXPECT_THROW(memory_client.getIterator(Name("x.a")), DataSourceError);
+ // Now, an empty zone
+ ZoneIteratorPtr iterator(memory_client.getIterator(Name("a"), true));
+ EXPECT_EQ(ConstRRsetPtr(), iterator->getNextRRset());
+ // It throws Unexpected when we are past the end
+ EXPECT_THROW(iterator->getNextRRset(), isc::Unexpected);
+
+ ASSERT_EQ(result::SUCCESS, zone->add(aRRsetA));
+ ASSERT_EQ(result::SUCCESS, zone->add(aRRsetAAAA));
+ ASSERT_EQ(result::SUCCESS, zone->add(subRRsetA));
+ // Check it with full zone, one by one.
+ // It should be in ascending order in case of InMemory data source
+ // (isn't guaranteed in general)
+ iterator = memory_client.getIterator(Name("a"), true);
+ EXPECT_EQ(aRRsetA->toText(), iterator->getNextRRset()->toText());
+ EXPECT_EQ(aRRsetAAAA_r1->toText(), iterator->getNextRRset()->toText());
+ EXPECT_EQ(aRRsetAAAA_r2->toText(), iterator->getNextRRset()->toText());
+ EXPECT_EQ(subRRsetA->toText(), iterator->getNextRRset()->toText());
+ EXPECT_EQ(ConstRRsetPtr(), iterator->getNextRRset());
+}
+
TEST_F(InMemoryClientTest, getZoneCount) {
EXPECT_EQ(0, memory_client.getZoneCount());
memory_client.addZone(
diff --git a/src/lib/python/isc/datasrc/client_inc.cc b/src/lib/python/isc/datasrc/client_inc.cc
index 14c0157..f4fb01b 100644
--- a/src/lib/python/isc/datasrc/client_inc.cc
+++ b/src/lib/python/isc/datasrc/client_inc.cc
@@ -89,7 +89,7 @@ None\n\
";
const char* const DataSourceClient_getIterator_doc = "\
-get_iterator(name, adjust_ttl=True) -> ZoneIterator\n\
+get_iterator(name, separate_rrs=False) -> ZoneIterator\n\
\n\
Returns an iterator to the given zone.\n\
\n\
@@ -111,11 +111,12 @@ anything else.\n\
Parameters:\n\
isc.dns.Name The name of zone apex to be traversed. It doesn't do\n\
nearest match as find_zone.\n\
- adjust_ttl If True, the iterator will treat RRs with the same\n\
- name and type but different TTL values to be of the\n\
- same RRset, and will adjust the TTL to the lowest\n\
- value found. If false, it will consider the RR to\n\
- belong to a different RRset.\n\
+ separate_rrs If true, the iterator will return each RR as a\n\
+ new RRset object. If false, the iterator will\n\
+ combine consecutive RRs with the name and type\n\
+ into 1 RRset. The capitalization of the RRset will\n\
+ be that of the first RR read, and TTLs will be\n\
+ adjusted to the lowest one found.\n\
\n\
Return Value(s): Pointer to the iterator.\n\
";
diff --git a/src/lib/python/isc/datasrc/client_python.cc b/src/lib/python/isc/datasrc/client_python.cc
index 5ab1139..2740355 100644
--- a/src/lib/python/isc/datasrc/client_python.cc
+++ b/src/lib/python/isc/datasrc/client_python.cc
@@ -84,26 +84,26 @@ PyObject*
DataSourceClient_getIterator(PyObject* po_self, PyObject* args) {
s_DataSourceClient* const self = static_cast<s_DataSourceClient*>(po_self);
PyObject* name_obj;
- PyObject* adjust_ttl_obj = NULL;
+ PyObject* separate_rrs_obj = NULL;
if (PyArg_ParseTuple(args, "O!|O", &name_type, &name_obj,
- &adjust_ttl_obj)) {
+ &separate_rrs_obj)) {
try {
- bool adjust_ttl = true;
- if (adjust_ttl_obj != NULL) {
+ bool separate_rrs = false;
+ if (separate_rrs_obj != NULL) {
// store result in local var so we can explicitely check for
// -1 error return value
- int adjust_ttl_no = PyObject_Not(adjust_ttl_obj);
- if (adjust_ttl_no == 1) {
- adjust_ttl = false;
- } else if (adjust_ttl_no == -1) {
+ int separate_rrs_true = PyObject_IsTrue(separate_rrs_obj);
+ if (separate_rrs_true == 1) {
+ separate_rrs = true;
+ } else if (separate_rrs_true == -1) {
PyErr_SetString(getDataSourceException("Error"),
- "Error getting value of adjust_ttl");
+ "Error getting value of separate_rrs");
return (NULL);
}
}
return (createZoneIteratorObject(
self->cppobj->getInstance().getIterator(PyName_ToName(name_obj),
- adjust_ttl),
+ separate_rrs),
po_self));
} catch (const isc::NotImplemented& ne) {
PyErr_SetString(getDataSourceException("NotImplemented"),
diff --git a/src/lib/python/isc/datasrc/tests/datasrc_test.py b/src/lib/python/isc/datasrc/tests/datasrc_test.py
index fb4de15..02020e2 100644
--- a/src/lib/python/isc/datasrc/tests/datasrc_test.py
+++ b/src/lib/python/isc/datasrc/tests/datasrc_test.py
@@ -83,13 +83,12 @@ class DataSrcClient(unittest.TestCase):
isc.datasrc.DataSourceClient, "memory",
"{ \"foo\": 1 }")
- @unittest.skip("This test may fail depending on sqlite3 library behavior")
def test_iterate(self):
dsc = isc.datasrc.DataSourceClient("sqlite3", READ_ZONE_DB_CONFIG)
# for RRSIGS, the TTL's are currently modified. This test should
# start failing when we fix that.
- rrs = dsc.get_iterator(isc.dns.Name("sql1.example.com."), False)
+ rrs = dsc.get_iterator(isc.dns.Name("sql1.example.com."), True)
# we do not know the order in which they are returned by the iterator
# but we do want to check them, so we put all records into one list
@@ -116,7 +115,11 @@ class DataSrcClient(unittest.TestCase):
"256 3 5 AwEAAdYdRhBAEY67R/8G1N5AjGF6asIiNh/pNGeQ8xDQP13J"+
"N2lo+sNqWcmpYNhuVqRbLB+mamsU1XcCICSBvAlSmfz/ZUdafX23knAr"+
"TlALxMmspcfdpqun3Yr3YYnztuj06rV7RqmveYckWvAUXVYMSMQZfJ30"+
- "5fs0dE/xLztL/CzZ",
+ "5fs0dE/xLztL/CzZ"
+ ])
+ add_rrset(expected_rrset_list, name, rrclass,
+ isc.dns.RRType.DNSKEY(), isc.dns.RRTTL(3600),
+ [
"257 3 5 AwEAAbaKDSa9XEFTsjSYpUTHRotTS9Tz3krfDucugW5UokGQ"+
"KC26QlyHXlPTZkC+aRFUs/dicJX2kopndLcnlNAPWiKnKtrsFSCnIJDB"+
"ZIyvcKq+9RXmV3HK3bUdHnQZ88IZWBRmWKfZ6wnzHo53kdYKAemTErkz"+
@@ -128,8 +131,16 @@ class DataSrcClient(unittest.TestCase):
add_rrset(expected_rrset_list, name, rrclass,
isc.dns.RRType.NS(), isc.dns.RRTTL(3600),
[
- "dns01.example.com.",
- "dns02.example.com.",
+ "dns01.example.com."
+ ])
+ add_rrset(expected_rrset_list, name, rrclass,
+ isc.dns.RRType.NS(), isc.dns.RRTTL(3600),
+ [
+ "dns02.example.com."
+ ])
+ add_rrset(expected_rrset_list, name, rrclass,
+ isc.dns.RRType.NS(), isc.dns.RRTTL(3600),
+ [
"dns03.example.com."
])
add_rrset(expected_rrset_list, name, rrclass,
@@ -140,15 +151,19 @@ class DataSrcClient(unittest.TestCase):
# For RRSIGS, we can't add the fake data through the API, so we
# simply pass no rdata at all (which is skipped by the check later)
- # Since we passed adjust_ttl = False to get_iterator, we get several
+ # Since we passed separate_rrs = True to get_iterator, we get several
# sets of RRSIGs, one for each TTL
add_rrset(expected_rrset_list, name, rrclass,
isc.dns.RRType.RRSIG(), isc.dns.RRTTL(3600), None)
add_rrset(expected_rrset_list, name, rrclass,
- isc.dns.RRType.RRSIG(), isc.dns.RRTTL(7200), None)
+ isc.dns.RRType.RRSIG(), isc.dns.RRTTL(3600), None)
add_rrset(expected_rrset_list, name, rrclass,
isc.dns.RRType.RRSIG(), isc.dns.RRTTL(3600), None)
add_rrset(expected_rrset_list, name, rrclass,
+ isc.dns.RRType.RRSIG(), isc.dns.RRTTL(3600), None)
+ add_rrset(expected_rrset_list, name, rrclass,
+ isc.dns.RRType.RRSIG(), isc.dns.RRTTL(7200), None)
+ add_rrset(expected_rrset_list, name, rrclass,
isc.dns.RRType.SOA(), isc.dns.RRTTL(3600),
[
"master.example.com. admin.example.com. 678 3600 1800 2419200 7200"
@@ -192,26 +207,26 @@ class DataSrcClient(unittest.TestCase):
# instead of failing?
self.assertRaises(isc.datasrc.Error, rrs.get_next_rrset)
- # Without the adjust_ttl argument, it should return 55 RRsets
+ # Without the separate_rrs argument, it should return 55 RRsets
dsc = isc.datasrc.DataSourceClient("sqlite3", READ_ZONE_DB_CONFIG)
rrets = dsc.get_iterator(isc.dns.Name("example.com"))
# there are more than 80 RRs in this zone... let's just count them
# (already did a full check of the smaller zone above)
self.assertEqual(55, len(list(rrets)))
- # same test, but now with explicit True argument for adjust_ttl
+ # same test, but now with explicit False argument for separate_rrs
dsc = isc.datasrc.DataSourceClient("sqlite3", READ_ZONE_DB_CONFIG)
- rrets = dsc.get_iterator(isc.dns.Name("example.com"), True)
+ rrets = dsc.get_iterator(isc.dns.Name("example.com"), False)
# there are more than 80 RRs in this zone... let's just count them
# (already did a full check of the smaller zone above)
self.assertEqual(55, len(list(rrets)))
# Count should be 71 if we request individual rrsets for differing ttls
dsc = isc.datasrc.DataSourceClient("sqlite3", READ_ZONE_DB_CONFIG)
- rrets = dsc.get_iterator(isc.dns.Name("example.com"), False)
+ rrets = dsc.get_iterator(isc.dns.Name("example.com"), True)
# there are more than 80 RRs in this zone... let's just count them
# (already did a full check of the smaller zone above)
- self.assertEqual(71, len(list(rrets)))
+ self.assertEqual(84, len(list(rrets)))
# TODO should we catch this (iterating past end) and just return None
# instead of failing?
self.assertRaises(isc.datasrc.Error, rrs.get_next_rrset)
More information about the bind10-changes
mailing list