BIND 10 master, updated. ec856ca7f468f0c23b19b6ed42282fabf1549de8 [master] Add ChangeLog entry for #2335

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Jan 14 13:00:57 UTC 2014


The branch, master has been updated
       via  ec856ca7f468f0c23b19b6ed42282fabf1549de8 (commit)
       via  c918027a387da8514acf7e125fd52c8378113662 (commit)
       via  c04d82e2d18892b359c6cf2b855de3edd2694d0a (commit)
      from  381aca0b35bf693238462fb8e13fdccaa9d711c0 (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 ec856ca7f468f0c23b19b6ed42282fabf1549de8
Author: Mukund Sivaraman <muks at isc.org>
Date:   Tue Jan 14 18:27:02 2014 +0530

    [master] Add ChangeLog entry for #2335

commit c918027a387da8514acf7e125fd52c8378113662
Merge: 381aca0 c04d82e
Author: Mukund Sivaraman <muks at isc.org>
Date:   Tue Jan 14 18:22:31 2014 +0530

    Merge branch 'trac2335'

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

Summary of changes:
 ChangeLog                                          |    4 ++++
 src/lib/datasrc/memory/treenode_rrset.cc           |    5 ----
 src/lib/datasrc/memory/treenode_rrset.h            |    7 +-----
 .../tests/memory/treenode_rrset_unittest.cc        |    1 -
 src/lib/dns/python/rrset_python.cc                 |   13 ----------
 src/lib/dns/python/tests/rrset_python_test.py      |    5 ----
 src/lib/dns/rrset.cc                               |    5 ----
 src/lib/dns/rrset.h                                |   25 --------------------
 src/lib/dns/tests/rrset_unittest.cc                |    5 ----
 .../tests/nameserver_address_store_unittest.cc     |   20 ++++++++++++----
 src/lib/nsas/tests/zone_entry_unittest.cc          |   14 +++++++++--
 11 files changed, 33 insertions(+), 71 deletions(-)

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 406b12a..dfa28e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+727.	[func]		muks
+	RRset::setName() has now been removed.
+	(Trac #2335, git c918027a387da8514acf7e125fd52c8378113662)
+
 726.	[bug]		muks
 	Don't print trailing newlines in Question::toText() output by
 	default.  This fixes some logging that were split with a line
diff --git a/src/lib/datasrc/memory/treenode_rrset.cc b/src/lib/datasrc/memory/treenode_rrset.cc
index c4e16a6..4734e04 100644
--- a/src/lib/datasrc/memory/treenode_rrset.cc
+++ b/src/lib/datasrc/memory/treenode_rrset.cc
@@ -67,11 +67,6 @@ TreeNodeRRset::getTTL() const {
 }
 
 void
-TreeNodeRRset::setName(const Name&) {
-    isc_throw(Unexpected, "unexpected method called on TreeNodeRRset");
-}
-
-void
 TreeNodeRRset::setTTL(const RRTTL&) {
     isc_throw(Unexpected, "unexpected method called on TreeNodeRRset");
 }
diff --git a/src/lib/datasrc/memory/treenode_rrset.h b/src/lib/datasrc/memory/treenode_rrset.h
index 295a95a..640c972 100644
--- a/src/lib/datasrc/memory/treenode_rrset.h
+++ b/src/lib/datasrc/memory/treenode_rrset.h
@@ -180,12 +180,7 @@ public:
     /// \brief Specialized version of \c getTTL() for \c TreeNodeRRset.
     virtual const dns::RRTTL& getTTL() const;
 
-    /// \brief Specialized version of \c setName() for \c TreeNodeRRset.
-    ///
-    /// It throws \c isc::Unexpected unconditionally.
-    virtual void setName(const dns::Name& name);
-
-    /// \brief Specialized version of \c setName() for \c TreeNodeRRset.
+    /// \brief Specialized version of \c setTTL() for \c TreeNodeRRset.
     ///
     /// It throws \c isc::Unexpected unconditionally.
     virtual void setTTL(const dns::RRTTL& ttl);
diff --git a/src/lib/datasrc/tests/memory/treenode_rrset_unittest.cc b/src/lib/datasrc/tests/memory/treenode_rrset_unittest.cc
index 921ca68..4d1f6e1 100644
--- a/src/lib/datasrc/tests/memory/treenode_rrset_unittest.cc
+++ b/src/lib/datasrc/tests/memory/treenode_rrset_unittest.cc
@@ -661,7 +661,6 @@ TEST_F(TreeNodeRRsetTest, unexpectedMethods) {
     TreeNodeRRset rrset(rrclass_, www_node_, a_rdataset_, true);
 
     EXPECT_THROW(rrset.setTTL(RRTTL(0)), isc::Unexpected);
-    EXPECT_THROW(rrset.setName(Name("example")), isc::Unexpected);
     EXPECT_THROW(rrset.addRdata(createRdata(RRType::A(), rrclass_, "0.0.0.0")),
                  isc::Unexpected);
     RdataPtr sig_rdata = createRdata(
diff --git a/src/lib/dns/python/rrset_python.cc b/src/lib/dns/python/rrset_python.cc
index dc2af22..de5925a 100644
--- a/src/lib/dns/python/rrset_python.cc
+++ b/src/lib/dns/python/rrset_python.cc
@@ -57,7 +57,6 @@ PyObject* RRset_getName(PyObject* self, PyObject* args);
 PyObject* RRset_getClass(PyObject* self, PyObject* args);
 PyObject* RRset_getType(PyObject* self, PyObject* args);
 PyObject* RRset_getTTL(PyObject* self, PyObject* args);
-PyObject* RRset_setName(PyObject* self, PyObject* args);
 PyObject* RRset_setTTL(PyObject* self, PyObject* args);
 PyObject* RRset_toText(PyObject* self, PyObject* args);
 PyObject* RRset_str(PyObject* self);
@@ -79,8 +78,6 @@ PyMethodDef RRset_methods[] = {
       "Returns the type of the RRset as an RRType object." },
     { "get_ttl", RRset_getTTL, METH_NOARGS,
       "Returns the TTL of the RRset as an RRTTL object." },
-    { "set_name", RRset_setName, METH_VARARGS,
-      "Sets the name of the RRset.\nTakes a Name object as an argument." },
     { "set_ttl", RRset_setTTL, METH_VARARGS,
       "Sets the TTL of the RRset.\nTakes an RRTTL object as an argument." },
     { "to_text", RRset_toText, METH_NOARGS,
@@ -207,16 +204,6 @@ RRset_getTTL(PyObject* self, PyObject*) {
 }
 
 PyObject*
-RRset_setName(PyObject* self, PyObject* args) {
-    PyObject* name;
-    if (!PyArg_ParseTuple(args, "O!", &name_type, &name)) {
-        return (NULL);
-    }
-    static_cast<s_RRset*>(self)->cppobj->setName(PyName_ToName(name));
-    Py_RETURN_NONE;
-}
-
-PyObject*
 RRset_setTTL(PyObject* self, PyObject* args) {
     PyObject* rrttl;
     if (!PyArg_ParseTuple(args, "O!", &rrttl_type, &rrttl)) {
diff --git a/src/lib/dns/python/tests/rrset_python_test.py b/src/lib/dns/python/tests/rrset_python_test.py
index 0ffcdbe..9592b42 100644
--- a/src/lib/dns/python/tests/rrset_python_test.py
+++ b/src/lib/dns/python/tests/rrset_python_test.py
@@ -70,11 +70,6 @@ class TestModuleSpec(unittest.TestCase):
         self.assertEqual(RRTTL(0), self.rrset_a.get_ttl());
         self.assertRaises(TypeError, self.rrset_a.set_ttl, 1)
 
-    def test_set_name(self):
-        self.rrset_a.set_name(self.test_nsname);
-        self.assertEqual(self.test_nsname, self.rrset_a.get_name());
-        self.assertRaises(TypeError, self.rrset_a.set_name, 1)
-
     def test_add_rdata(self):
         # no iterator to read out yet (TODO: add addition test once implemented)
 
diff --git a/src/lib/dns/rrset.cc b/src/lib/dns/rrset.cc
index 7ea01d0..0d34d19 100644
--- a/src/lib/dns/rrset.cc
+++ b/src/lib/dns/rrset.cc
@@ -220,11 +220,6 @@ BasicRRset::getTTL() const {
 }
 
 void
-BasicRRset::setName(const Name& name) {
-    impl_->name_ = name;
-}
-
-void
 BasicRRset::setTTL(const RRTTL& ttl) {
     impl_->ttl_ = ttl;
 }
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index 395cbdd..eb8fa6e 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -230,12 +230,6 @@ public:
     /// TTL of the \c RRset.
     virtual const RRTTL& getTTL() const = 0;
 
-    /// \brief Updates the owner name of the \c RRset.
-    ///
-    /// \param name A reference to a \c Name class object to be copied as the
-    /// new name.
-    virtual void setName(const Name& name) = 0;
-
     /// \brief Updates the TTL of the \c RRset.
     ///
     /// \param ttl A reference to a \c RRTTL class object to be copied as the
@@ -680,17 +674,6 @@ public:
     /// TTL of the \c RRset.
     virtual const RRTTL& getTTL() const;
 
-    /// \brief Updates the owner name of the \c RRset.
-    ///
-    /// This method normally does not throw an exception, but could throw
-    /// some standard exception on resource allocation failure if the
-    /// internal copy of the \c name involves resource allocation and it
-    /// fails.
-    ///
-    /// \param name A reference to a \c Name class object to be copied as the
-    /// new name.
-    virtual void setName(const Name& name);
-
     /// \brief Updates the TTL of the \c RRset.
     ///
     /// This method never throws an exception.
@@ -842,14 +825,6 @@ public:
     virtual unsigned int toWire(isc::util::OutputBuffer& buffer) const;
 
     /// \brief Updates the owner name of the \c RRset, including RRSIGs if any
-    virtual void setName(const Name& n) {
-        BasicRRset::setName(n);
-        if (rrsig_) {
-            rrsig_->setName(n);
-        }
-    }
-
-    /// \brief Updates the owner name of the \c RRset, including RRSIGs if any
     virtual void setTTL(const RRTTL& ttl) {
         BasicRRset::setTTL(ttl);
         if (rrsig_) {
diff --git a/src/lib/dns/tests/rrset_unittest.cc b/src/lib/dns/tests/rrset_unittest.cc
index a605caf..0967fce 100644
--- a/src/lib/dns/tests/rrset_unittest.cc
+++ b/src/lib/dns/tests/rrset_unittest.cc
@@ -114,11 +114,6 @@ TEST_F(RRsetTest, setTTL) {
     EXPECT_EQ(RRTTL(0), rrset_a.getTTL());
 }
 
-TEST_F(RRsetTest, setName) {
-    rrset_a.setName(test_nsname);
-    EXPECT_EQ(test_nsname, rrset_a.getName());
-}
-
 TEST_F(RRsetTest, isSameKind) {
     RRset rrset_w(test_name, RRClass::IN(), RRType::A(), RRTTL(3600));
     RRset rrset_x(test_name, RRClass::IN(), RRType::A(), RRTTL(3600));
diff --git a/src/lib/nsas/tests/nameserver_address_store_unittest.cc b/src/lib/nsas/tests/nameserver_address_store_unittest.cc
index ceb5775..a606f26 100644
--- a/src/lib/nsas/tests/nameserver_address_store_unittest.cc
+++ b/src/lib/nsas/tests/nameserver_address_store_unittest.cc
@@ -287,7 +287,10 @@ TEST_F(NameserverAddressStoreTest, emptyLookup) {
     EXPECT_EQ(2, resolver_->requests.size());
 
     // Ask another question with different zone but the same nameserver
-    authority_->setName(Name("example.com."));
+    authority_.reset(new RRset(Name("example.com."), RRClass::IN(), RRType::NS(),
+                               RRTTL(128)));
+    authority_->addRdata(ConstRdataPtr
+                         (new rdata::generic::NS(Name("ns.example.com."))));
     nsas.lookupAndAnswer("example.com.", RRClass::IN(), authority_,
         getCallback());
 
@@ -339,7 +342,10 @@ TEST_F(NameserverAddressStoreTest, unreachableNS) {
     EXPECT_NO_THROW(resolver_->asksIPs(Name("ns.example.com."), 0, 1));
 
     // Ask another question with different zone but the same nameserver
-    authority_->setName(Name("example.com."));
+    authority_.reset(new RRset(Name("example.com."), RRClass::IN(), RRType::NS(),
+                               RRTTL(128)));
+    authority_->addRdata(ConstRdataPtr
+                         (new rdata::generic::NS(Name("ns.example.com."))));
     nsas.lookupAndAnswer("example.com.", RRClass::IN(), authority_,
         getCallback());
 
@@ -356,7 +362,10 @@ TEST_F(NameserverAddressStoreTest, unreachableNS) {
     // When we ask one same and one other zone with the same nameserver,
     // it should generate no questions and answer right away
     nsas.lookup("example.net.", RRClass::IN(), getCallback());
-    authority_->setName(Name("example.org."));
+    authority_.reset(new RRset(Name("example.org."), RRClass::IN(), RRType::NS(),
+                               RRTTL(128)));
+    authority_->addRdata(ConstRdataPtr
+                         (new rdata::generic::NS(Name("ns.example.com."))));
     nsas.lookupAndAnswer("example.org.", RRClass::IN(), authority_,
         getCallback());
 
@@ -427,7 +436,10 @@ TEST_F(NameserverAddressStoreTest, CombinedTest) {
 
     // But when ask for a different zone with the first nameserver, it should
     // ask again, as it is evicted already
-    authority_->setName(Name("example.com."));
+    authority_.reset(new RRset(Name("example.com."), RRClass::IN(), RRType::NS(),
+                               RRTTL(128)));
+    authority_->addRdata(ConstRdataPtr
+                         (new rdata::generic::NS(Name("ns.example.com."))));
     nsas.lookupAndAnswer("example.com.", RRClass::IN(), authority_,
         getCallback());
     EXPECT_EQ(request_count + 2, resolver_->requests.size());
diff --git a/src/lib/nsas/tests/zone_entry_unittest.cc b/src/lib/nsas/tests/zone_entry_unittest.cc
index dc34275..d685fbb 100644
--- a/src/lib/nsas/tests/zone_entry_unittest.cc
+++ b/src/lib/nsas/tests/zone_entry_unittest.cc
@@ -473,11 +473,21 @@ TEST_F(ZoneEntryTest, DirectAnswer) {
     EXPECT_EQ(Fetchable::NOT_ASKED, zone->getState());
     resolver_->addPresetAnswer(Question(Name(EXAMPLE_CO_UK), RRClass::IN(),
         RRType::NS()), rr_single_);
+
     Name ns_name("ns.example.net");
-    rrv4_->setName(ns_name);
+
+    rrv4_.reset(new RRset(ns_name, RRClass::IN(), RRType::A(), RRTTL(1200)));
+    rrv4_->addRdata(ConstRdataPtr(new RdataTest<A>("1.2.3.4")));
+    rrv4_->addRdata(ConstRdataPtr(new RdataTest<A>("5.6.7.8")));
+    rrv4_->addRdata(ConstRdataPtr(new RdataTest<A>("9.10.11.12")));
+
     resolver_->addPresetAnswer(Question(ns_name, RRClass::IN(), RRType::A()),
         rrv4_);
-    rrv6_->setName(ns_name);
+
+    rrv6_.reset(new RRset(ns_name, RRClass::IN(), RRType::AAAA(), RRTTL(900)));
+    rrv6_->addRdata(ConstRdataPtr(new RdataTest<AAAA>("2001::1002")));
+    rrv6_->addRdata(ConstRdataPtr(new RdataTest<AAAA>("dead:beef:feed::")));
+
     resolver_->addPresetAnswer(Question(ns_name, RRClass::IN(),
         RRType::AAAA()), rrv6_);
     // Reset the results



More information about the bind10-changes mailing list