diff options
| author | Jakub Kicinski <[email protected]> | 2025-02-19 23:49:50 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-02-21 01:57:29 +0000 |
| commit | 846742f7e32f632166e3b2a106304b2bec7541a9 (patch) | |
| tree | 7ad8b5c70a4552049be0d9f27b5bce3765b4a56a /tools/testing/selftests/net/lib/py/utils.py | |
| parent | octeontx2: hide unused label (diff) | |
| download | kernel-846742f7e32f632166e3b2a106304b2bec7541a9.tar.gz kernel-846742f7e32f632166e3b2a106304b2bec7541a9.zip | |
selftests: drv-net: add a warning for bkg + shell + terminate
Joe Damato reports that some shells will fork before running
the command when python does "sh -c $cmd", while bash on my
machine does an exec of $cmd directly.
This will have implications for our ability to terminate
the child process on various configurations of bash and
other shells. Warn about using
bkg(... shell=True, termininate=True)
most background commands can hopefully exit cleanly (exit_wait).
Link: https://lore.kernel.org/Z7Yld21sv_Ip3gQx@LQ3V64L9R2
Acked-by: Stanislav Fomichev <[email protected]>
Acked-by: Joe Damato <[email protected]>
Tested-by: Joe Damato <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/utils.py')
| -rw-r--r-- | tools/testing/selftests/net/lib/py/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py index 9e3bcddcf3e8..33b153767d89 100644 --- a/tools/testing/selftests/net/lib/py/utils.py +++ b/tools/testing/selftests/net/lib/py/utils.py @@ -61,6 +61,10 @@ class bkg(cmd): self.terminate = not exit_wait self.check_fail = fail + if shell and self.terminate: + print("# Warning: combining shell and terminate is risky!") + print("# SIGTERM may not reach the child on zsh/ksh!") + def __enter__(self): return self |
