linux-stable/tools/testing
Björn Töpel aea3801c23 kselftest/runner.sh: Propagate SIGTERM to runner child
[ Upstream commit 9616cb34b0 ]

Timeouts in kselftest are done using the "timeout" command with the
"--foreground" option. Without the "foreground" option, it is not
possible for a user to cancel the runner using SIGINT, because the
signal is not propagated to timeout which is running in a different
process group. The "forground" options places the timeout in the same
process group as its parent, but only sends the SIGTERM (on timeout)
signal to the forked process. Unfortunately, this does not play nice
with all kselftests, e.g. "net:fcnal-test.sh", where the child
processes will linger because timeout does not send SIGTERM to the
group.

Some users have noted these hangs [1].

Fix this by nesting the timeout with an additional timeout without the
foreground option.

Link: https://lore.kernel.org/all/7650b2eb-0aee-a2b0-2e64-c9bc63210f67@alu.unizg.hr/ # [1]
Fixes: 651e0d8814 ("kselftest/runner: allow to properly deliver signals to tests")
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:23:03 +02:00
..
fault-injection
ktest ktest.pl: Add RUN_TIMEOUT option with default unlimited 2023-03-10 09:40:10 +01:00
kunit kunit: tool: Import missing importlib.abc 2022-02-23 12:03:04 +01:00
nvdimm memremap: remove support for external pgmap refcounts 2022-08-17 14:23:43 +02:00
radix-tree radix tree test suite: fix incorrect allocation size for pthreads 2023-08-16 18:21:58 +02:00
scatterlist Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
selftests kselftest/runner.sh: Propagate SIGTERM to runner child 2023-09-19 12:23:03 +02:00
vsock vsock_diag_test: remove free_sock_stat() call in test_no_sockets 2021-10-15 17:21:34 -07:00