From patchwork Sun May 28 17:35:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 99914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1068587vqr; Sun, 28 May 2023 10:37:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Il6N5NtiMPScPtkZ2aC7QI6HwxZCw8+1881i94To2DWj0b7hETvi67CS/hR6SskACFv0k X-Received: by 2002:a05:6a00:23c8:b0:63d:2d7d:b6f2 with SMTP id g8-20020a056a0023c800b0063d2d7db6f2mr13310871pfc.4.1685295422630; Sun, 28 May 2023 10:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685295422; cv=none; d=google.com; s=arc-20160816; b=aOCDx7Q5XwymfShceTlEjPs86QPt+PSVzJnmH9mQRVcUfxaYQhVVFIIzN6cLHBByGo USDsdvuTGRppatpjjnwqd982gY0FBK59ZoTFbu9/l3c1pyCiMoNNiytHaNaA+NfkuCkC H6BFrLfHEvc8/ojxM5DMw2hqvVVf8AXqOabJGpEpzpDChioIRK4AppO/h0UgyH78j02B r/Pg0GEDsUBbLjbVOVua59RgTiwjVDsnWiLky9nIHxecDK52K9E73RM0cAg03xEzjlxu YWYYSEoo7itxnWZ69xL/3mtyiwPPzIRvIz0QonZU5YU1/fAXUGwyOYrni9Y1allQlopE DebQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Gw5Qo+KgJFEsvwVTc4nzprJkJaDeXrbywxB/oWvh/40=; b=NasEcMfaU5k6Ml/NF4dwhRaGtodY5weA8mSluaL38DvpdduMwRPILKrSCrv+eFjLD2 eHhNxj9E/bicyI17r+jFN3NuateFKDHDad8sM0wLQEbEAKMuOgQRcxC1b0BGrxX4pVxb oB0n4Klh+3OCc2W+rqWIkZId+W5YVATpZIVtKTfy3EXhvm2Hd0cukD5duhB0Ckut8qWO pOn4KP8cIaG30MhTfh5IL9KreVxYO4q9cvMV4snyDR7Xt5LIwo643JvjzfitBtWFL1sc UBjaigrr8bWD9BHR99BkV7Q/oXYB5jIg1DqLue0uzyF1pHC8OeoH+Y/+NgySLb3k+Xsc OxWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=g6ggxEtG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020aa79906000000b006391322d3f8si8136580pff.375.2023.05.28.10.36.48; Sun, 28 May 2023 10:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=g6ggxEtG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbjE1RgN (ORCPT + 99 others); Sun, 28 May 2023 13:36:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjE1RgK (ORCPT ); Sun, 28 May 2023 13:36:10 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D7C4CF for ; Sun, 28 May 2023 10:36:05 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30ae7cc0e86so575573f8f.1 for ; Sun, 28 May 2023 10:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1685295363; x=1687887363; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Gw5Qo+KgJFEsvwVTc4nzprJkJaDeXrbywxB/oWvh/40=; b=g6ggxEtGVEtUCktAAhTgXY3WVZk1YMCG1UgXrLSNHm58s7+ASvPprSVWRIYVvaoTEy jWJaBEk62igYLdKu6NMhExmstadX52pSZZ4C7P17urQqKz6vrHQgZfFFyTzkmwcbC6iC N32nUEMfi1vjQC7lnLw3o3xNccWCb7GCnjWhZDndpp1jZV0mTKMB2uu71mBaJxoOGeSU 5n7dxkjAoL3SjhHmts0+D7Bw1P3/OiJDomd7LCwr900M/fJf2pUTkunlPncWbh4jNqLQ BphtUD5VSq7l2P9MjaPJyh+0bYjT+3yAG51sg/7pGGrIP7HQ6zvU2/P2Lo20/4pAwHXf 7UqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685295363; x=1687887363; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gw5Qo+KgJFEsvwVTc4nzprJkJaDeXrbywxB/oWvh/40=; b=f4qplBQqm4eb1oPcUs7+l/OA0zD5nbXTczHrgPXWfF+Vl1bTOTltuBmUSMsZJ2s3pM sAxF45ofkIgPkjz/+3kAfqIYvouXReIkZUoXqezJLZWShD/8PB4TN5o09jZjNRWwDnDb E3g+L8cOCljmjGqzJK2i3Gr3YhLjrvvxcsxwhhQGYxOaWeEpUgYesXNlJkbqASv+xOJv eV2omTEtP2Cv6npfll/VF+4Sxxw2Dy4dMVHMvFo4zFV709awZkKVsMDnlbKiK4EVrVpO p+LdtHDciHOrTzT1is6euaLLBCw/sU5L6aq+kVBRwywhfQIjzIJ1CI7kmTw0kLiSSA8D f+0w== X-Gm-Message-State: AC+VfDwaZafVnPUoJVh3gh7QmmzxgNB4OF7gVIVk7PkQxQP3pLw2xH57 5mqWk+l6CaOzPkOg+K28BlIe/w== X-Received: by 2002:a5d:5750:0:b0:306:2d32:8ec with SMTP id q16-20020a5d5750000000b003062d3208ecmr7086294wrw.6.1685295363515; Sun, 28 May 2023 10:36:03 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id z10-20020a7bc7ca000000b003f602e2b653sm15334523wmk.28.2023.05.28.10.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 10:36:03 -0700 (PDT) From: Matthieu Baerts Date: Sun, 28 May 2023 19:35:26 +0200 Subject: [PATCH net 1/8] selftests: mptcp: join: avoid using 'cmp --bytes' MIME-Version: 1.0 Message-Id: <20230528-upstream-net-20230528-mptcp-selftests-support-old-kernels-part-1-v1-1-a32d85577fc6@tessares.net> References: <20230528-upstream-net-20230528-mptcp-selftests-support-old-kernels-part-1-v1-0-a32d85577fc6@tessares.net> In-Reply-To: <20230528-upstream-net-20230528-mptcp-selftests-support-old-kernels-part-1-v1-0-a32d85577fc6@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Christoph Paasch , Florian Westphal , Davide Caratti , Kishen Maloor Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2362; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=N4Z8l0nJwYTCI5X9SpYQxTwd5KLfEUZJxihQPgZ+eIM=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkc5EAU38GHrb57SA9i8biGZvD1yosPf830vFU2 kNgxETB4qKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZHORAAAKCRD2t4JPQmmg c3bhD/0eOYcaxbZo7nEfJcBVAs+tJ4IXpv3FvVHmUn1/aOVTceLeAgNO9teozN+LIZ6DTcF3FJw PsYvgKYNjVZFNTwNyGB1me7fYFhNOF0/AepoFgzv9MUlmINpeApdQjJ84g8zIbYIaCR464jIc4S ylLC8+NVxllBuGfyHaoVdrJWkq3LzcqlMzFfZWs8Z+c0VboUCkQGpw4JYSkInm9u4ugTevn7dBz f4K0S5TemszQUD11oShZvdx4Pzghwzr3cgO/SZAYzDP1a+bZp0uj+04I/7wulcnw/BNpBtrXSlT /Aj4ljycP8NOPEWlXYbfGWfs54hFEQ5CB4DCCH1dd90c9uTAzfWDvgAO5gO3inzJ5JJUmlYcOCO TV8nZ1QXdGKm1GCcUblvih6l+1Hdmy/RbNxKLUjQnR3vCEiy7VVuoaFTdjHpZ8ixQp841FlkJ0C If703hO+3ie610NIOkio/IFhJPiLzQ6Rjd5B5y/Id7sO99HgpbA/QIxOGUWKBlGcAD8TRz5KcYJ c+seEmeEGca3KBpdEIXxxSWllM85xiTpMEhuPVKSM5+HKIADsUIoJQTex5h/lNS6WGYTAElLfGW PnqrIrJqXqel/v/6auE+dW5kd8x+/6VwiS00tuKXxqsW6eNmQONt8sHd0ZNIbK7Z4lvDejcBzEv vS7pEhMJCUW8pRg== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767160333020170479?= X-GMAIL-MSGID: =?utf-8?q?1767160333020170479?= BusyBox's 'cmp' command doesn't support the '--bytes' parameter. Some CIs -- i.e. LKFT -- use BusyBox and have the mptcp_join.sh test failing [1] because their 'cmp' command doesn't support this '--bytes' option: cmp: unrecognized option '--bytes=1024' BusyBox v1.35.0 () multi-call binary. Usage: cmp [-ls] [-n NUM] FILE1 [FILE2] Instead, 'head --bytes' can be used as this option is supported by BusyBox. A temporary file is needed for this operation. Because it is apparently quite common to use BusyBox, it is certainly better to backport this fix to impacted kernels. Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-cases") Cc: stable@vger.kernel.org Link: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.3-rc5-5-g148341f0a2f5/testrun/16088933/suite/kselftest-net-mptcp/test/net_mptcp_userspace_pm_sh/log [1] Suggested-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 26310c17b4c6..4f3fe45f8f71 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -17,6 +17,7 @@ sout="" cin="" cinfail="" cinsent="" +tmpfile="" cout="" capout="" ns1="" @@ -175,6 +176,7 @@ cleanup() { rm -f "$cin" "$cout" "$sinfail" rm -f "$sin" "$sout" "$cinsent" "$cinfail" + rm -f "$tmpfile" rm -rf $evts_ns1 $evts_ns2 cleanup_partial } @@ -383,9 +385,16 @@ check_transfer() fail_test return 1 fi - bytes="--bytes=${bytes}" + + # note: BusyBox's "cmp" command doesn't support --bytes + tmpfile=$(mktemp) + head --bytes="$bytes" "$in" > "$tmpfile" + mv "$tmpfile" "$in" + head --bytes="$bytes" "$out" > "$tmpfile" + mv "$tmpfile" "$out" + tmpfile="" fi - cmp -l "$in" "$out" ${bytes} | while read -r i a b; do + cmp -l "$in" "$out" | while read -r i a b; do local sum=$((0${a} + 0${b})) if [ $check_invert -eq 0 ] || [ $sum -ne $((0xff)) ]; then echo "[ FAIL ] $what does not match (in, out):"