mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm
@ 2022-06-10  3:00 Geliang Tang
  2022-06-10  4:33 ` selftests: mptcp: avoid Terminated messages in userspace_pm: Tests Results MPTCP CI
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geliang Tang @ 2022-06-10  3:00 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

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 'wait $pid 2>/dev/null' commands after 'kill $pid'
to avoid printing out these Terminated messages.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 .../testing/selftests/net/mptcp/userspace_pm.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
index 78d0bb640b11..eaa54c3f75fb 100755
--- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
+++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
@@ -49,15 +49,18 @@ cleanup()
 	fi
 	if [ $server4_pid -ne 0 ]; then
 		kill $server4_pid > /dev/null 2>&1
+		wait $server4_pid 2>/dev/null
 	fi
 	if [ $client6_pid -ne 0 ]; then
 		kill -SIGUSR1 $client6_pid > /dev/null 2>&1
 	fi
 	if [ $server6_pid -ne 0 ]; then
 		kill $server6_pid > /dev/null 2>&1
+		wait $server6_pid 2>/dev/null
 	fi
 	if [ $evts_pid -ne 0 ]; then
 		kill $evts_pid > /dev/null 2>&1
+		wait $evts_pid 2>/dev/null
 	fi
 	local netns
 	for netns in "$ns1" "$ns2" ;do
@@ -154,6 +157,7 @@ make_connection()
 
 	# Capture client/server attributes from MPTCP connection netlink events
 	kill $client_evts_pid
+	wait $client_evts_pid 2>/dev/null
 
 	local client_token
 	local client_port
@@ -166,6 +170,7 @@ make_connection()
 	client_serverside=$(sed --unbuffered -n 's/.*\(server_side:\)\([[:digit:]]*\).*$/\2/p;q'\
 				      "$client_evts")
 	kill $server_evts_pid
+	wait $server_evts_pid 2>/dev/null
 	server_token=$(sed --unbuffered -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$server_evts")
 	server_serverside=$(sed --unbuffered -n 's/.*\(server_side:\)\([[:digit:]]*\).*$/\2/p;q'\
 				      "$server_evts")
@@ -287,6 +292,7 @@ test_announce()
 			      "$client_addr_id" "$new4_port"
 
 	kill $evts_pid
+	wait $evts_pid 2>/dev/null
 
 	# Capture events on the network namespace running the client
 	:>"$evts"
@@ -322,6 +328,7 @@ test_announce()
 			      "$server_addr_id" "$new4_port"
 
 	kill $evts_pid
+	wait $evts_pid 2>/dev/null
 	rm -f "$evts"
 }
 
@@ -417,6 +424,7 @@ test_remove()
 	verify_remove_event "$evts" "$REMOVED" "$server6_token" "$client_addr_id"
 
 	kill $evts_pid
+	wait $evts_pid 2>/dev/null
 
 	# Capture events on the network namespace running the client
 	:>"$evts"
@@ -450,6 +458,7 @@ test_remove()
 	verify_remove_event "$evts" "$REMOVED" "$client6_token" "$server_addr_id"
 
 	kill $evts_pid
+	wait $evts_pid 2>/dev/null
 	rm -f "$evts"
 }
 
@@ -554,6 +563,7 @@ test_subflows()
 
 	# Delete the listener from the client ns, if one was created
 	kill $listener_pid > /dev/null 2>&1
+	wait $listener_pid 2>/dev/null
 
 	local sport
 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
@@ -593,6 +603,7 @@ test_subflows()
 
 	# Delete the listener from the client ns, if one was created
 	kill $listener_pid > /dev/null 2>&1
+	wait $listener_pid 2>/dev/null
 
 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
 
@@ -632,6 +643,7 @@ test_subflows()
 
 	# Delete the listener from the client ns, if one was created
 	kill $listener_pid > /dev/null 2>&1
+	wait $listener_pid 2>/dev/null
 
 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
 
@@ -648,6 +660,7 @@ test_subflows()
 	   "$client4_token" > /dev/null 2>&1
 
 	kill $evts_pid
+	wait $evts_pid 2>/dev/null
 
 	# Capture events on the network namespace running the client
 	:>"$evts"
@@ -675,6 +688,7 @@ test_subflows()
 
 	# Delete the listener from the server ns, if one was created
 	kill $listener_pid> /dev/null 2>&1
+	wait $listener_pid 2>/dev/null
 
 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
 
@@ -714,6 +728,7 @@ test_subflows()
 
 	# Delete the listener from the server ns, if one was created
 	kill $listener_pid > /dev/null 2>&1
+	wait $listener_pid 2>/dev/null
 
 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
 
@@ -751,6 +766,7 @@ test_subflows()
 
 	# Delete the listener from the server ns, if one was created
 	kill $listener_pid > /dev/null 2>&1
+	wait $listener_pid 2>/dev/null
 
 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
 
@@ -767,6 +783,7 @@ test_subflows()
 	   "$server4_token" > /dev/null 2>&1
 
 	kill $evts_pid
+	wait $evts_pid 2>/dev/null
 	rm -f "$evts"
 }
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: selftests: mptcp: avoid Terminated messages in userspace_pm: Tests Results
  2022-06-10  3:00 [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Geliang Tang
@ 2022-06-10  4:33 ` MPTCP CI
  2022-06-11  0:04 ` [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Mat Martineau
  2022-06-11  7:10 ` Matthieu Baerts
  2 siblings, 0 replies; 4+ messages in thread
From: MPTCP CI @ 2022-06-10  4:33 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal:
  - Unstable: 1 failed test(s): selftest_simult_flows 🔴:
  - Task: https://cirrus-ci.com/task/6697921566474240
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6697921566474240/summary/summary.txt

- KVM Validation: debug:
  - Unstable: 1 failed test(s): selftest_diag 🔴:
  - Task: https://cirrus-ci.com/task/4551674869055488
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/4551674869055488/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/195087709400


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm
  2022-06-10  3:00 [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Geliang Tang
  2022-06-10  4:33 ` selftests: mptcp: avoid Terminated messages in userspace_pm: Tests Results MPTCP CI
@ 2022-06-11  0:04 ` Mat Martineau
  2022-06-11  7:10 ` Matthieu Baerts
  2 siblings, 0 replies; 4+ messages in thread
From: Mat Martineau @ 2022-06-11  0:04 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

On Fri, 10 Jun 2022, Geliang Tang wrote:

> 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 'wait $pid 2>/dev/null' commands after 'kill $pid'
> to avoid printing out these Terminated messages.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>

Looks good to me, thanks Geliang:

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


> ---
> .../testing/selftests/net/mptcp/userspace_pm.sh | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> index 78d0bb640b11..eaa54c3f75fb 100755
> --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
> +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> @@ -49,15 +49,18 @@ cleanup()
> 	fi
> 	if [ $server4_pid -ne 0 ]; then
> 		kill $server4_pid > /dev/null 2>&1
> +		wait $server4_pid 2>/dev/null
> 	fi
> 	if [ $client6_pid -ne 0 ]; then
> 		kill -SIGUSR1 $client6_pid > /dev/null 2>&1
> 	fi
> 	if [ $server6_pid -ne 0 ]; then
> 		kill $server6_pid > /dev/null 2>&1
> +		wait $server6_pid 2>/dev/null
> 	fi
> 	if [ $evts_pid -ne 0 ]; then
> 		kill $evts_pid > /dev/null 2>&1
> +		wait $evts_pid 2>/dev/null
> 	fi
> 	local netns
> 	for netns in "$ns1" "$ns2" ;do
> @@ -154,6 +157,7 @@ make_connection()
>
> 	# Capture client/server attributes from MPTCP connection netlink events
> 	kill $client_evts_pid
> +	wait $client_evts_pid 2>/dev/null
>
> 	local client_token
> 	local client_port
> @@ -166,6 +170,7 @@ make_connection()
> 	client_serverside=$(sed --unbuffered -n 's/.*\(server_side:\)\([[:digit:]]*\).*$/\2/p;q'\
> 				      "$client_evts")
> 	kill $server_evts_pid
> +	wait $server_evts_pid 2>/dev/null
> 	server_token=$(sed --unbuffered -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$server_evts")
> 	server_serverside=$(sed --unbuffered -n 's/.*\(server_side:\)\([[:digit:]]*\).*$/\2/p;q'\
> 				      "$server_evts")
> @@ -287,6 +292,7 @@ test_announce()
> 			      "$client_addr_id" "$new4_port"
>
> 	kill $evts_pid
> +	wait $evts_pid 2>/dev/null
>
> 	# Capture events on the network namespace running the client
> 	:>"$evts"
> @@ -322,6 +328,7 @@ test_announce()
> 			      "$server_addr_id" "$new4_port"
>
> 	kill $evts_pid
> +	wait $evts_pid 2>/dev/null
> 	rm -f "$evts"
> }
>
> @@ -417,6 +424,7 @@ test_remove()
> 	verify_remove_event "$evts" "$REMOVED" "$server6_token" "$client_addr_id"
>
> 	kill $evts_pid
> +	wait $evts_pid 2>/dev/null
>
> 	# Capture events on the network namespace running the client
> 	:>"$evts"
> @@ -450,6 +458,7 @@ test_remove()
> 	verify_remove_event "$evts" "$REMOVED" "$client6_token" "$server_addr_id"
>
> 	kill $evts_pid
> +	wait $evts_pid 2>/dev/null
> 	rm -f "$evts"
> }
>
> @@ -554,6 +563,7 @@ test_subflows()
>
> 	# Delete the listener from the client ns, if one was created
> 	kill $listener_pid > /dev/null 2>&1
> +	wait $listener_pid 2>/dev/null
>
> 	local sport
> 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
> @@ -593,6 +603,7 @@ test_subflows()
>
> 	# Delete the listener from the client ns, if one was created
> 	kill $listener_pid > /dev/null 2>&1
> +	wait $listener_pid 2>/dev/null
>
> 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
>
> @@ -632,6 +643,7 @@ test_subflows()
>
> 	# Delete the listener from the client ns, if one was created
> 	kill $listener_pid > /dev/null 2>&1
> +	wait $listener_pid 2>/dev/null
>
> 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
>
> @@ -648,6 +660,7 @@ test_subflows()
> 	   "$client4_token" > /dev/null 2>&1
>
> 	kill $evts_pid
> +	wait $evts_pid 2>/dev/null
>
> 	# Capture events on the network namespace running the client
> 	:>"$evts"
> @@ -675,6 +688,7 @@ test_subflows()
>
> 	# Delete the listener from the server ns, if one was created
> 	kill $listener_pid> /dev/null 2>&1
> +	wait $listener_pid 2>/dev/null
>
> 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
>
> @@ -714,6 +728,7 @@ test_subflows()
>
> 	# Delete the listener from the server ns, if one was created
> 	kill $listener_pid > /dev/null 2>&1
> +	wait $listener_pid 2>/dev/null
>
> 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
>
> @@ -751,6 +766,7 @@ test_subflows()
>
> 	# Delete the listener from the server ns, if one was created
> 	kill $listener_pid > /dev/null 2>&1
> +	wait $listener_pid 2>/dev/null
>
> 	sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts")
>
> @@ -767,6 +783,7 @@ test_subflows()
> 	   "$server4_token" > /dev/null 2>&1
>
> 	kill $evts_pid
> +	wait $evts_pid 2>/dev/null
> 	rm -f "$evts"
> }
>
> -- 
> 2.35.3
>
>
>

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm
  2022-06-10  3:00 [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Geliang Tang
  2022-06-10  4:33 ` selftests: mptcp: avoid Terminated messages in userspace_pm: Tests Results MPTCP CI
  2022-06-11  0:04 ` [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Mat Martineau
@ 2022-06-11  7:10 ` Matthieu Baerts
  2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2022-06-11  7:10 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

Hi Geliang,

On 10/06/2022 05:00, Geliang Tang wrote:
> 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 'wait $pid 2>/dev/null' commands after 'kill $pid'
> to avoid printing out these Terminated messages.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
>  .../testing/selftests/net/mptcp/userspace_pm.sh | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> index 78d0bb640b11..eaa54c3f75fb 100755
> --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
> +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> @@ -49,15 +49,18 @@ cleanup()
>  	fi
>  	if [ $server4_pid -ne 0 ]; then
>  		kill $server4_pid > /dev/null 2>&1
> +		wait $server4_pid 2>/dev/null

Good idea to wait!

Do you think it would be interesting to add a new helper doing something
like this?

  # $1: PID
  kill_wait() {
      kill "${1}" &>/dev/null
      wait "${1}" 2>/dev/null
  }

or even:

  # $1: PID
  kill_wait() {
      local pid="${1}"

      if [ "${pid}" -ne 0 ]; then
          kill "${pid}" &>/dev/null
          wait "${pid}" 2>/dev/null
      fi
  }

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-11  7:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10  3:00 [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Geliang Tang
2022-06-10  4:33 ` selftests: mptcp: avoid Terminated messages in userspace_pm: Tests Results MPTCP CI
2022-06-11  0:04 ` [PATCH mptcp-next] selftests: mptcp: avoid Terminated messages in userspace_pm Mat Martineau
2022-06-11  7:10 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).