Skip to content
Commit 94a4a4fe authored by Guillaume Nault's avatar Guillaume Nault Committed by Jakub Kicinski
Browse files

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: ece1278a ("selftests: net: add ESP-in-UDP PMTU test")
Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
Reviewed-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 18dfc667
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment