Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
52660589
Commit
52660589
authored
Feb 14, 2011
by
Michal 'vorner' Vaner
Browse files
[trac565] Nothing started by config before startup
parent
a3032181
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/bind10/bind10.py.in
View file @
52660589
...
...
@@ -228,6 +228,9 @@ class BoB:
self.verbose = verbose
def config_handler(self, new_config):
# This is initial update, don't do anything by it, leave it to startup
if not self.runnable:
return
if self.verbose:
sys.stdout.write("[bind10] Handling new configuration: " +
str(new_config) + "\n")
...
...
src/bin/bind10/tests/bind10_test.py
View file @
52660589
...
...
@@ -381,6 +381,7 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob
.
cfg_start_resolver
=
False
bob
.
start_all_processes
()
bob
.
runnable
=
True
self
.
check_started_none
(
bob
)
# Enable both at once
...
...
@@ -444,6 +445,7 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob
.
cfg_start_resolver
=
True
bob
.
start_all_processes
()
bob
.
runnable
=
True
self
.
check_started_both
(
bob
)
bob
.
start_auth
=
lambda
:
self
.
fail
(
"Started auth again"
)
...
...
@@ -456,5 +458,21 @@ class TestStartStopProcessesBob(unittest.TestCase):
bob
.
config_handler
({
'start_auth'
:
True
})
bob
.
config_handler
({
'start_resolver'
:
True
})
def
test_config_not_started_early
(
self
):
"""
Test that processes are not started by the config handler before
startup.
"""
bob
=
StartAllProcessesBob
()
self
.
check_preconditions
(
bob
)
bob
.
start_auth
=
lambda
:
self
.
fail
(
"Started auth again"
)
bob
.
start_xfrout
=
lambda
:
self
.
fail
(
"Started xfrout again"
)
bob
.
start_xfrin
=
lambda
:
self
.
fail
(
"Started xfrin again"
)
bob
.
start_zonemgr
=
lambda
:
self
.
fail
(
"Started zonemgr again"
)
bob
.
start_resolver
=
lambda
:
self
.
fail
(
"Started resolver again"
)
bob
.
config_handler
({
'start_auth'
:
True
,
'start_resolver'
:
True
})
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment