From nobody Tue May 21 15:06:20 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 996C5AD2E for ; Thu, 27 Jul 2023 11:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690456157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDiAsbzbjZf6wAiEnCZDwZjTHosyn9ThNb8HBkBPfEU=; b=gLGW2b3zjtMz0kga3LlTlyJ9pFCGPkW86tutTiUg+S+rLUPksMBHCAYtdhgBtSkrSguLrl BQTZ2QfAo5rXVIL5crq0Xd38EbVBqbke3rbONdPa0n1dBWVHEowPN0C2AjzabF1Ds2O/IT OIXpqBspj2FAi3F7Im/dcRLDrOtSomI= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-hffDtHqQNrSBzmZsyQU7Ow-1; Thu, 27 Jul 2023 07:09:16 -0400 X-MC-Unique: hffDtHqQNrSBzmZsyQU7Ow-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DBFB61C09A43; Thu, 27 Jul 2023 11:09:15 +0000 (UTC) Received: from renaissance-vector.redhat.com (unknown [10.39.193.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id C97E0492C13; Thu, 27 Jul 2023 11:09:14 +0000 (UTC) From: Andrea Claudi To: mptcp@lists.linux.dev Cc: Matthieu Baerts , Mat Martineau Subject: [PATCH mptcp-next v2 1/2] selftests: mptcp: join: fix 'delete and re-add' test Date: Thu, 27 Jul 2023 13:08:54 +0200 Message-ID: <41253445a424229f014a521e9d9ade26b682bd3e.1690454072.git.aclaudi@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" mptcp_join 'delete and re-add' test fails when using ip mptcp: $ ./mptcp_join.sh -iI 002 delete and re-add before delete[ ok ] mptcp_info subflows=3D1 [ = ok ] Error: argument "ADDRESS" is wrong: invalid for non-zero id address after delete[fail] got 2:2 subflow= s 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 Reviewed-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/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=3D$3 =20 if [ $ip_mptcp -eq 1 ]; then + [ $id -ne 0 ] && addr=3D'' ip -n $ns mptcp endpoint delete id $id $addr else ip netns exec $ns ./pm_nl_ctl del $id $addr --=20 2.41.0 From nobody Tue May 21 15:06:20 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 348FFE57A for ; Thu, 27 Jul 2023 11:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690456161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=joz6eL6OZHSld/e+DBN0UOiAE0RuCst5jveOc18cRr4=; b=C+ixVCm61Dr3O6cCwIDXt8HuHFwkGxlB4Nff30p/tyUCo2VuItVJhncp73nVVAAoUURC00 IA3vmCmOqRWsQBl49nvX5pxPg/At/Id4GYLz8YZH9yfMX6CCoFtR4a/gENXIHl5ZfpgNgU A+sK+SxbUnJz0CWIm7aogJRvkKkiOdY= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-684-5hlR_UQtPeWXQCmsdhpBVQ-1; Thu, 27 Jul 2023 07:09:18 -0400 X-MC-Unique: 5hlR_UQtPeWXQCmsdhpBVQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0DDC38025EC; Thu, 27 Jul 2023 11:09:17 +0000 (UTC) Received: from renaissance-vector.redhat.com (unknown [10.39.193.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B812492C13; Thu, 27 Jul 2023 11:09:16 +0000 (UTC) From: Andrea Claudi To: mptcp@lists.linux.dev Cc: Matthieu Baerts , Mat Martineau Subject: [PATCH mptcp-next v2 2/2] selftests: mptcp: join: fix 'implicit EP' test Date: Thu, 27 Jul 2023 13:08:55 +0200 Message-ID: <5c70132fb9512ecc42fea01c3118dc9a292791ab.1690454072.git.aclaudi@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; x-default="true" mptcp_join 'implicit EP' test currently fails when using ip mptcp: $ ./mptcp_join.sh -iI 001 implicit EP creation[fail] expected '10.0.2.2 10.0.2.2 id 1 implicit= ' found '10.0.2.2 id 1 rawflags 10 ' Error: too many addresses or duplicate one: -22. ID change is prevented[fail] expected '10.0.2.2 10.0.2.2= id 1 implicit' found '10.0.2.2 id 1 rawflags 10 ' modif is allowed[fail] expected '10.0.2.2 10.0.2.2 id 1 = signal' found '10.0.2.2 id 1 signal ' This happens because of two reasons: - iproute v6.3.0 does not support the implicit flag, fixed with iproute2-next commit 3a2535a41854 ("mptcp: add support for implicit flag") - pm_nl_check_endpoint wrongly expects the ip address to be repeated two times in iproute output, and does not account for a final whitespace in it. This fixes the issue trimming the whitespace in the output string and removing the double address in the expected string. Fixes: 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers") Signed-off-by: Andrea Claudi Reviewed-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index b972feb9a3a2..4938baa4c5fe 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -769,10 +769,11 @@ pm_nl_check_endpoint() fi =20 if [ $ip_mptcp -eq 1 ]; then + # get line and trim trailing whitespace line=3D$(ip -n $ns mptcp endpoint show $id) + line=3D"${line% }" # the dump order is: address id flags port dev - expected_line=3D"$addr" - [ -n "$addr" ] && expected_line=3D"$expected_line $addr" + [ -n "$addr" ] && expected_line=3D"$addr" expected_line=3D"$expected_line $id" [ -n "$_flags" ] && expected_line=3D"$expected_line ${_flags//","/" "}" [ -n "$dev" ] && expected_line=3D"$expected_line $dev" --=20 2.41.0