]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: pmtu.sh: Kill nettest processes launched in subshell.
authorGuillaume Nault <gnault@redhat.com>
Tue, 8 Mar 2022 22:15:03 +0000 (23:15 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Mar 2022 04:23:32 +0000 (20:23 -0800)
commit710b23f2c2e563a623ebb4b912d47d6fd7169a63
tree7b851b74e05a66adbadc2e0426975a5e0f1a0e61
parent236291b8e528b12bc906906789979a70b13af161
selftests: pmtu.sh: Kill nettest processes launched in subshell.

When using "run_cmd <command> &", then "$!" refers to the PID of the
subshell used to run <command>, not the command itself. Therefore
nettest_pids actually doesn't contain the list of the nettest commands
running in the background. So cleanup() can't kill them and the nettest
processes run until completion (fortunately they have a 5s timeout).

Fix this by defining a new command for running processes in the
background, for which "$!" really refers to the PID of the command run.

Also, double quote variables on the modified lines, to avoid shellcheck
warnings.

Fixes: 908296c56720 ("selftests: net: add ESP-in-UDP PMTU test")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/pmtu.sh