module_spec = isc.config.module_spec_from_file(
xfrin.SPECFILE_LOCATION)
ConfigData.__init__(self, module_spec)
+ # For inspection
+ self.added_remote_modules = []
def add_remote_config_by_name(self, name, callback):
- pass
+ self.added_remote_modules.append((name, callback))
def get_remote_config_value(self, module, identifier):
if module == 'tsig_keys' and identifier == 'keys':
sys.stderr.close()
sys.stderr = self.stderr_backup
+ def test_init(self):
+ """Check some initial configuration after construction"""
+ # data source "module" should have been registrered as a necessary
+ # remote config
+ self.assertEqual([('data_sources', self.xfr._datasrc_config_handler)],
+ self.xfr._module_cc.added_remote_modules)
+
def _do_parse_zone_name_class(self):
return self.xfr._parse_zone_name_and_class(self.args)
self._cc_setup()
config_data = self._module_cc.get_full_config()
self.config_handler(config_data)
+ self._module_cc.add_remote_config_by_name('data_sources',
+ self._datasrc_config_handler)
init_keyring(self._module_cc)
def _cc_setup(self):
# listening session will block the send operation.
self._send_cc_session = isc.cc.Session()
self._module_cc = isc.config.ModuleCCSession(SPECFILE_LOCATION,
- self.config_handler,
- self.command_handler)
+ self.config_handler,
+ self.command_handler)
self._module_cc.start()
# TBD: this will be removed in this branch
self._module_cc.add_remote_config(AUTH_SPECFILE_LOCATION,
# Config handler for changes in Auth configuration
self._set_db_file()
+ def _datasrc_config_handler(self, new_config, config_data):
+ pass
+
def shutdown(self):
''' shutdown the xfrin process. the thread which is doing xfrin should be
terminated.