BIND 10 trac2428, updated. e089de85aec2c705d7fee61f1a51e37aa2510756 [2428] Tests for basic $INCLUDE handling

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Dec 10 16:50:35 UTC 2012


The branch, trac2428 has been updated
       via  e089de85aec2c705d7fee61f1a51e37aa2510756 (commit)
      from  398a65223150685c4d022dd980d0292e8116afb1 (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 e089de85aec2c705d7fee61f1a51e37aa2510756
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Dec 10 17:49:27 2012 +0100

    [2428] Tests for basic $INCLUDE handling
    
    No special cases, no error handling, no domain name after that.

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

Summary of changes:
 src/lib/dns/tests/master_loader_unittest.cc |   43 +++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 5 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/master_loader_unittest.cc b/src/lib/dns/tests/master_loader_unittest.cc
index 2af578e..ca04b5c 100644
--- a/src/lib/dns/tests/master_loader_unittest.cc
+++ b/src/lib/dns/tests/master_loader_unittest.cc
@@ -115,6 +115,14 @@ public:
                   compare(current->getRdataIterator()->getCurrent()));
     }
 
+    void checkBasicRRs() {
+        checkRR("example.org", RRType::SOA(),
+                "ns1.example.org. admin.example.org. "
+                "1234 3600 1800 2419200 7200");
+        checkRR("example.org", RRType::NS(), "ns1.example.org.");
+        checkRR("www.example.org", RRType::A(), "192.0.2.1");
+    }
+
     MasterLoaderCallbacks callbacks_;
     boost::scoped_ptr<MasterLoader> loader_;
     vector<string> errors_;
@@ -135,11 +143,36 @@ TEST_F(MasterLoaderTest, basicLoad) {
     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.");
-    checkRR("www.example.org", RRType::A(), "192.0.2.1");
+    checkBasicRRs();
+}
+
+// Test the $INCLUDE directive
+TEST_F(MasterLoaderTest, include) {
+    // Test various cases of include
+    const char* includes[] = {
+        "include",
+        "INCLUDE",
+        "Include",
+        "InCluDe",
+        NULL
+    };
+    for (const char** include = includes; *include != NULL; ++include) {
+        SCOPED_TRACE(*include);
+        // Prepare input source that has no other content than just the
+        // include of the real master file.
+        const string include_str = string(*include) + " " + TEST_DATA_SRCDIR +
+            "/example.org\n";
+        stringstream ss(include_str);
+        setLoader(ss, Name("example.org."), RRClass::IN(),
+                  MasterLoader::MANY_ERRORS);
+
+        loader_->load();
+        EXPECT_TRUE(loader_->loadedSucessfully());
+        EXPECT_TRUE(errors_.empty());
+        EXPECT_TRUE(warnings_.empty());
+
+        checkBasicRRs();
+    }
 }
 
 // Check it works the same when created based on a stream, not filename



More information about the bind10-changes mailing list