Abort named if 'rndc stop' or 'kill TERM' has failed to shutdown

This commit is contained in:
Mark Andrews
2021-04-12 18:00:07 +10:00
parent 60bf42b3e1
commit c3c7f5849c

View File

@@ -13,6 +13,7 @@
from concurrent.futures import ThreadPoolExecutor, as_completed
import os
import random
import signal
import subprocess
from string import ascii_lowercase as letters
import time
@@ -182,7 +183,14 @@ def test_named_shutdown(named_port, control_port):
time.sleep(1)
if not is_dead:
named_proc.kill()
named_proc.send_signal(signal.SIGABRT)
for _ in range(MAX_TIMEOUT):
if named_proc.poll() is not None:
is_dead = True
break
time.sleep(1)
if not is_dead:
named_proc.kill()
assert is_dead
# Ensures that named exited gracefully.