BIND 10 trac1782, updated. 65193e8384b25f0092177adb91a8ee6c2679d2db [1782] Test nsec3 iteration of sqlite3 zone
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Apr 13 11:49:48 UTC 2012
The branch, trac1782 has been updated
via 65193e8384b25f0092177adb91a8ee6c2679d2db (commit)
from 5dcf1dadd19d9b251fa6dbefefbc98f16fb62c66 (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 65193e8384b25f0092177adb91a8ee6c2679d2db
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Apr 13 13:49:10 2012 +0200
[1782] Test nsec3 iteration of sqlite3 zone
We count the NSEC3 records there and check one if it looks correct.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/tests/sqlite3_accessor_unittest.cc | 43 ++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc b/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
index c36c94b..f3aea4e 100644
--- a/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
+++ b/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
@@ -194,6 +194,49 @@ TEST_F(SQLite3AccessorTest, iterator) {
EXPECT_FALSE(context->getNext(data));
}
+// This tests the iterator through the whole zone returns NSEC3 records as
+// well. We test this specifically, as it lives in separate table and needs
+// extra handling.
+TEST_F(SQLite3AccessorTest, nsec3Iterator) {
+ // Get the zone
+ const std::pair<bool, int>
+ zone_info(accessor->getZone("sql2.example.com."));
+ ASSERT_TRUE(zone_info.first);
+
+ // Iterate through it
+ DatabaseAccessor::IteratorContextPtr
+ context(accessor->getAllRecords(zone_info.second));
+
+ // We just pick a random NSEC3 to check, the check of complete iterator
+ // is in the above test. In addition, we count the number of NSEC3, RRSIG
+ // and all records, as some kind of check it returns all the data.
+ std::string data[DatabaseAccessor::COLUMN_COUNT];
+
+ size_t nsec3count(0), rrsigcount(0), recordcount(0);
+ bool nsec3match(false);
+ while (context->getNext(data)) {
+ if (data[DatabaseAccessor::TYPE_COLUMN] == "NSEC3") {
+ nsec3count ++;
+ if (data[DatabaseAccessor::NAME_COLUMN] ==
+ "1BB7SO0452U1QHL98UISNDD9218GELR5.sql2.example.com.") {
+ nsec3match = true;
+ EXPECT_EQ("7200", data[DatabaseAccessor::TTL_COLUMN]);
+ EXPECT_EQ("1 0 10 FEEDABEE 4KLSVDE8KH8G95VU68R7AHBE1CPQN38J",
+ data[DatabaseAccessor::RDATA_COLUMN]);
+ }
+ } else if (data[DatabaseAccessor::TYPE_COLUMN] == "RRSIG") {
+ rrsigcount ++;
+ }
+ recordcount ++;
+ }
+
+ // We counted everything now, so check there's nothing else to count
+ EXPECT_EQ(11, nsec3count);
+ EXPECT_EQ(22, rrsigcount);
+ EXPECT_EQ(46, recordcount);
+ EXPECT_TRUE(nsec3match) << "No NSEC3 found when iterating the zone";
+}
+
// This tests getting NSEC3 records
TEST_F(SQLite3AccessorTest, nsec3) {
const std::pair<bool, int>
More information about the bind10-changes
mailing list