BIND 10 trac2377, updated. 24c515276e5a15558824fa12b8fefc9b80c315d3 [2377] Make incremental loading work

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Dec 3 12:17:40 UTC 2012


The branch, trac2377 has been updated
       via  24c515276e5a15558824fa12b8fefc9b80c315d3 (commit)
      from  cbffb4ac5bf27888553a102ac6ee2a1fbf07642b (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 24c515276e5a15558824fa12b8fefc9b80c315d3
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Dec 3 13:17:30 2012 +0100

    [2377] Make incremental loading work

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/master_loader.cc                |    1 +
 src/lib/dns/tests/master_loader_unittest.cc |   26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc
index 1acb14b..6c837e8 100644
--- a/src/lib/dns/master_loader.cc
+++ b/src/lib/dns/master_loader.cc
@@ -60,6 +60,7 @@ public:
     bool loadIncremental(size_t count_limit) {
         if (!initialized_) {
             pushSource(master_file_);
+            initialized_ = true;
         }
         size_t count = 0;
         while (ok_ && count < count_limit) {
diff --git a/src/lib/dns/tests/master_loader_unittest.cc b/src/lib/dns/tests/master_loader_unittest.cc
index e7ebdee..6df6ba2 100644
--- a/src/lib/dns/tests/master_loader_unittest.cc
+++ b/src/lib/dns/tests/master_loader_unittest.cc
@@ -111,6 +111,32 @@ TEST_F(MasterLoaderTest, basicLoad) {
     checkRR("www.example.org", RRType::A(), "192.0.2.1");
 }
 
+// Try loading data incrementally.
+TEST_F(MasterLoaderTest, incrementalLoad) {
+    setLoader("example.org", Name("example.org."), RRClass::IN(),
+              MasterLoader::MANY_ERRORS);
+
+    EXPECT_FALSE(loader_->loadIncremental(2));
+
+    EXPECT_TRUE(errors_.empty());
+    EXPECT_TRUE(warnings_.empty());
+
+    checkRR("example.org", RRType::SOA(), "ns1.example.org. admin.example.org. "
+            "1234 3600 1800 2419200 7200");
+    checkRR("example.org", RRType::NS(), "ns1.example.org.");
+
+    // The third one is not loaded yet
+    EXPECT_TRUE(rrsets_.empty());
+
+    // Load the rest.
+    EXPECT_TRUE(loader_->loadIncremental(20));
+
+    EXPECT_TRUE(errors_.empty());
+    EXPECT_TRUE(warnings_.empty());
+
+    checkRR("www.example.org", RRType::A(), "192.0.2.1");
+}
+
 // Try loading from file that doesn't exist. There should be single error
 // saying so.
 TEST_F(MasterLoaderTest, invalidFile) {



More information about the bind10-changes mailing list