Browse Source

[2420] initial attempt of allowing RRSIG-only case

looks like we need to update the updater first, so it's disabled for now.
JINMEI Tatuya 12 years ago
parent
commit
002527091f

+ 6 - 0
src/lib/datasrc/memory/zone_data_loader.cc

@@ -126,6 +126,11 @@ ZoneDataLoader::flushNodeRRsets() {
         updater_.add(val.second, sig_rrset);
     }
 
+#ifdef notyet
+    BOOST_FOREACH(NodeRRsetsVal val, node_rrsigsets_) {
+        updater_.add(ConstRRsetPtr(), val.second);
+    }
+#else
     // Right now, we don't accept RRSIG without covered RRsets (this
     // should eventually allowed, but to do so we'll need to update the
     // finder).
@@ -134,6 +139,7 @@ ZoneDataLoader::flushNodeRRsets() {
                   "RRSIG is added without covered RRset for "
                   << getCurrentName());
     }
+#endif
 
     node_rrsets_.clear();
     node_rrsigsets_.clear();

+ 10 - 4
src/lib/datasrc/tests/memory/zone_data_loader_unittest.cc

@@ -15,6 +15,7 @@
 #include <dns/name.h>
 #include <dns/rrclass.h>
 
+#include <datasrc/memory/rdataset.h>
 #include <datasrc/memory/zone_data.h>
 #include <datasrc/memory/zone_data_updater.h>
 #include <datasrc/memory/zone_data_loader.h>
@@ -42,13 +43,18 @@ protected:
     ZoneData* zone_data_;
 };
 
-TEST_F(ZoneDataLoaderTest, loadRRSIGFollowsNothing) {
+TEST_F(ZoneDataLoaderTest, DISABLED_loadRRSIGFollowsNothing) {
     // This causes the situation where an RRSIG is added without a covered
     // RRset.  Such cases are currently rejected.
-    EXPECT_THROW(loadZoneData(mem_sgmt_, zclass_, Name("example.org"),
+    zone_data_ = loadZoneData(mem_sgmt_, zclass_, Name("example.org"),
                               TEST_DATA_DIR
-                              "/example.org-rrsig-follows-nothing.zone"),
-                 ZoneDataUpdater::AddError);
+                              "/example.org-rrsig-follows-nothing.zone");
+    ZoneNode* node = NULL;
+    zone_data_->insertName(mem_sgmt_, Name("ns1.example.org"), &node);
+    ASSERT_NE(static_cast<ZoneNode*>(NULL), node);
+    const RdataSet* rdset = node->getData();
+    ASSERT_NE(static_cast<RdataSet*>(NULL), rdset);
+
     // Teardown checks for memory segment leaks
 }