BIND 10 trac525, updated. 11ac72d5b4b47f6d5ec9babe68bd423c201c7313 [525] Update other tests in the tree
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 17 03:12:03 UTC 2014
The branch, trac525 has been updated
via 11ac72d5b4b47f6d5ec9babe68bd423c201c7313 (commit)
via f7fb6303725fa6f5325d4c10a6bd3d23c33d7c8e (commit)
via 8306c2fc54ec99cf0e7e4e7f8dcb439dee5e64be (commit)
from 8b98e7536dd0caaab0fc51e5dc82484fbfbb9309 (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 11ac72d5b4b47f6d5ec9babe68bd423c201c7313
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Jan 17 08:16:54 2014 +0530
[525] Update other tests in the tree
commit f7fb6303725fa6f5325d4c10a6bd3d23c33d7c8e
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Jan 17 08:11:58 2014 +0530
[525] Disable unittest (it may have to be removed at some time)
commit 8306c2fc54ec99cf0e7e4e7f8dcb439dee5e64be
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Jan 17 08:08:27 2014 +0530
[525] Add DNAME and SOA also to the list of singleton RR types
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrin/tests/xfrin_test.py | 15 +++++----
src/bin/xfrout/tests/xfrout_test.py.in | 35 ++++++++++++++------
.../datasrc/tests/memory/memory_client_unittest.cc | 2 +-
src/lib/dns/rrtype.cc | 5 ++-
src/lib/dns/tests/rrset_unittest.cc | 18 ++++++++++
src/lib/dns/tests/rrtype_unittest.cc | 2 ++
src/lib/dns/tests/zone_checker_unittest.cc | 22 +++++++-----
src/lib/python/isc/notify/tests/notify_out_test.py | 8 +++--
8 files changed, 78 insertions(+), 29 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py
index 4158638..9fc6bae 100644
--- a/src/bin/xfrin/tests/xfrin_test.py
+++ b/src/bin/xfrin/tests/xfrin_test.py
@@ -995,12 +995,15 @@ class TestAXFR(TestXfrinConnection):
self.assertRaises(XfrinException, self.conn._create_query,
RRType.IXFR)
- self._set_test_zone(Name('dup-soa.example'))
- self.conn._zone_soa = xfrin._get_zone_soa(self.conn._datasrc_client,
- self.conn._zone_name,
- self.conn._rrclass)
- self.assertRaises(XfrinException, self.conn._create_query,
- RRType.IXFR)
+ # Disabled by #525. RRset does not allow adding two Rdata to an
+ # RRset of type SOA.
+
+ # self._set_test_zone(Name('dup-soa.example'))
+ # self.conn._zone_soa = xfrin._get_zone_soa(self.conn._datasrc_client,
+ # self.conn._zone_name,
+ # self.conn._rrclass)
+ # self.assertRaises(XfrinException, self.conn._create_query,
+ # RRType.IXFR)
def test_send_query(self):
def message_has_tsig(data):
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index f7ed1e1..dffbed4 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -340,6 +340,8 @@ class TestXfroutSession(TestXfroutSessionBase):
XfroutSession._handle(self.xfrsess)
self.assertEqual(self.sock.read_msg().get_rcode(), Rcode.REFUSED)
+ @unittest.skip('#525 - RRset does not allow adding two Rdata ' +\
+ 'to an RRset of type SOA')
def test_quota_ok(self):
'''The default case in terms of the xfrout quota.
@@ -662,6 +664,8 @@ class TestXfroutSession(TestXfroutSessionBase):
self.assertEqual(msg.get_rcode(), rcode)
self.assertTrue(msg.get_header_flag(Message.HEADERFLAG_AA))
+ @unittest.skip('#525 - RRset does not allow adding two Rdata ' +\
+ 'to an RRset of type SOA')
def test_send_message_with_last_soa(self):
msg = self.getmsg()
msg.make_response()
@@ -783,6 +787,8 @@ class TestXfroutSession(TestXfroutSessionBase):
def test_get_rrset_len(self):
self.assertEqual(82, get_rrset_len(self.soa_rrset))
+ @unittest.skip('#525 - RRset does not allow adding two Rdata ' +\
+ 'to an RRset of type SOA')
def test_xfrout_axfr_setup(self):
self.xfrsess.ClientClass = MockDataSrcClient
# Successful case. A zone iterator should be set up.
@@ -872,11 +878,15 @@ class TestXfroutSession(TestXfroutSessionBase):
zone_name=zone_name)
self.assertEqual(self.xfrsess._xfrout_setup(
self.getmsg(), zone_name, TEST_RRCLASS), Rcode.SERVFAIL)
- zone_name = Name('multisoa.example.com')
- self.mdata = self.create_request_data(ixfr=IXFR_OK_VERSION,
- zone_name=zone_name)
- self.assertEqual(self.xfrsess._xfrout_setup(
- self.getmsg(), zone_name, TEST_RRCLASS), Rcode.SERVFAIL)
+
+ # Disabled by #525. RRset does not allow adding two Rdata to an
+ # RRset of type SOA.
+
+ # zone_name = Name('multisoa.example.com')
+ # self.mdata = self.create_request_data(ixfr=IXFR_OK_VERSION,
+ # zone_name=zone_name)
+ # self.assertEqual(self.xfrsess._xfrout_setup(
+ # self.getmsg(), zone_name, TEST_RRCLASS), Rcode.SERVFAIL)
# query name doesn't match the SOA's owner
self.mdata = self.create_request_data(ixfr=IXFR_OK_VERSION)
@@ -890,11 +900,14 @@ class TestXfroutSession(TestXfroutSessionBase):
self.assertEqual(self.xfrsess._xfrout_setup(
self.getmsg(), zone_name, TEST_RRCLASS), Rcode.FORMERR)
- # multiple SOA RRs
- self.mdata = self.create_request_data(ixfr=IXFR_OK_VERSION,
- num_soa=2)
- self.assertEqual(self.xfrsess._xfrout_setup(
- self.getmsg(), zone_name, TEST_RRCLASS), Rcode.FORMERR)
+ # Disabled by #525. RRset does not allow adding two Rdata to an
+ # RRset of type SOA.
+
+ # # multiple SOA RRs
+ # self.mdata = self.create_request_data(ixfr=IXFR_OK_VERSION,
+ # num_soa=2)
+ # self.assertEqual(self.xfrsess._xfrout_setup(
+ # self.getmsg(), zone_name, TEST_RRCLASS), Rcode.FORMERR)
def test_dns_xfrout_start_formerror(self):
# formerror
@@ -954,6 +967,8 @@ class TestXfroutSession(TestXfroutSessionBase):
'zones', TEST_RRCLASS_STR, TEST_ZONE_NAME_STR,
'xfrreqdone'), 0)
+ @unittest.skip('#525 - RRset does not allow adding two Rdata ' +\
+ 'to an RRset of type SOA')
def test_reply_xfrout_query_axfr(self):
self.xfrsess._soa = self.soa_rrset
self.xfrsess._iterator = [self.soa_rrset]
diff --git a/src/lib/datasrc/tests/memory/memory_client_unittest.cc b/src/lib/datasrc/tests/memory/memory_client_unittest.cc
index d91bbb3..5c5eb99 100644
--- a/src/lib/datasrc/tests/memory/memory_client_unittest.cc
+++ b/src/lib/datasrc/tests/memory/memory_client_unittest.cc
@@ -489,7 +489,7 @@ TEST_F(MemoryClientTest, loadMultipleDNAMEThrows) {
zclass_,
TEST_DATA_DIR
"/example.org-multiple-dname.zone"),
- ZoneDataUpdater::AddError);
+ isc::datasrc::ZoneLoaderException);
// Teardown checks for memory segment leaks
}
diff --git a/src/lib/dns/rrtype.cc b/src/lib/dns/rrtype.cc
index 21a8485..52dfbdc 100644
--- a/src/lib/dns/rrtype.cc
+++ b/src/lib/dns/rrtype.cc
@@ -62,7 +62,10 @@ RRType::toWire(AbstractMessageRenderer& renderer) const {
bool
RRType::isSingleton(const RRType& rrtype) {
- if (rrtype == RRType::CNAME()) {
+ if ((rrtype == RRType::CNAME()) ||
+ (rrtype == RRType::SOA()) ||
+ (rrtype == RRType::DNAME()))
+ {
return (true);
} else {
return (false);
diff --git a/src/lib/dns/tests/rrset_unittest.cc b/src/lib/dns/tests/rrset_unittest.cc
index 5f9651a..c92771f 100644
--- a/src/lib/dns/tests/rrset_unittest.cc
+++ b/src/lib/dns/tests/rrset_unittest.cc
@@ -173,6 +173,7 @@ TEST_F(RRsetTest, addRdataPtr) {
}
TEST_F(RRsetTest, addRdataPtrForSingleton) {
+ // CNAME can only have a single RDATA.
RRset rrset_cname(test_name, RRClass::IN(), RRType::CNAME(), RRTTL(3600));
EXPECT_EQ(0, rrset_cname.getRdataCount());
rrset_cname.addRdata(createRdata(rrset_cname.getType(),
@@ -185,6 +186,23 @@ TEST_F(RRsetTest, addRdataPtrForSingleton) {
"bar.example.com."));
}, isc::InvalidOperation);
EXPECT_EQ(1, rrset_cname.getRdataCount());
+
+ // Let's try one more with SOA. SOA can also only have a single
+ // RDATA.
+ RRset rrset_soa(test_name, RRClass::IN(), RRType::SOA(), RRTTL(3600));
+ EXPECT_EQ(0, rrset_soa.getRdataCount());
+ rrset_soa.addRdata(createRdata(rrset_soa.getType(),
+ rrset_soa.getClass(),
+ "ns.example.com. root.example.com. "
+ "2010012601 3600 300 3600000 1200"));
+ EXPECT_EQ(1, rrset_soa.getRdataCount());
+ EXPECT_THROW({
+ rrset_soa.addRdata(createRdata(rrset_soa.getType(),
+ rrset_soa.getClass(),
+ "ns2.example.com. root2.example.com. "
+ "2010012601 3600 300 3600000 1200"));
+ }, isc::InvalidOperation);
+ EXPECT_EQ(1, rrset_soa.getRdataCount());
}
TEST_F(RRsetTest, iterator) {
diff --git a/src/lib/dns/tests/rrtype_unittest.cc b/src/lib/dns/tests/rrtype_unittest.cc
index 0aabeac..97d95cc 100644
--- a/src/lib/dns/tests/rrtype_unittest.cc
+++ b/src/lib/dns/tests/rrtype_unittest.cc
@@ -141,6 +141,8 @@ TEST_F(RRTypeTest, compare) {
TEST_F(RRTypeTest, isSingleton) {
EXPECT_TRUE(RRType::isSingleton(RRType::CNAME()));
+ EXPECT_TRUE(RRType::isSingleton(RRType::DNAME()));
+ EXPECT_TRUE(RRType::isSingleton(RRType::SOA()));
EXPECT_FALSE(RRType::isSingleton(RRType::A()));
}
diff --git a/src/lib/dns/tests/zone_checker_unittest.cc b/src/lib/dns/tests/zone_checker_unittest.cc
index 320cda6..481c8e4 100644
--- a/src/lib/dns/tests/zone_checker_unittest.cc
+++ b/src/lib/dns/tests/zone_checker_unittest.cc
@@ -140,15 +140,6 @@ TEST_F(ZoneCheckerTest, checkSOA) {
EXPECT_FALSE(checkZone(zname_, zclass_, *rrsets_, noerror_callbacks));
checkIssues();
- // If there are more than 1 SOA RR, it's also an error.
- errors_.clear();
- soa_->addRdata(generic::SOA(soa_txt));
- soa_->addRdata(generic::SOA("ns2.example.com. . 0 0 0 0 0"));
- rrsets_->addRRset(soa_);
- EXPECT_FALSE(checkZone(zname_, zclass_, *rrsets_, callbacks_));
- expected_errors_.push_back("zone example.com/IN: has 2 SOA records");
- checkIssues();
-
// If the SOA RRset is "empty", it's treated as an implementation
// (rather than operational) error and results in an exception.
rrsets_->removeRRset(zname_, zclass_, RRType::SOA());
@@ -166,6 +157,19 @@ TEST_F(ZoneCheckerTest, checkSOA) {
checkIssues(); // no error/warning should be reported
}
+// Disabled by #525. This case can no longer happen as RRset does not
+// allow adding two Rdata to an RRset of type SOA.
+TEST_F(ZoneCheckerTest, DISABLED_checkSOAMultiple) {
+ // If there are more than 1 SOA RR, it's also an error.
+ errors_.clear();
+ soa_->addRdata(generic::SOA(soa_txt));
+ soa_->addRdata(generic::SOA("ns2.example.com. . 0 0 0 0 0"));
+ rrsets_->addRRset(soa_);
+ EXPECT_FALSE(checkZone(zname_, zclass_, *rrsets_, callbacks_));
+ expected_errors_.push_back("zone example.com/IN: has 2 SOA records");
+ checkIssues();
+}
+
TEST_F(ZoneCheckerTest, checkNS) {
// If the zone has no NS at origin it triggers an error.
rrsets_->removeRRset(zname_, zclass_, RRType::NS());
diff --git a/src/lib/python/isc/notify/tests/notify_out_test.py b/src/lib/python/isc/notify/tests/notify_out_test.py
index ec4df0d..0dc9f87 100644
--- a/src/lib/python/isc/notify/tests/notify_out_test.py
+++ b/src/lib/python/isc/notify/tests/notify_out_test.py
@@ -471,8 +471,12 @@ class TestNotifyOut(unittest.TestCase):
Name('nons.example'), RRClass.IN))
self.assertEqual([], self._notify._get_notify_slaves_from_ns(
Name('nosoa.example'), RRClass.IN))
- self.assertEqual([], self._notify._get_notify_slaves_from_ns(
- Name('multisoa.example'), RRClass.IN))
+
+ # Disabled by #525. RRset does not allow adding two Rdata to an
+ # RRset of type SOA.
+
+ # self.assertEqual([], self._notify._get_notify_slaves_from_ns(
+ # Name('multisoa.example'), RRClass.IN))
self.assertEqual([], self._notify._get_notify_slaves_from_ns(
Name('nosuchzone.example'), RRClass.IN))
More information about the bind10-changes
mailing list