1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s4 messaging tests: Fix race condition in smbcontrol tests

The test for the smbcontrol sleep command and the inject fault command
both used the "rpc_server" process as a target.  As the inject fault
command caused the process to restart there was a race condition between
the process restarting and the sleep test running.  To prevent this the
tests now use different target processes.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Dec 21 03:39:24 CET 2018 on sn-devel-144
This commit is contained in:
Gary Lockyer 2018-12-20 15:46:21 +13:00 committed by Andrew Bartlett
parent 05c981f0b4
commit 390871602d

View File

@ -54,6 +54,10 @@ class SmbcontrolProcessBlockboxTests(BlackboxTestCase):
def test_inject_fault(self): def test_inject_fault(self):
INJECT = "inject" INJECT = "inject"
FAULT = "segv" FAULT = "segv"
#
# Note that this process name needs to be different to the one used
# in the sleep test to avoid a race condition
#
pid = self.get_process("rpc_server") pid = self.get_process("rpc_server")
# #
@ -90,7 +94,11 @@ class SmbcontrolProcessBlockboxTests(BlackboxTestCase):
DURATION = 5 # duration to sleep server for DURATION = 5 # duration to sleep server for
DELTA = 1 # permitted error for the sleep duration DELTA = 1 # permitted error for the sleep duration
pid = self.get_process("rpc_server") #
# Note that this process name needs to be different to the one used
# in the inject fault test to avoid a race condition
#
pid = self.get_process("ldap_server")
# #
# Ensure we can ping the process before getting it to sleep # Ensure we can ping the process before getting it to sleep
# #