BIND 10 trac1372, updated. 319bc2d65301606aa938363dcb30a8519755886e [1372] cleanup: removed an unused method in a test class.
BIND 10 source code commits
bind10-changes at lists.isc.org
Sun Nov 20 02:08:03 UTC 2011
The branch, trac1372 has been updated
via 319bc2d65301606aa938363dcb30a8519755886e (commit)
via d953caeeaf821743ed27ef4a47a45bef66615dc9 (commit)
via 5d382b4295b8455fae844a5ca94886788f6cb19b (commit)
via d08c42ad20f2c91bf64ef47ed893fa2aac4ff037 (commit)
from ecf6a71b5845c6710119dd97b500c7edeb3f44c2 (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 319bc2d65301606aa938363dcb30a8519755886e
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Nov 19 18:02:14 2011 -0800
[1372] cleanup: removed an unused method in a test class.
commit d953caeeaf821743ed27ef4a47a45bef66615dc9
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Nov 19 17:52:49 2011 -0800
[1372] in get_journal_reader(), converted std::exception and other C++
exception to Python SystemError instead of datasrc.Error.
commit 5d382b4295b8455fae844a5ca94886788f6cb19b
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Nov 19 17:27:51 2011 -0800
[1372] simplified the code of MockDataSrcClient.find() and updated the
docstring accordingly.
commit d08c42ad20f2c91bf64ef47ed893fa2aac4ff037
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Nov 19 17:22:33 2011 -0800
[1372] fixed docstring to match the implementation. the previous one
was a naive copy of a similar fake method used in a different test.
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrout/tests/xfrout_test.py.in | 19 ++++++++-----------
src/lib/python/isc/datasrc/client_inc.cc | 2 ++
src/lib/python/isc/datasrc/client_python.cc | 5 ++---
3 files changed, 12 insertions(+), 14 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index 572b529..fea345d 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -98,8 +98,8 @@ class MockDataSrcClient:
'''Mock version of find_zone().
It returns itself (subsequently acting as a mock ZoneFinder) for
- some test zone names. For some others it returns either NOTFOUND
- or PARTIALMATCH.
+ some test zone names. For a special name it returns NOTFOUND to
+ emulate the condition where the specified zone doen't exist.
'''
self._zone_name = zone_name
@@ -110,21 +110,21 @@ class MockDataSrcClient:
def find(self, name, rrtype, target, options):
'''Mock ZoneFinder.find().
- It returns the predefined SOA RRset to queries for SOA of the common
- test zone name. It also emulates some unusual cases for special
+ (At the moment) this method only handles query for type SOA.
+ By default it returns a normal SOA RR(set) whose owner name is
+ the query name It also emulates some unusual cases for special
zone names.
'''
- if name == TEST_ZONE_NAME and rrtype == RRType.SOA():
- return (ZoneFinder.SUCCESS, self.__create_soa())
- elif name == Name('nosoa.example.com') and rrtype == RRType.SOA():
+ if name == Name('nosoa.example.com') and rrtype == RRType.SOA():
return (ZoneFinder.NXDOMAIN, None)
elif name == Name('multisoa.example.com') and rrtype == RRType.SOA():
soa_rrset = self.__create_soa()
soa_rrset.add_rdata(soa_rrset.get_rdata()[0])
return (ZoneFinder.SUCCESS, soa_rrset)
- else:
+ elif rrtype == RRType.SOA():
return (ZoneFinder.SUCCESS, self.__create_soa())
+ raise ValueError('Unexpected input to mock finder: bug in test case?')
def get_iterator(self, zone_name, adjust_ttl=False):
if zone_name == Name('notauth.example.com'):
@@ -786,9 +786,6 @@ class TestXfroutSession(TestXfroutSessionBase):
sent_data = self.sock.readsent()
self.assertEqual(len(sent_data), 0)
- def default(self, param):
- return "example.com"
-
def test_dns_xfrout_start_notauth(self):
def notauth(msg, name, rrclass):
return Rcode.NOTAUTH()
diff --git a/src/lib/python/isc/datasrc/client_inc.cc b/src/lib/python/isc/datasrc/client_inc.cc
index 8d30211..d435ef7 100644
--- a/src/lib/python/isc/datasrc/client_inc.cc
+++ b/src/lib/python/isc/datasrc/client_inc.cc
@@ -232,6 +232,8 @@ isc.datasrc.NotImplemented.\n\
Exceptions:\n\
isc.datasrc.NotImplemented The data source does not support differences.\n\
isc.datasrc.Error Other operational errors at the data source level.\n\
+ SystemError An unexpected error in the backend C++ code. Either a rare\n\
+ system error such as short memory or an implementation bug.\n\
\n\
Parameters:\n\
zone The name of the zone for which the difference should be\n\
diff --git a/src/lib/python/isc/datasrc/client_python.cc b/src/lib/python/isc/datasrc/client_python.cc
index 6636a92..aee8824 100644
--- a/src/lib/python/isc/datasrc/client_python.cc
+++ b/src/lib/python/isc/datasrc/client_python.cc
@@ -203,10 +203,9 @@ DataSourceClient_getJournalReader(PyObject* po_self, PyObject* args) {
} catch (const DataSourceError& ex) {
PyErr_SetString(getDataSourceException("Error"), ex.what());
} catch (const std::exception& ex) {
- PyErr_SetString(getDataSourceException("Error"), ex.what());
+ PyErr_SetString(PyExc_SystemError, ex.what());
} catch (...) {
- PyErr_SetString(getDataSourceException("Error"),
- "Unexpected exception");
+ PyErr_SetString(PyExc_SystemError, "Unexpected exception");
}
}
return (NULL);
More information about the bind10-changes
mailing list