From: JINMEI Tatuya Date: Wed, 22 May 2013 21:01:07 +0000 (-0700) Subject: [2911] make sure to use default request_ixfr from the spec, not hardcoding it. X-Git-Tag: bind10-1.2.0beta1-release~418^2~9^2~1^2~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73f842441ce26df57c3af30f526b59e3eba884cb;p=thirdparty%2Fkea.git [2911] make sure to use default request_ixfr from the spec, not hardcoding it. also updated the test so the MockCC refers to the spec default, instead of hardcoding the values. --- diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py index 3572a9170a..12def4e957 100644 --- a/src/bin/xfrin/tests/xfrin_test.py +++ b/src/bin/xfrin/tests/xfrin_test.py @@ -129,17 +129,12 @@ class XfrinTestException(Exception): class XfrinTestTimeoutException(Exception): pass -class MockCC(MockModuleCCSession): - def get_default_value(self, identifier): - # The returned values should be identical to the spec file - # XXX: these should be retrieved from the spec file - # (see MyCCSession of xfrout_test.py.in) - if identifier == "zones/master_port": - return TEST_MASTER_PORT - if identifier == "zones/class": - return TEST_RRCLASS_STR - if identifier == "zones/use_ixfr": - return False +class MockCC(MockModuleCCSession, ConfigData): + def __init__(self): + super().__init__() + module_spec = isc.config.module_spec_from_file( + xfrin.SPECFILE_LOCATION) + ConfigData.__init__(self, module_spec) def add_remote_config_by_name(self, name, callback): pass diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in index 2faff0cf30..f13d3ed080 100755 --- a/src/bin/xfrin/xfrin.py.in +++ b/src/bin/xfrin/xfrin.py.in @@ -1373,7 +1373,8 @@ class ZoneInfo: def set_request_ixfr(self, request_ixfr): if request_ixfr is None: - request_ixfr = 'no' # if unspecified, use the default + request_ixfr = \ + self._module_cc.get_default_value("zones/request_ixfr") cfg_to_val = { 'yes': self.REQUEST_IXFR_FIRST, 'only': self.REQUEST_IXFR_ONLY, 'no': self.REQUEST_IXFR_DISABLED }