Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shuah Khan <shuah@kernel.org>, Petr Machata <petrm@nvidia.com>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Mat Martineau <martineau@kernel.org>
Subject: Re: [PATCH net] selftests: net: lib: kill PIDs before del netns
Date: Wed, 14 Aug 2024 10:11:48 +0800	[thread overview]
Message-ID: <ZrwSZGj-BgJJADaG@Laptop-X1> (raw)
In-Reply-To: <20240813-upstream-net-20240813-selftests-net-lib-kill-v1-1-27b689b248b8@kernel.org>

On Tue, Aug 13, 2024 at 03:39:34PM +0200, Matthieu Baerts (NGI0) wrote:
> When deleting netns, it is possible to still have some tasks running,
> e.g. background tasks like tcpdump running in the background, not
> stopped because the test has been interrupted.
> 
> Before deleting the netns, it is then safer to kill all attached PIDs,
> if any. That should reduce some noises after the end of some tests, and
> help with the debugging of some issues. That's why this modification is
> seen as a "fix".
> 
> Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
> Acked-by: Mat Martineau <martineau@kernel.org>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
>  tools/testing/selftests/net/lib.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh
> index d0219032f773..8ee4489238ca 100644
> --- a/tools/testing/selftests/net/lib.sh
> +++ b/tools/testing/selftests/net/lib.sh
> @@ -146,6 +146,7 @@ cleanup_ns()
>  
>  	for ns in "$@"; do
>  		[ -z "${ns}" ] && continue
> +		ip netns pids "${ns}" 2> /dev/null | xargs -r kill || true
>  		ip netns delete "${ns}" &> /dev/null || true
>  		if ! busywait $BUSYWAIT_TIMEOUT ip netns list \| grep -vq "^$ns$" &> /dev/null; then
>  			echo "Warn: Failed to remove namespace $ns"
> 
> ---
> base-commit: 58a63729c957621f1990c3494c702711188ca347
> change-id: 20240813-upstream-net-20240813-selftests-net-lib-kill-f7964a3a58fe
> 
> Best regards,
> -- 
> Matthieu Baerts (NGI0) <matttbe@kernel.org>
> 

Thanks for the fix

Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>

  parent reply	other threads:[~2024-08-14  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 13:39 [PATCH net] selftests: net: lib: kill PIDs before del netns Matthieu Baerts (NGI0)
2024-08-13 14:07 ` Florian Westphal
2024-08-14  2:11 ` Hangbin Liu [this message]
2024-08-15 11:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZrwSZGj-BgJJADaG@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox