From patchwork Wed Oct 18 18:23:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13427722 X-Patchwork-Delegate: mat@martineau.name Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A1DBB41225; Wed, 18 Oct 2023 18:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TO7IGrzz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03943C433D9; Wed, 18 Oct 2023 18:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697653443; bh=uMZX/B6ZarsMvm/WGOAr/UwyvhAfU161tjHBCE2TWoM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TO7IGrzznb0rQDyEGWS+KgZS5bxB/kk/bW0u1rPFpaskzCIZ1vNkX1IU4m3Pwt4nh NaIcelycInJ724A0JCHGRxrWgQJWzWwA7EMMEzeSBwZWNjCAwEKK+jIX+PfktFgiCw E1nyawsIO4Lfec7fwCpA4ndx2FEcSXuM5a6rSIgwhF/r9QMUEgi6CFESw+yBgj0gYB A1THBnPf3JG7KD88uGyKnzO0h9zsMDHpaXiMJo3o8mqgxSz1WVlGBR99NCCkwvB1s3 M2o7dIh604rdREaViAxegxMOSawQ+edmgm8LHAJVUyTysgm+H3oxxYEUxw0Jmava7m s0Q+ANhTDE+1A== From: Mat Martineau Date: Wed, 18 Oct 2023 11:23:52 -0700 Subject: [PATCH net 1/5] selftests: mptcp: join: correctly check for no RST Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231018-send-net-20231018-v1-1-17ecb002e41d@kernel.org> References: <20231018-send-net-20231018-v1-0-17ecb002e41d@kernel.org> In-Reply-To: <20231018-send-net-20231018-v1-0-17ecb002e41d@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Davide Caratti , Christoph Paasch , Florian Westphal Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau , stable@vger.kernel.org X-Mailer: b4 0.12.3 From: Matthieu Baerts The commit mentioned below was more tolerant with the number of RST seen during a test because in some uncontrollable situations, multiple RST can be generated. But it was not taking into account the case where no RST are expected: this validation was then no longer reporting issues for the 0 RST case because it is not possible to have less than 0 RST in the counter. This patch fixes the issue by adding a specific condition. Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-cases") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index ee1f89a872b3..27953670206e 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1432,7 +1432,9 @@ chk_rst_nr() count=$(get_counter ${ns_tx} "MPTcpExtMPRstTx") if [ -z "$count" ]; then print_skip - elif [ $count -lt $rst_tx ]; then + # accept more rst than expected except if we don't expect any + elif { [ $rst_tx -ne 0 ] && [ $count -lt $rst_tx ]; } || + { [ $rst_tx -eq 0 ] && [ $count -ne 0 ]; }; then fail_test "got $count MP_RST[s] TX expected $rst_tx" else print_ok @@ -1442,7 +1444,9 @@ chk_rst_nr() count=$(get_counter ${ns_rx} "MPTcpExtMPRstRx") if [ -z "$count" ]; then print_skip - elif [ "$count" -lt "$rst_rx" ]; then + # accept more rst than expected except if we don't expect any + elif { [ $rst_rx -ne 0 ] && [ $count -lt $rst_rx ]; } || + { [ $rst_rx -eq 0 ] && [ $count -ne 0 ]; }; then fail_test "got $count MP_RST[s] RX expected $rst_rx" else print_ok