BIND 10 trac213-incremental-config, updated. 388e77cae5d9260bcc314465f6711bcdd782a26d [213] Reimport more component tests
BIND 10 source code commits
bind10-changes at lists.isc.org
Sun Nov 6 14:02:20 UTC 2011
The branch, trac213-incremental-config has been updated
via 388e77cae5d9260bcc314465f6711bcdd782a26d (commit)
via 96c94d6baf0a68b641cc9b93966b09b38ebaa15b (commit)
via 67a11e710e06647dfb65ea6e592fd80851422dad (commit)
via b4b9c3e18f8d76b695d7b84f1b128ccba229d814 (commit)
via bb76c3f643eb85fc8b1ed8087f72368ad1d23aa3 (commit)
from 1d9614bc52634bd512121f34af66290a2cdb2958 (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 388e77cae5d9260bcc314465f6711bcdd782a26d
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Sun Nov 6 14:53:44 2011 +0100
[213] Reimport more component tests
commit 96c94d6baf0a68b641cc9b93966b09b38ebaa15b
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Sun Nov 6 14:41:36 2011 +0100
[213] Adapt tests
commit 67a11e710e06647dfb65ea6e592fd80851422dad
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Nov 3 14:05:36 2011 +0100
[213] Import the configuration again
Tests need to be updated.
commit b4b9c3e18f8d76b695d7b84f1b128ccba229d814
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Nov 3 13:49:19 2011 +0100
[213] Configuration in spec file
commit bb76c3f643eb85fc8b1ed8087f72368ad1d23aa3
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Nov 3 13:47:45 2011 +0100
[213] Cleanups
Remove few methods that are no longer used, update a test comment.
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/bind10_src.py.in | 138 +--------------
src/bin/bind10/bob.spec | 68 ++++++-
src/bin/bind10/tests/bind10_test.py.in | 305 +++++++++++++++++++++-----------
3 files changed, 269 insertions(+), 242 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/bind10_src.py.in b/src/bin/bind10/bind10_src.py.in
index 6c9c79a..a5e75a0 100755
--- a/src/bin/bind10/bind10_src.py.in
+++ b/src/bin/bind10/bind10_src.py.in
@@ -314,63 +314,14 @@ class BoB:
# If this is initial update, don't do anything now, leave it to startup
if not self.runnable:
return
- # Now we declare few functions used only internally here. Besides the
- # benefit of not polluting the name space, they are closures, so we
- # don't need to pass some variables
- def start_stop(name, started, start, stop):
- if not'start_' + name in new_config:
- return
- if new_config['start_' + name]:
- if not started:
- if self.uid is not None:
- logger.info(BIND10_START_AS_NON_ROOT, name)
- start()
- else:
- stop()
- # These four functions are passed to start_stop (smells like functional
- # programming little bit)
- def resolver_on():
- self.component_config['b10-resolver'] = { 'kind': 'needed',
- 'special': 'resolver' }
- self.__propagate_component_config(self.component_config)
- self.started_resolver_family = True
- def resolver_off():
- if 'b10-resolver' in self.component_config:
- del self.component_config['b10-resolver']
- self.__propagate_component_config(self.component_config)
- self.started_resolver_family = False
- def auth_on():
- self.component_config['b10-auth'] = { 'kind': 'needed',
- 'special': 'auth' }
- self.component_config['b10-xfrout'] = { 'kind': 'dispensable',
- 'address': 'Xfrout' }
- self.component_config['b10-xfrin'] = { 'kind': 'dispensable',
- 'special': 'xfrin' }
- self.component_config['b10-zonemgr'] = { 'kind': 'dispensable',
- 'address': 'Zonemgr' }
- self.__propagate_component_config(self.component_config)
- self.started_auth_family = True
- def auth_off():
- if 'b10-zonemgr' in self.component_config:
- del self.component_config['b10-zonemgr']
- if 'b10-xfrin' in self.component_config:
- del self.component_config['b10-xfrin']
- if 'b10-xfrout' in self.component_config:
- del self.component_config['b10-xfrout']
- if 'b10-auth' in self.component_config:
- del self.component_config['b10-auth']
- self.__propagate_component_config(self.component_config)
- self.started_auth_family = False
-
- # The real code of the config handler function follows here
logger.debug(DBG_COMMANDS, BIND10_RECEIVED_NEW_CONFIGURATION,
new_config)
- start_stop('resolver', self.started_resolver_family, resolver_on,
- resolver_off)
- start_stop('auth', self.started_auth_family, auth_on, auth_off)
-
- answer = isc.config.ccsession.create_answer(0)
- return answer
+ try:
+ if 'components' in new_config:
+ self.__propagate_component_config(new_config['components'])
+ return isc.config.ccsession.create_answer(0)
+ except Exception as e:
+ return isc.config.ccsession.create_answer(1, str(e))
def get_processes(self):
pids = list(self.processes.keys())
@@ -445,20 +396,12 @@ class BoB:
"""
Reads the parameters associated with the BoB module itself.
- At present these are the components to start although arguably this
- information should be in the configuration for the appropriate
- module itself. (However, this would cause difficulty in the case of
- xfrin/xfrout and zone manager as we don't need to start those if we
- are not running the authoritative server.)
+ This means the list of components we should start now.
"""
logger.info(BIND10_READING_BOSS_CONFIGURATION)
config_data = self.ccs.get_full_config()
- self.cfg_start_auth = config_data.get("start_auth")
- self.cfg_start_resolver = config_data.get("start_resolver")
-
- logger.info(BIND10_CONFIGURATION_START_AUTH, self.cfg_start_auth)
- logger.info(BIND10_CONFIGURATION_START_RESOLVER, self.cfg_start_resolver)
+ self.__propagate_component_config(config_data['components'])
def log_starting(self, process, port = None, address = None):
"""
@@ -738,54 +681,7 @@ class BoB:
# configuration may override the "-v" switch set on the command line.
self.read_bind10_config()
- # Continue starting the processes. The authoritative server (if
- # selected):
- component_config = {}
- if self.cfg_start_auth:
- component_config['b10-auth'] = { 'kind': 'needed',
- 'special': 'auth' }
- self.__propagate_component_config(component_config)
-
- # ... and resolver (if selected):
- if self.cfg_start_resolver:
- component_config['b10-resolver'] = { 'kind': 'needed',
- 'special': 'resolver' }
- self.started_resolver_family = True
- self.__propagate_component_config(component_config)
-
- # Everything after the main components can run as non-root.
- # TODO: this is only temporary - once the privileged socket creator is
- # fully working, nothing else will run as root.
- if self.uid is not None:
- posix.setuid(self.uid)
-
- # xfrin/xfrout and the zone manager are only meaningful if the
- # authoritative server has been started.
- if self.cfg_start_auth:
- component_config['b10-xfrout'] = { 'kind': 'dispensable',
- 'address': 'Xfrout' }
- component_config['b10-xfrin'] = { 'kind': 'dispensable',
- 'special': 'xfrin' }
- component_config['b10-zonemgr'] = { 'kind': 'dispensable',
- 'address': 'Zonemgr' }
- self.__propagate_component_config(component_config)
- self.started_auth_family = True
-
- # ... and finally start the remaining processes
- component_config['b10-stats'] = { 'kind': 'dispensable',
- 'address': 'Stats' }
- component_config['b10-stats-httpd'] = { 'kind': 'dispensable',
- 'address': 'StatsHttpd' }
- component_config['b10-cmdctl'] = { 'kind': 'needed',
- 'special': 'cmdctl' }
-
- if self.cfg_start_dhcp6:
- component_config['b10-dhcp6'] = { 'kind': 'dispensable',
- 'address': 'DHCP6' }
-
- self.__propagate_component_config(component_config)
-
- self.component_config = component_config
+ # TODO: Return the dropping of privileges
def startup(self):
"""
@@ -850,22 +746,6 @@ class BoB:
else:
self.runnable = False
- # Series of stop_process wrappers
- def stop_resolver(self):
- self.stop_process('b10-resolver', 'Resolver')
-
- def stop_auth(self):
- self.stop_process('b10-auth', 'Auth')
-
- def stop_xfrout(self):
- self.stop_process('b10-xfrout', 'Xfrout')
-
- def stop_xfrin(self):
- self.stop_process('b10-xfrin', 'Xfrin')
-
- def stop_zonemgr(self):
- self.stop_process('b10-zonemgr', 'Zonemgr')
-
def shutdown(self):
"""Stop the BoB instance."""
logger.info(BIND10_SHUTDOWN)
diff --git a/src/bin/bind10/bob.spec b/src/bin/bind10/bob.spec
index b4cfac6..babca95 100644
--- a/src/bin/bind10/bob.spec
+++ b/src/bin/bind10/bob.spec
@@ -4,16 +4,66 @@
"module_description": "Master process",
"config_data": [
{
- "item_name": "start_auth",
- "item_type": "boolean",
+ "item_name": "components",
+ "item_type": "named_set",
"item_optional": false,
- "item_default": true
- },
- {
- "item_name": "start_resolver",
- "item_type": "boolean",
- "item_optional": false,
- "item_default": false
+ "item_default": {
+ "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
+ "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
+ "b10-auth": { "special": "auth", "kind": "needed" },
+ "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
+ "b10-stats": { "address": "Stats", "kind": "dispensable" },
+ "b10-stats-httpd": {
+ "address": "StatsHttpd",
+ "kind": "dispensable"
+ },
+ "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+ },
+ "named_set_item_spec": {
+ "item_name": "component",
+ "item_type": "map",
+ "item_optional": false,
+ "item_default": { },
+ "map_item_spec": [
+ {
+ "item_name": "special",
+ "item_optional": true,
+ "item_type": "string"
+ },
+ {
+ "item_name": "process",
+ "item_optional": true,
+ "item_type": "string"
+ },
+ {
+ "item_name": "kind",
+ "item_optional": false,
+ "item_type": "string",
+ "item_default": "dispensable"
+ },
+ {
+ "item_name": "address",
+ "item_optional": true,
+ "item_type": "string"
+ },
+ {
+ "item_name": "params",
+ "item_optional": true,
+ "item_type": "list",
+ "list_item_spec": {
+ "item_name": "param",
+ "item_optional": false,
+ "item_type": "string",
+ "item_default": ""
+ }
+ },
+ {
+ "item_name": "priority",
+ "item_optional": true,
+ "item_type": "integer"
+ }
+ ]
+ }
}
],
"commands": [
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index 37b4ab4..45367b5 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -278,7 +278,6 @@ class MockBob(BoB):
def start_simple(self, name):
procmap = { 'b10-xfrout': self.start_xfrout,
- 'b10-xfrin': self.start_xfrin,
'b10-zonemgr': self.start_zonemgr,
'b10-stats': self.start_stats,
'b10-stats-httpd': self.start_stats_httpd,
@@ -324,13 +323,13 @@ class MockBob(BoB):
return procinfo
def start_dhcp6(self):
- self.stats = True
+ self.dhcp6 = True
procinfo = ProcessInfo('b10-dhcp6', ['/bin/false'])
procinfo.pid = 13
return procinfo
def start_dhcp4(self):
- self.stats = True
+ self.dhcp4 = True
procinfo = ProcessInfo('b10-dhcp4', ['/bin/false'])
procinfo.pid = 14
return procinfo
@@ -346,9 +345,7 @@ class MockBob(BoB):
'b10-cmdctl': self.stop_cmdctl }
procmap[process]()
- # We don't really use all of these stop_ methods. But it might turn out
- # someone would add some stop_ method to BoB and we want that one overriden
- # in case he forgets to update the tests.
+ # Some functions to pretend we stop processes, use by stop_process
def stop_msgq(self):
if self.msgq:
del self.processes[2]
@@ -467,70 +464,28 @@ class TestStartStopProcessesBob(unittest.TestCase):
"""
Check if proper combinations of DHCPv4 and DHCpv6 can be started
"""
- v4found = 'b10-dhcp4' in bob.component_config
- v6found = 'b10-dhcp6' in bob.component_config
-
- # there should be exactly one DHCPv4 daemon (if v4==True)
- # there should be exactly one DHCPv6 daemon (if v6==True)
- self.assertEqual(v4==True, v4found==1)
- self.assertEqual(v6==True, v6found==1)
+ self.assertEqual(v4, bob.dhcp4)
+ self.assertEqual(v6, bob.dhcp6)
self.check_environment_unchanged()
- # Checks the processes started when starting neither auth nor resolver
- # is specified.
- def test_start_none(self):
- # Create BoB and ensure correct initialization
- bob = MockBob()
- self.check_preconditions(bob)
-
- # Start processes and check what was started
- bob.cfg_start_auth = False
- bob.cfg_start_resolver = False
-
- bob.start_all_processes()
- self.check_started_none(bob)
-
- # Checks the processes started when starting only the auth process
- def test_start_auth(self):
- # Create BoB and ensure correct initialization
- bob = MockBob()
- self.check_preconditions(bob)
-
- # Start processes and check what was started
- bob.cfg_start_auth = True
- bob.cfg_start_resolver = False
-
- bob.start_all_processes()
-
- self.check_started_auth(bob)
-
- # Checks the processes started when starting only the resolver process
- def test_start_resolver(self):
- # Create BoB and ensure correct initialization
- bob = MockBob()
- self.check_preconditions(bob)
-
- # Start processes and check what was started
- bob.cfg_start_auth = False
- bob.cfg_start_resolver = True
-
- bob.start_all_processes()
-
- self.check_started_resolver(bob)
-
- # Checks the processes started when starting both auth and resolver process
- def test_start_both(self):
- # Create BoB and ensure correct initialization
- bob = MockBob()
- self.check_preconditions(bob)
-
- # Start processes and check what was started
- bob.cfg_start_auth = True
- bob.cfg_start_resolver = True
-
- bob.start_all_processes()
-
- self.check_started_both(bob)
+ def construct_config(self, start_auth, start_resolver):
+ # The things that are common, not turned on an off
+ config = {}
+ config['b10-stats'] = { 'kind': 'dispensable', 'address': 'Stats' }
+ config['b10-stats-httpd'] = { 'kind': 'dispensable',
+ 'address': 'StatsHttpd' }
+ config['b10-cmdctl'] = { 'kind': 'needed', 'special': 'cmdctl' }
+ if start_auth:
+ config['b10-auth'] = { 'kind': 'needed', 'special': 'auth' }
+ config['b10-xfrout'] = { 'kind': 'dispensable',
+ 'address': 'Xfrout' }
+ config['b10-xfrin'] = { 'kind': 'dispensable', 'special': 'xfrin' }
+ config['b10-zonemgr'] = { 'kind': 'dispensable',
+ 'address': 'Zonemgr' }
+ if start_resolver:
+ config['b10-resolver'] = { 'kind': 'needed',
+ 'special': 'resolver' }
+ return {'components': config}
def test_config_start(self):
"""
@@ -542,17 +497,14 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob = MockBob()
self.check_preconditions(bob)
- # Start processes (nothing much should be started, as in
- # test_start_none)
- bob.cfg_start_auth = False
- bob.cfg_start_resolver = False
-
bob.start_all_processes()
bob.runnable = True
+ bob._BoB_started = True
+ bob.config_handler(self.construct_config(False, False))
self.check_started_none(bob)
# Enable both at once
- bob.config_handler({'start_auth': True, 'start_resolver': True})
+ bob.config_handler(self.construct_config(True, True))
self.check_started_both(bob)
# Not touched by empty change
@@ -560,11 +512,11 @@ class TestStartStopProcessesBob(unittest.TestCase):
self.check_started_both(bob)
# Not touched by change to the same configuration
- bob.config_handler({'start_auth': True, 'start_resolver': True})
+ bob.config_handler(self.construct_config(True, True))
self.check_started_both(bob)
# Turn them both off again
- bob.config_handler({'start_auth': False, 'start_resolver': False})
+ bob.config_handler(self.construct_config(False, False))
self.check_started_none(bob)
# Not touched by empty change
@@ -572,31 +524,31 @@ class TestStartStopProcessesBob(unittest.TestCase):
self.check_started_none(bob)
# Not touched by change to the same configuration
- bob.config_handler({'start_auth': False, 'start_resolver': False})
+ bob.config_handler(self.construct_config(False, False))
self.check_started_none(bob)
# Start and stop auth separately
- bob.config_handler({'start_auth': True})
+ bob.config_handler(self.construct_config(True, False))
self.check_started_auth(bob)
- bob.config_handler({'start_auth': False})
+ bob.config_handler(self.construct_config(False, False))
self.check_started_none(bob)
# Start and stop resolver separately
- bob.config_handler({'start_resolver': True})
+ bob.config_handler(self.construct_config(False, True))
self.check_started_resolver(bob)
- bob.config_handler({'start_resolver': False})
+ bob.config_handler(self.construct_config(False, False))
self.check_started_none(bob)
# Alternate
- bob.config_handler({'start_auth': True})
+ bob.config_handler(self.construct_config(True, False))
self.check_started_auth(bob)
- bob.config_handler({'start_auth': False, 'start_resolver': True})
+ bob.config_handler(self.construct_config(False, True))
self.check_started_resolver(bob)
- bob.config_handler({'start_auth': True, 'start_resolver': False})
+ bob.config_handler(self.construct_config(True, False))
self.check_started_auth(bob)
def test_config_start_once(self):
@@ -607,12 +559,10 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob = MockBob()
self.check_preconditions(bob)
- # Start processes (both)
- bob.cfg_start_auth = True
- bob.cfg_start_resolver = True
-
bob.start_all_processes()
+ bob._BoB_started = True
bob.runnable = True
+ bob.config_handler(self.construct_config(True, True))
self.check_started_both(bob)
bob.start_auth = lambda: self.fail("Started auth again")
@@ -622,8 +572,7 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob.start_resolver = lambda: self.fail("Started resolver again")
# Send again we want to start them. Should not do it, as they are.
- bob.config_handler({'start_auth': True})
- bob.config_handler({'start_resolver': True})
+ bob.config_handler(self.construct_config(True, True))
def test_config_not_started_early(self):
"""
@@ -648,29 +597,24 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob = MockBob()
self.check_preconditions(bob)
- # don't care about DNS stuff
- bob.cfg_start_auth = False
- bob.cfg_start_resolver = False
-
- # v4 and v6 disabled
- bob.cfg_start_dhcp6 = False
- bob.cfg_start_dhcp4 = False
bob.start_all_processes()
+ bob._BoB_started = True
+ bob.runnable = True
+ bob.config_handler(self.construct_config(False, False))
self.check_started_dhcp(bob, False, False)
def test_start_dhcp_v6only(self):
# Create BoB and ensure correct initialization
bob = MockBob()
self.check_preconditions(bob)
-
- # don't care about DNS stuff
- bob.cfg_start_auth = False
- bob.cfg_start_resolver = False
-
# v6 only enabled
- bob.cfg_start_dhcp6 = True
- bob.cfg_start_dhcp4 = False
bob.start_all_processes()
+ bob.runnable = True
+ bob._BoB_started = True
+ config = self.construct_config(False, False)
+ config['components']['b10-dhcp6'] = { 'kind': 'needed',
+ 'address': 'Dhcp6' }
+ bob.config_handler(config)
self.check_started_dhcp(bob, False, True)
# uncomment when dhcpv4 becomes implemented
@@ -857,6 +801,159 @@ class TestBrittle(unittest.TestCase):
sys.stdout = old_stdout
self.assertFalse(bob.runnable)
+class TestBossComponents(unittest.TestCase):
+ """
+ Test the boss propagates component configuration properly to the
+ component configurator and acts sane.
+ """
+ def setUp(self):
+ self.__param = None
+ self.__called = False
+ self.__compconfig = {
+ 'comp': {
+ 'kind': 'needed',
+ 'process': 'cat'
+ }
+ }
+
+ def __unary_hook(self, param):
+ """
+ A hook function that stores the parameter for later examination.
+ """
+ self.__param = param
+
+ def __nullary_hook(self):
+ """
+ A hook function that notes down it was called.
+ """
+ self.__called = True
+
+ def __check_core(self, config):
+ """
+ A function checking that the config contains parts for the valid
+ core component configuration.
+ """
+ self.assertIsNotNone(config)
+ for component in ['sockcreator', 'msgq', 'cfgmgr']:
+ self.assertTrue(component in config)
+ self.assertEqual(component, config[component]['special'])
+ self.assertEqual('core', config[component]['kind'])
+
+ def __check_extended(self, config):
+ """
+ This checks that the config contains the core and one more component.
+ """
+ self.__check_core(config)
+ self.assertTrue('comp' in config)
+ self.assertEqual('cat', config['comp']['process'])
+ self.assertEqual('needed', config['comp']['kind'])
+ self.assertEqual(4, len(config))
+
+ def test_correct_run(self):
+ """
+ Test the situation when we run in usual scenario, nothing fails,
+ we just start, reconfigure and then stop peacefully.
+ """
+ bob = MockBob()
+ # Start it
+ orig = bob._component_configurator.startup
+ bob._component_configurator.startup = self.__unary_hook
+ bob.start_all_processes()
+ bob._component_configurator.startup = orig
+ self.__check_core(self.__param)
+ self.assertEqual(3, len(self.__param))
+
+ # Reconfigure it
+ self.__param = None
+ orig = bob._component_configurator.reconfigure
+ bob._component_configurator.reconfigure = self.__unary_hook
+ # Otherwise it does not work
+ bob.runnable = True
+ bob.config_handler({'components': self.__compconfig})
+ self.__check_extended(self.__param)
+ currconfig = self.__param
+ # If we reconfigure it, but it does not contain the components part,
+ # nothing is called
+ bob.config_handler({})
+ self.assertEqual(self.__param, currconfig)
+ self.__param = None
+ bob._component_configurator.reconfigure = orig
+ # Check a configuration that messes up the core components is rejected.
+ compconf = dict(self.__compconfig)
+ compconf['msgq'] = { 'process': 'echo' }
+ result = bob.config_handler({'components': compconf})
+ # Check it rejected it
+ self.assertEqual(1, result['result'][0])
+
+ # We can't call shutdown, that one relies on the stuff in main
+ # We check somewhere else that the shutdown is actually called
+ # from there (the test_kills).
+
+ def test_kills(self):
+ """
+ Test that the boss kills processes which don't want to stop.
+ """
+ bob = MockBob()
+ killed = []
+ class ImmortalComponent:
+ """
+ An immortal component. It does not stop when it is told so
+ (anyway it is not told so). It does not die if it is killed
+ the first time. It dies only when killed forcefully.
+ """
+ def kill(self, forcefull=False):
+ killed.append(forcefull)
+ if forcefull:
+ bob.processes = {}
+ def pid(self):
+ return 1
+ def name(self):
+ return "Immortal"
+ bob.processes = {}
+ bob.register_process(1, ImmortalComponent())
+
+ # While at it, we check the configurator shutdown is actually called
+ orig = bob._component_configurator.shutdown
+ bob._component_configurator.shutdown = self.__nullary_hook
+ self.__called = False
+
+ bob.shutdown()
+
+ self.assertEqual([False, True], killed)
+ self.assertTrue(self.__called)
+
+ bob._component_configurator.shutdown = orig
+
+ def test_component_shutdown(self):
+ """
+ Test the component_shutdown sets all variables accordingly.
+ """
+ bob = MockBob()
+ self.assertRaises(Exception, bob.component_shutdown, 1)
+ self.assertEqual(1, bob.exitcode)
+ bob._BoB__started = True
+ bob.runnable = True
+ bob.component_shutdown(2)
+ self.assertEqual(2, bob.exitcode)
+ self.assertFalse(bob.runnable)
+
+ def test_init_config(self):
+ """
+ Test initial configuration is loaded.
+ """
+ bob = MockBob()
+ # Start it
+ bob._component_configurator.reconfigure = self.__unary_hook
+ # We need to return the original read_bind10_config
+ bob.read_bind10_config = lambda: BoB.read_bind10_config(bob)
+ # And provide a session to read the data from
+ class CC:
+ pass
+ bob.ccs = CC()
+ bob.ccs.get_full_config = lambda: {'components': self.__compconfig}
+ bob.start_all_processes()
+ self.__check_extended(self.__param)
+
if __name__ == '__main__':
# store os.environ for test_unchanged_environment
original_os_environ = copy.deepcopy(os.environ)
More information about the bind10-changes
mailing list