mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 07:40:00 -04:00
Merge branch '4561-shutdown-test-doesn-t-log-everything-to-named-run' into 'main'
Resolve "Shutdown test doesn't log everything to named.run" Closes #4561 See merge request isc-projects/bind9!8695
This commit is contained in:
commit
248b713b0c
1 changed files with 21 additions and 18 deletions
|
|
@ -168,7 +168,7 @@ def wait_for_proc_termination(proc, max_timeout=10):
|
|||
# In both methods named should exit gracefully.
|
||||
@pytest.mark.parametrize(
|
||||
"kill_method",
|
||||
[pytest.param("rndc", marks=pytest.mark.xfail(reason="GL#4060")), "sigterm"],
|
||||
["rndc", "sigterm"],
|
||||
)
|
||||
def test_named_shutdown(ports, kill_method):
|
||||
# pylint: disable-msg=too-many-locals
|
||||
|
|
@ -196,20 +196,23 @@ def test_named_shutdown(ports, kill_method):
|
|||
resolver.nameservers = ["10.53.0.3"]
|
||||
resolver.port = named_ports.dns
|
||||
|
||||
named_cmdline = [named, "-c", cfg_file, "-f"]
|
||||
with subprocess.Popen(named_cmdline, cwd=cfg_dir) as named_proc:
|
||||
try:
|
||||
assert named_proc.poll() is None, "named isn't running"
|
||||
assert wait_for_named_loaded(resolver)
|
||||
do_work(
|
||||
named_proc,
|
||||
resolver,
|
||||
instance,
|
||||
kill_method,
|
||||
n_workers=12,
|
||||
n_queries=16,
|
||||
)
|
||||
assert wait_for_proc_termination(named_proc)
|
||||
assert named_proc.returncode == 0, "named crashed"
|
||||
finally: # Ensure named is terminated in case of an exception
|
||||
named_proc.kill()
|
||||
named_cmdline = [named, "-c", cfg_file, "-d", "99", "-g"]
|
||||
with open(os.path.join(cfg_dir, "named.run"), "ab") as named_log:
|
||||
with subprocess.Popen(
|
||||
named_cmdline, cwd=cfg_dir, stderr=named_log
|
||||
) as named_proc:
|
||||
try:
|
||||
assert named_proc.poll() is None, "named isn't running"
|
||||
assert wait_for_named_loaded(resolver)
|
||||
do_work(
|
||||
named_proc,
|
||||
resolver,
|
||||
instance,
|
||||
kill_method,
|
||||
n_workers=12,
|
||||
n_queries=16,
|
||||
)
|
||||
assert wait_for_proc_termination(named_proc)
|
||||
assert named_proc.returncode == 0, "named crashed"
|
||||
finally: # Ensure named is terminated in case of an exception
|
||||
named_proc.kill()
|
||||
|
|
|
|||
Loading…
Reference in a new issue