Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: forwarding: lib: Allow passing PID to stop_traffic()

Now that it is possible to schedule a deferral of stop_traffic() right
after the traffic is started, we do not have to rely on the %% magic to
kill the background process that was started last. Instead we can just give
the PID explicitly. This makes it possible to start other background
processes after the traffic is started without confusing the cleanup.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Petr Machata and committed by
Paolo Abeni
0e07d5db b4b0549a

+3 -1
+3 -1
tools/testing/selftests/net/forwarding/lib.sh
··· 1768 1768 1769 1769 stop_traffic() 1770 1770 { 1771 + local pid=${1-%%}; shift 1772 + 1771 1773 # Suppress noise from killing mausezahn. 1772 - { kill %% && wait %%; } 2>/dev/null 1774 + { kill $pid && wait $pid; } 2>/dev/null 1773 1775 } 1774 1776 1775 1777 declare -A cappid