mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
prefork restart tests: Use echo server for back off
Use the echo server for the restart back off tests in the samba.tests.prefork_restart tests instead of the kdc. The kdc is not enabled when the ADDC is built to run MIT Kerberos. Changing the test to use the echo server means it can be run when MIT Kerberos is enabled. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
15196c7561
commit
1c4b9ba36c
@ -404,7 +404,7 @@ class PreforkProcessRestartTests(TestCase):
|
||||
def test_master_restart_backoff(self):
|
||||
|
||||
# get kdc master process
|
||||
pid = self.get_process("prefork-master-kdc")
|
||||
pid = self.get_process("prefork-master-echo")
|
||||
self.assertIsNotNone(pid)
|
||||
|
||||
#
|
||||
@ -417,13 +417,13 @@ class PreforkProcessRestartTests(TestCase):
|
||||
# Get the worker processes
|
||||
workers = self.get_worker_pids("kdc", NUM_WORKERS)
|
||||
|
||||
process = self.get_process("prefork-master-kdc")
|
||||
process = self.get_process("prefork-master-echo")
|
||||
os.kill(process, signal.SIGTERM)
|
||||
# wait for the process to restart
|
||||
start = time.time()
|
||||
self.wait_for_process("prefork-master-kdc", process, 0, 1, 30)
|
||||
self.wait_for_process("prefork-master-echo", process, 0, 1, 30)
|
||||
# wait for the workers to restart as well
|
||||
self.wait_for_workers("kdc", workers)
|
||||
self.wait_for_workers("echo", workers)
|
||||
end = time.time()
|
||||
duration = end - start
|
||||
|
||||
@ -434,7 +434,7 @@ class PreforkProcessRestartTests(TestCase):
|
||||
self.assertGreaterEqual(duration, expected)
|
||||
|
||||
# check that the worker processes have restarted
|
||||
new_workers = self.get_worker_pids("kdc", NUM_WORKERS)
|
||||
new_workers = self.get_worker_pids("echo", NUM_WORKERS)
|
||||
for x in range(NUM_WORKERS):
|
||||
self.assertNotEquals(workers[x], new_workers[x])
|
||||
|
||||
@ -449,12 +449,12 @@ class PreforkProcessRestartTests(TestCase):
|
||||
# prefork maximum backoff = 10
|
||||
backoff_increment = 5
|
||||
for expected in [0, 5, 10, 10]:
|
||||
process = self.get_process("prefork-worker-kdc-2")
|
||||
process = self.get_process("prefork-worker-echo-2")
|
||||
self.assertIsNotNone(process)
|
||||
os.kill(process, signal.SIGTERM)
|
||||
# wait for the process to restart
|
||||
start = time.time()
|
||||
self.wait_for_process("prefork-worker-kdc-2", process, 0, 1, 30)
|
||||
self.wait_for_process("prefork-worker-echo-2", process, 0, 1, 30)
|
||||
end = time.time()
|
||||
duration = end - start
|
||||
|
||||
|
Reference in New Issue
Block a user