diff mbox series

[net] fcnal-test: kill hanging ping/nettest binaries on cleanup

Message ID 20211021140247.29691-1-fw@strlen.de (mailing list archive)
State Accepted
Commit 1f83b835a3eaa5ae4bd825fb07182698bfc243ba
Delegated to: Netdev Maintainers
Headers show
Series [net] fcnal-test: kill hanging ping/nettest binaries on cleanup | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers fail 4 maintainers not CCed: davem@davemloft.net linux-kselftest@vger.kernel.org kuba@kernel.org shuah@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Florian Westphal Oct. 21, 2021, 2:02 p.m. UTC
On my box I see a bunch of ping/nettest processes hanging
around after fcntal-test.sh is done.

Clean those up before netns deletion.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tools/testing/selftests/net/fcnal-test.sh | 3 +++
 1 file changed, 3 insertions(+)

Comments

Antoine Tenart Oct. 21, 2021, 2:20 p.m. UTC | #1
Hi Florian,

Quoting Florian Westphal (2021-10-21 16:02:47)
>  
> +               ip netns pids ${NSA} | xargs kill 2>/dev/null
>                 ip netns del ${NSA}
>         fi
>  
> +       ip netns pids ${NSB} | xargs kill 2>/dev/null
>         ip netns del ${NSB}
> +       ip netns pids ${NSC} | xargs kill 2>/dev/null
>         ip netns del ${NSC} >/dev/null 2>&1

Alternatively you can use `xargs -r` (`--no-run-if-empty`) to avoid
redirecting stderr to /dev/null.

Thanks!
Antoine
David Ahern Oct. 21, 2021, 2:42 p.m. UTC | #2
On 10/21/21 8:02 AM, Florian Westphal wrote:
> On my box I see a bunch of ping/nettest processes hanging
> around after fcntal-test.sh is done.
> 
> Clean those up before netns deletion.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  tools/testing/selftests/net/fcnal-test.sh | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
> index 13350cd5c8ac..5aba16c52c2b 100755
> --- a/tools/testing/selftests/net/fcnal-test.sh
> +++ b/tools/testing/selftests/net/fcnal-test.sh
> @@ -439,10 +439,13 @@ cleanup()
>  		ip -netns ${NSA} link set dev ${NSA_DEV} down
>  		ip -netns ${NSA} link del dev ${NSA_DEV}
>  
> +		ip netns pids ${NSA} | xargs kill 2>/dev/null
>  		ip netns del ${NSA}
>  	fi
>  
> +	ip netns pids ${NSB} | xargs kill 2>/dev/null
>  	ip netns del ${NSB}
> +	ip netns pids ${NSC} | xargs kill 2>/dev/null
>  	ip netns del ${NSC} >/dev/null 2>&1
>  }
>  
> 

Acked-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 22, 2021, 9:10 p.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 21 Oct 2021 16:02:47 +0200 you wrote:
> On my box I see a bunch of ping/nettest processes hanging
> around after fcntal-test.sh is done.
> 
> Clean those up before netns deletion.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> 
> [...]

Here is the summary with links:
  - [net] fcnal-test: kill hanging ping/nettest binaries on cleanup
    https://git.kernel.org/netdev/net/c/1f83b835a3ea

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 13350cd5c8ac..5aba16c52c2b 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -439,10 +439,13 @@  cleanup()
 		ip -netns ${NSA} link set dev ${NSA_DEV} down
 		ip -netns ${NSA} link del dev ${NSA_DEV}
 
+		ip netns pids ${NSA} | xargs kill 2>/dev/null
 		ip netns del ${NSA}
 	fi
 
+	ip netns pids ${NSB} | xargs kill 2>/dev/null
 	ip netns del ${NSB}
+	ip netns pids ${NSC} | xargs kill 2>/dev/null
 	ip netns del ${NSC} >/dev/null 2>&1
 }