mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Add integration test
This commit is contained in:
parent
76ae4a6875
commit
84b4e96db2
2 changed files with 27 additions and 1 deletions
|
@ -1 +1 @@
|
|||
Make sure the root minion process handles SIGUSR1 and emits a traceback like the child minion processes
|
||||
Make sure the root minion process handles SIGUSR1 and emits a traceback like it's child processes
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
:codeauthor: Thayne Harbaugh (tharbaug@adobe.com)
|
||||
"""
|
||||
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
|
@ -276,3 +277,28 @@ def test_minion_65400(salt_cli, salt_minion, salt_minion_2, salt_master):
|
|||
for minion_id in ret.data:
|
||||
assert ret.data[minion_id] != "Error: test.configurable_test_state"
|
||||
assert isinstance(ret.data[minion_id], dict)
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows(reason="Windows does not support SIGUSR1")
|
||||
def test_sigusr1_handler(salt_master, salt_minion):
|
||||
"""
|
||||
Ensure SIGUSR1 handler works.
|
||||
|
||||
Refer to https://docs.saltproject.io/en/latest/topics/troubleshooting/minion.html#live-python-debug-output for more details.
|
||||
"""
|
||||
tb_glob = os.path.join(tempfile.gettempdir(), "salt-debug-*.log")
|
||||
tracebacks_before = glob.glob(tb_glob)
|
||||
os.kill(salt_minion.pid, signal.SIGUSR1)
|
||||
for i in range(10):
|
||||
if len(glob.glob(tb_glob)) - len(tracebacks_before) == 1:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
os.kill(salt_master.pid, signal.SIGUSR1)
|
||||
for i in range(10):
|
||||
if len(glob.glob(tb_glob)) - len(tracebacks_before) == 2:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
tracebacks_after = glob.glob(tb_glob)
|
||||
assert len(tracebacks_after) - len(tracebacks_before) == 2
|
||||
|
|
Loading…
Add table
Reference in a new issue