Skip to contentSkip to conversation

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

PATCH Applied Florian Westphal 4 participants 4 messages Oct 21, 2021 – Oct 22, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fcnal-test: kill hanging ping/nettest binaries on cleanup

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.

---
 tools/testing/selftests/net/fcnal-test.sh | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/net/fcnal-test.sh +3 -0
index 13350cd5c8ac..5aba16c52c2b 100755
@@ -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
 }
 
Signature · 1 line
2.32.0
#1 lore raw

Hi Florian,

Quoting Florian Westphal (2021-10-21 16:02:47)

tools/testing/selftests/net/fcnal-test.sh cleanup() · line 449

Quoted 9 lines
tools/testing/selftests/net/fcnal-test.sh +3 -0
+               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

Acked-by on v1 1/1
#2 lore raw
In reply to Florian Westphal
Quoted 19 lines · Florian Westphal

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.

---
 tools/testing/selftests/net/fcnal-test.sh | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/net/fcnal-test.sh +0 -0
index 13350cd5c8ac..5aba16c52c2b 100755
@@ -439,10 +439,13 @@ cleanup()
 		ip -netns ${NSA} link set dev ${NSA_DEV} down
 		ip -netns ${NSA} link del dev ${NSA_DEV}
 

tools/testing/selftests/net/fcnal-test.sh cleanup() · line 451

Quoted 10 lines
tools/testing/selftests/net/fcnal-test.sh +3 -0
+		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
 }
 
#3 lore raw
In reply to Florian Westphal
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · 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.

[...]

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html