Commit a01eb512 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1371] Merge branch 'trac1372' into trac1371 with fixing conflicts.

parents 63566271 319bc2d6
......@@ -84,8 +84,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
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
......@@ -96,21 +96,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, create_soa(SOA_CURRENT_VERSION))
elif name == Name('') and rrtype == RRType.SOA():
if name == Name('') and rrtype == RRType.SOA():
return (ZoneFinder.NXDOMAIN, None)
elif name == Name('') and rrtype == RRType.SOA():
soa_rrset = create_soa(SOA_CURRENT_VERSION)
return (ZoneFinder.SUCCESS, soa_rrset)
elif rrtype == RRType.SOA():
return (ZoneFinder.SUCCESS, create_soa(SOA_CURRENT_VERSION))
raise ValueError('Unexpected input to mock finder: bug in test case?')
def get_iterator(self, zone_name, adjust_ttl=False):
if zone_name == Name(''):
......@@ -776,9 +776,6 @@ class TestXfroutSession(TestXfroutSessionBase):
sent_data = self.sock.readsent()
self.assertEqual(len(sent_data), 0)
def default(self, param):
return ""
def test_dns_xfrout_start_notauth(self):
def notauth(msg, name, rrclass):
return Rcode.NOTAUTH()
......@@ -233,6 +233,8 @@ isc.datasrc.NotImplemented.\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\
zone The name of the zone for which the difference should be\n\
......@@ -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 (...) {
"Unexpected exception");
PyErr_SetString(PyExc_SystemError, "Unexpected exception");
return (NULL);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment