selftests: mptcp: avoid Terminated messages in userspace_pm
authorGeliang Tang <geliang.tang@suse.com>
Fri, 8 Jul 2022 17:14:12 +0000 (10:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Jul 2022 11:19:24 +0000 (12:19 +0100)
commit507719cd7c0f0251fb2b772e73e4c35b7429587b
tree0a8e5d5c720224d7f21fb56aaec64d4387502adf
parent5e986ec468745e8d4582070d869a10eaae8ba56c
selftests: mptcp: avoid Terminated messages in userspace_pm

There're some 'Terminated' messages in the output of userspace pm tests
script after killing './pm_nl_ctl events' processes:

Created network namespaces ns1, ns2          [OK]
./userspace_pm.sh: line 166: 13735 Terminated              ip netns exec "$ns2" ./pm_nl_ctl events >> "$client_evts" 2>&1
./userspace_pm.sh: line 172: 13737 Terminated              ip netns exec "$ns1" ./pm_nl_ctl events >> "$server_evts" 2>&1
Established IPv4 MPTCP Connection ns2 => ns1     [OK]
./userspace_pm.sh: line 166: 13753 Terminated              ip netns exec "$ns2" ./pm_nl_ctl events >> "$client_evts" 2>&1
./userspace_pm.sh: line 172: 13755 Terminated              ip netns exec "$ns1" ./pm_nl_ctl events >> "$server_evts" 2>&1
Established IPv6 MPTCP Connection ns2 => ns1     [OK]
ADD_ADDR 10.0.2.2 (ns2) => ns1, invalid token     [OK]

This patch adds a helper kill_wait(), in it using 'wait $pid 2>/dev/null'
commands after 'kill $pid' to avoid printing out these Terminated messages.
Use this helper instead of using 'kill $pid'.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/mptcp/userspace_pm.sh