From: JINMEI Tatuya Date: Wed, 12 Oct 2011 17:30:38 +0000 (-0700) Subject: [1294] makde sure the default value of use_ixfr actually applies X-Git-Tag: perftcpdns_before_epoll~66^2~23^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd39e4e890ce175901311b9e11291628743edde4;p=thirdparty%2Fkea.git [1294] makde sure the default value of use_ixfr actually applies (the previous test succeeds just by accident) --- diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py index 0cb7dc2601..2862431a2d 100644 --- a/src/bin/xfrin/tests/xfrin_test.py +++ b/src/bin/xfrin/tests/xfrin_test.py @@ -98,10 +98,15 @@ class XfrinTestTimeoutException(Exception): class MockCC(): 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 MockDataSourceClient(): '''A simple mock data source client. @@ -2076,6 +2081,18 @@ class TestXfrin(unittest.TestCase): # since this has failed, we should still have the previous config self._check_zones_config(config2) + def test_config_handler_zones_default(self): + # Checking it some default config values apply. Using a separate + # test case for a fresh xfr object. + config = { 'zones': [ + { 'name': 'test.example.', + 'master_addr': '192.0.2.1', + 'master_port': 53, + } + ]} + self.assertEqual(self.xfr.config_handler(config)['result'][0], 0) + self._check_zones_config(config) + def common_ixfr_setup(self, xfr_mode, use_ixfr): # This helper method explicitly sets up a zone configuration with # use_ixfr, and invokes either retransfer or refresh.