All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Matthieu Baerts <matthieu.baerts@tessares.net>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next] selftests: mptcp: display proper reason to abort tests
Date: Mon, 7 Jun 2021 18:08:43 -0700 (PDT)	[thread overview]
Message-ID: <724782b9-bcf2-889-ca8e-e9d4a91fa693@linux.intel.com> (raw)
In-Reply-To: <20210605085155.3548173-1-matthieu.baerts@tessares.net>

On Sat, 5 Jun 2021, Matthieu Baerts wrote:

> Without this modification, we were often displaying this error messages:
>
>  FAIL: Could not even run loopback test
>
> But $ret could have been set to a non 0 value in many different cases:
>
> - net.mptcp.enabled=0 is not working as expected
> - setsockopt(..., TCP_ULP, "mptcp", ...) is allowed
> - ping between each netns are failing
> - tests between ns1 as a receiver and ns>1 are failing
> - other tests not involving ns1 as a receiver are failing
>
> So not only for the loopback test.
>
> Now a clearer message, including the time it took to run all tests, is
> displayed.
>
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
>
> Notes:
>    Do we want this in -net?
>
>    Because it seems also valid to add:
>
>      Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp")
>

I think net-next is the right place. Thanks for the change to show more 
helpful information on failure! Patch applied to my local repo cleanly and 
tests ran as expected.

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


> .../selftests/net/mptcp/mptcp_connect.sh      | 52 +++++++++++++------
> 1 file changed, 36 insertions(+), 16 deletions(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> index 2484fb6a9a8d..559173a8e387 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> @@ -680,6 +680,25 @@ run_tests_peekmode()
> 	run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1 "-P ${peekmode}"
> }
>
> +display_time()
> +{
> +	time_end=$(date +%s)
> +	time_run=$((time_end-time_start))
> +
> +	echo "Time: ${time_run} seconds"
> +}
> +
> +stop_if_error()
> +{
> +	local msg="$1"
> +
> +	if [ ${ret} -ne 0 ]; then
> +		echo "FAIL: ${msg}" 1>&2
> +		display_time
> +		exit ${ret}
> +	fi
> +}
> +
> make_file "$cin" "client"
> make_file "$sin" "server"
>
> @@ -687,6 +706,8 @@ check_mptcp_disabled
>
> check_mptcp_ulp_setsockopt
>
> +stop_if_error "The kernel configuration is not valid for MPTCP"
> +
> echo "INFO: validating network environment with pings"
> for sender in "$ns1" "$ns2" "$ns3" "$ns4";do
> 	do_ping "$ns1" $sender 10.0.1.1
> @@ -706,6 +727,8 @@ for sender in "$ns1" "$ns2" "$ns3" "$ns4";do
> 	do_ping "$ns4" $sender dead:beef:3::1
> done
>
> +stop_if_error "Could not even run ping tests"
> +
> [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${tc_delay}ms
> echo -n "INFO: Using loss of $tc_loss "
> test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms "
> @@ -733,18 +756,13 @@ echo "on ns3eth4"
>
> tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${reorder_delay}ms $tc_reorder
>
> -for sender in $ns1 $ns2 $ns3 $ns4;do
> -	run_tests_lo "$ns1" "$sender" 10.0.1.1 1
> -	if [ $ret -ne 0 ] ;then
> -		echo "FAIL: Could not even run loopback test" 1>&2
> -		exit $ret
> -	fi
> -	run_tests_lo "$ns1" $sender dead:beef:1::1 1
> -	if [ $ret -ne 0 ] ;then
> -		echo "FAIL: Could not even run loopback v6 test" 2>&1
> -		exit $ret
> -	fi
> +run_tests_lo "$ns1" "$ns1" 10.0.1.1 1
> +stop_if_error "Could not even run loopback test"
> +
> +run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1
> +stop_if_error "Could not even run loopback v6 test"
>
> +for sender in $ns1 $ns2 $ns3 $ns4;do
> 	# ns1<->ns2 is not subject to reordering/tc delays. Use it to test
> 	# mptcp syncookie support.
> 	if [ $sender = $ns1 ]; then
> @@ -753,6 +771,9 @@ for sender in $ns1 $ns2 $ns3 $ns4;do
> 		ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=1
> 	fi
>
> +	run_tests "$ns1" $sender 10.0.1.1
> +	run_tests "$ns1" $sender dead:beef:1::1
> +
> 	run_tests "$ns2" $sender 10.0.1.2
> 	run_tests "$ns2" $sender dead:beef:1::2
> 	run_tests "$ns2" $sender 10.0.2.1
> @@ -765,14 +786,13 @@ for sender in $ns1 $ns2 $ns3 $ns4;do
>
> 	run_tests "$ns4" $sender 10.0.3.1
> 	run_tests "$ns4" $sender dead:beef:3::1
> +
> +	stop_if_error "Tests with $sender as a sender have failed"
> done
>
> run_tests_peekmode "saveWithPeek"
> run_tests_peekmode "saveAfterPeek"
> +stop_if_error "Tests with peek mode have failed"
>
> -time_end=$(date +%s)
> -time_run=$((time_end-time_start))
> -
> -echo "Time: ${time_run} seconds"
> -
> +display_time
> exit $ret
> -- 
> 2.31.1
>
>
>

--
Mat Martineau
Intel

  reply	other threads:[~2021-06-08  1:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05  8:51 [PATCH mptcp-next] selftests: mptcp: display proper reason to abort tests Matthieu Baerts
2021-06-08  1:08 ` Mat Martineau [this message]
2021-06-08 10:06 ` Matthieu Baerts

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=724782b9-bcf2-889-ca8e-e9d4a91fa693@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.