diff mbox series

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

Message ID 41253445a424229f014a521e9d9ade26b682bd3e.1690454072.git.aclaudi@redhat.com (mailing list archive)
State Accepted, archived
Commit 5013654dafcc5a86ad5f6b6001e569c3f3a17746
Delegated to: Matthieu Baerts
Headers show
Series selftests: fix mptcp_join test | expand

Checks

Context Check Description
matttbe/build success Build and static analysis OK
matttbe/checkpatch warning total: 0 errors, 1 warnings, 0 checks, 7 lines checked
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅

Commit Message

Andrea Claudi July 27, 2023, 11:08 a.m. UTC
mptcp_join 'delete and re-add' test fails when using ip mptcp:

$ ./mptcp_join.sh -iI
<snip>
002 delete and re-add                    before delete[ ok ]
                                         mptcp_info subflows=1         [ ok ]
Error: argument "ADDRESS" is wrong: invalid for non-zero id address
                                         after delete[fail] got 2:2 subflows expected 1

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 using the $addr variable in pm_nl_del_endpoint()
only when id is 0.

Fixes: 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 +
 1 file changed, 1 insertion(+)
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..b972feb9a3a2 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -678,6 +678,7 @@  pm_nl_del_endpoint()
 	local addr=$3
 
 	if [ $ip_mptcp -eq 1 ]; then
+		[ $id -ne 0 ] && addr=''
 		ip -n $ns mptcp endpoint delete id $id $addr
 	else
 		ip netns exec $ns ./pm_nl_ctl del $id $addr