diff mbox series

[net,1/2] selftests: mptcp: join: fix 'delete and re-add' test

Message ID 927493b7ba79d647668e95a34007f48e87c0992a.1687522138.git.aclaudi@redhat.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series selftests: fix mptcp_join test | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 2 maintainers not CCed: shuah@kernel.org linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andrea Claudi June 23, 2023, 12:19 p.m. UTC
mptcp_join '002 delete and re-add' test currently fails in the 'after
delete' testcase.

This happens because endpoint delete includes an ip address while id is
not 0, contrary to what is indicated in the ip mptcp man page:

"When used with the delete id operation, an IFADDR is only included when
the ID is 0."

This fixes the issue simply not using the $addr variable in
pm_nl_del_endpoint().

Fixes: 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthieu Baerts June 26, 2023, 11:31 a.m. UTC | #1
Hi Andrea,

On 23/06/2023 14:19, Andrea Claudi wrote:
> mptcp_join '002 delete and re-add' test currently fails in the 'after
> delete' testcase.

I guess it only fails if you use "-i" option to use "ip mptcp" instead
of "pm_nl_ctl", right?

MPTCP CI doesn't launch the tests with the "-i" option.

Can you mention that it fails only when using "ip mptcp" which is not
the default mode please? It might be good to include that in the title
too not to think the test is broken and the CI didn't complain about that.

BTW, how did you launch mptcp_join.sh selftest to have this test
launched as second position ("002")? With "-Ii"?

(you can remove this "002": it is specific to the way you launched the
test, not using the default mode)

> This happens because endpoint delete includes an ip address while id is
> not 0, contrary to what is indicated in the ip mptcp man page:
> 
> "When used with the delete id operation, an IFADDR is only included when
> the ID is 0."
> 
> This fixes the issue simply not using the $addr variable in
> pm_nl_del_endpoint().

If you do that, are you not going to break other tests? e.g.
- "remove id 0 subflow"
- "remove id 0 address"

(I didn't check all possibilities, maybe not or maybe there are others)

Because if you specify the ID 0, you do need to specify the address, no?

> Fixes: 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers")
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> ---
>  tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 0ae8cafde439..5424dcacfffa 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -678,7 +678,7 @@ pm_nl_del_endpoint()
>  	local addr=$3
>  
>  	if [ $ip_mptcp -eq 1 ]; then
> -		ip -n $ns mptcp endpoint delete id $id $addr
> +		ip -n $ns mptcp endpoint delete id $id

Should you not add "${addr}" only if ${id} == 1?

>  	else
>  		ip netns exec $ns ./pm_nl_ctl del $id $addr
>  	fi

Cheers,
Matt
Andrea Claudi June 27, 2023, 1:25 p.m. UTC | #2
On Mon, Jun 26, 2023 at 01:31:07PM +0200, Matthieu Baerts wrote:
> Hi Andrea,

Hi Matthieu,
Thanks for your review.

> 
> On 23/06/2023 14:19, Andrea Claudi wrote:
> > mptcp_join '002 delete and re-add' test currently fails in the 'after
> > delete' testcase.
> 
> I guess it only fails if you use "-i" option to use "ip mptcp" instead
> of "pm_nl_ctl", right?
>

Yes, exactly.

> MPTCP CI doesn't launch the tests with the "-i" option.
> 
> Can you mention that it fails only when using "ip mptcp" which is not
> the default mode please? It might be good to include that in the title
> too not to think the test is broken and the CI didn't complain about that.
>

Sure, will do that.

> BTW, how did you launch mptcp_join.sh selftest to have this test
> launched as second position ("002")? With "-Ii"?
> 

Yes, that's exactly the case, I use "./mptcp_join.sh -I -i"

> (you can remove this "002": it is specific to the way you launched the
> test, not using the default mode)

Will do.

> 
> > This happens because endpoint delete includes an ip address while id is
> > not 0, contrary to what is indicated in the ip mptcp man page:
> > 
> > "When used with the delete id operation, an IFADDR is only included when
> > the ID is 0."
> > 
> > This fixes the issue simply not using the $addr variable in
> > pm_nl_del_endpoint().
> 
> If you do that, are you not going to break other tests? e.g.
> - "remove id 0 subflow"
> - "remove id 0 address"
> 
> (I didn't check all possibilities, maybe not or maybe there are others)
> 
> Because if you specify the ID 0, you do need to specify the address, no?
> 

That's right, of course. I'll fix that in v2 and make sure no other
tests are impacted with a "mptcp_join.sh -i" run.

> > Fixes: 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers")
> > Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> > ---
> >  tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > index 0ae8cafde439..5424dcacfffa 100755
> > --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > @@ -678,7 +678,7 @@ pm_nl_del_endpoint()
> >  	local addr=$3
> >  
> >  	if [ $ip_mptcp -eq 1 ]; then
> > -		ip -n $ns mptcp endpoint delete id $id $addr
> > +		ip -n $ns mptcp endpoint delete id $id
> 
> Should you not add "${addr}" only if ${id} == 1?
> 
> >  	else
> >  		ip netns exec $ns ./pm_nl_ctl del $id $addr
> >  	fi
> 
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 0ae8cafde439..5424dcacfffa 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -678,7 +678,7 @@  pm_nl_del_endpoint()
 	local addr=$3
 
 	if [ $ip_mptcp -eq 1 ]; then
-		ip -n $ns mptcp endpoint delete id $id $addr
+		ip -n $ns mptcp endpoint delete id $id
 	else
 		ip netns exec $ns ./pm_nl_ctl del $id $addr
 	fi