From patchwork Tue Jul 4 20:44:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 115900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1458957vqx; Tue, 4 Jul 2023 14:03:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4eMcxNX4vQ3XjxgJ8Y/KxKVWusa3c3NlOCDDS39g/xr3JuLaHD1PIHSzdti9lcYLlDAt8/ X-Received: by 2002:a9d:6e14:0:b0:6b7:539f:d1b0 with SMTP id e20-20020a9d6e14000000b006b7539fd1b0mr15105399otr.31.1688504635042; Tue, 04 Jul 2023 14:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688504635; cv=none; d=google.com; s=arc-20160816; b=iXJUxB2st+s4betAyogC4lxABY8HfhKAlMNnrSweZb36xachNLHm0CEdI42ZSjlTUI S9djjEK69FwaP9Xuooy4K7p9GxG76VQ16036zIX0L7i7r6ZAToHZWS6kWTqAyegrk0D0 J7OtLIOO/UVcv4Sx3Vid3LnoBJ0l4tcrpdx8z6c/IcHNyICFU5+Adp4nlBMI9yaQEIMN a85mnr2x367qI15drCJw7vtEFSwJ81DRKjeTddNcWLiuWwL/MiD0mw1LAuZCrBlsyQ5B wUR/S/lsyV4Saqc0q+UzvzV2+K2CkhtxQvqJ2ISRlNL0E+KwwcN4Tn3c1CFkN5LxcIwt Snlg== 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=W2bvJB/FZnxo5jzEr4QcC8QklV4qR/ytDAB3uSZlV1s=; fh=dwGQIv9hBuwpIyw5J5filTZo0jFzByE6GAwByOAQtIs=; b=nJt290tpNpFE0dYOpDtEcLEcfvhzxF1kmLqd0Yh8dvWuv+YZ5HjC1PRJt/gRZV1ycQ GV4A76I1obTHk5BdnHekaONBOm2JkKaBV7SXj1C6nT7gx+gydwllmCVFvjQNNbsW+8ZB 5XRVNc8Y42+CMfeYhXJGPlceDFNRS876yrwFVeqqLVJxXNxUfwcpnA7pxOzluAq6Jxpv 1dr5+dBGf7tL8dxuFVfiER+eUcbVLRBOcY2uhXQbC2QAapUy8N5O6H3ygGF3tAxzUkLF PwOhjeWtip+O6a70DfiVagizK/RDuUxb/hnKoqxUd3KqfZdjvrRWABM8Utp2F3Dg4qUE u4Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=tpnnQtsF; 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 k68-20020a633d47000000b0055bd09bffbbsi1047247pga.862.2023.07.04.14.03.42; Tue, 04 Jul 2023 14:03:55 -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=tpnnQtsF; 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 S231579AbjGDUp1 (ORCPT + 99 others); Tue, 4 Jul 2023 16:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbjGDUpA (ORCPT ); Tue, 4 Jul 2023 16:45:00 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD01EE5F for ; Tue, 4 Jul 2023 13:44:58 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbc59de009so62572815e9.3 for ; Tue, 04 Jul 2023 13:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1688503497; x=1691095497; 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=W2bvJB/FZnxo5jzEr4QcC8QklV4qR/ytDAB3uSZlV1s=; b=tpnnQtsF4wgpEDKgyTJ6ed4dl6w5FMipqzLOw6tx3Dnaxk+xjQG7Beq2jlvysO1P7o OW8iUB/ERBAFCOOGej3B6rOkfDoif4r4Zh3pxBcFoV5l93D/slqdgHtMD2sHMyAL0Bkc wV0RXaI2CN8PJ1Ju2kf/7uyuIDwcmFSLunWcAYpV+/LVZNJbMNngdbffUhv2709YGwuv i9qu67H0F7BTc9FEJ/BA4ZMePXsbnHoHEHUpN6yJicH12QzYzwDxeD4iSAXIT5ihNXXJ xuJqQ0PCgbEg4hiEZPE455N+NDVIB+LwDqTXVv9Crk9CJVpVUE78va0Q6DB+O4Lvnbs/ 0hvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688503497; x=1691095497; 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=W2bvJB/FZnxo5jzEr4QcC8QklV4qR/ytDAB3uSZlV1s=; b=KJdgc2t4u9RfLsFEUnAp9sg7OWKAmHNQf68uqgyxMAOjf/rQiq1sAMMLWbBo0SkFXi BwfJU+0MwTHO2Eoez+F6RgeiIu/JvCljTMcp3Lgsmsbe6uS/rumJKn/Wt0azia34WlHX G068PtTAtAPvwgTCvcLmzes2m8MLNp81/JzdqbYWTYRB3fTzuhx/TNaHO5iv6psH+R3A aeJdTUEaJ9IQPN/tFqshQDgpToAYNh4jkurfvG8cA0RhvidpDSCqVwl4BwyVlys2BAyQ Arodra7fQ7C9LCN6xiuXhSQ7BANlsJkmYhODZ+uiuKl4KNent3xRWAKmYrF+7eGKUo7C uCdg== X-Gm-Message-State: AC+VfDzmk5XdmNJJYkGZUOkXL2lreIzm+I+edOcmSVws3YdAV6C0U/ya 3fu/datTMEmzou1ij5o2NubIEg== X-Received: by 2002:a05:600c:ac6:b0:3f8:f1db:d206 with SMTP id c6-20020a05600c0ac600b003f8f1dbd206mr11700790wmr.25.1688503497372; Tue, 04 Jul 2023 13:44:57 -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 y4-20020a05600c364400b003fa74bff02asm115332wmq.26.2023.07.04.13.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 13:44:57 -0700 (PDT) From: Matthieu Baerts Date: Tue, 04 Jul 2023 22:44:37 +0200 Subject: [PATCH net 5/9] selftests: mptcp: sockopt: return error if wrong mark MIME-Version: 1.0 Message-Id: <20230704-upstream-net-20230704-misc-fixes-6-5-rc1-v1-5-d7e67c274ca5@tessares.net> References: <20230704-upstream-net-20230704-misc-fixes-6-5-rc1-v1-0-d7e67c274ca5@tessares.net> In-Reply-To: <20230704-upstream-net-20230704-misc-fixes-6-5-rc1-v1-0-d7e67c274ca5@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Florian Westphal , Kishen Maloor Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=/4aVehRRev3S9W7xO/C/bt4X/bbi2VBYNMNB8ebnj08=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkpITD88GNsyzRs/Tn2r9ymESxt+KclVLdGUYpm d1byI6+yIOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZKSEwwAKCRD2t4JPQmmg c0nID/9d4QgKyGlEbMrwRLBaFKGQcBe2iolm2sR0Pv+l+rfuo8J5Xv1tBKHCOHZO+Og2P7XmlwR hc9j2ftf6IDaJpm8S38nnWV1QYwEWnzUgqroiN6a800Tw6vfTi6CInIZMAMuRSTk8aPn5Bquhpt XmIaqKbbUJHtBacCcCd4d9biN1+83oUlTlYMyLtPNIwQqbzwdtiAanCKy6onN5mQsMNBrz+dk9s PDu4AK3IMI/3WYlET+WCiojzkSce7xOW0jbTYkJT2C6BPjsi2fCXkdmj8C16JALj5uWSYf2zhVn OSGlpujXdlnIZCO8OJkOLvp8R72USRz1T6fVIUqjn0x4/Bk6nDpDzyBbyb9azy8J4b0jLssVLRH OIgJZQc8j5vk6d7et8sW5X0O+qHE1KHgy/KCJc5qt20KwMVpSokWzvaFEV8AiEgGDEgu9on7OEH JN5ZaDgFrmbIUSobBo4czJlM/IzzP9PKDyC47Mv2fSj8uvCesV5EmvpcZF+z6oHPk5BkqoAg9nU lF0jWWjkiMOR/uCsO2YccugMiloIOPB0lFB6wYvNzIFJ/hBUImx+acGsi1ETN3CxeOGtD/zQsqh cDaHYvsj3UY7bSKgtuXx39DiIH+x2iW4l00vEAfTxhV1TeklUoeHc/UxObBBols6NEOYaqRulBU MvrmanPtSkYfADg== 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,URIBL_BLOCKED autolearn=unavailable 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?1770525436364262980?= X-GMAIL-MSGID: =?utf-8?q?1770525436364262980?= When an error was detected when checking the marks, a message was correctly printed mentioning the error but followed by another one saying everything was OK and the selftest was not marked as failed as expected. Now the 'ret' variable is directly set to 1 in order to make sure the exit is done with an error, similar to what is done in other functions. While at it, the error is correctly propagated to the caller. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: dc65fe82fb07 ("selftests: mptcp: add packet mark test case") Cc: stable@vger.kernel.org Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index c21bfd7f0c01..dc8d473fc82c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -128,6 +128,7 @@ check_mark() for v in $values; do if [ $v -ne 0 ]; then echo "FAIL: got $tables $values in ns $ns , not 0 - not all expected packets marked" 1>&2 + ret=1 return 1 fi done @@ -227,11 +228,11 @@ do_transfer() fi if [ $local_addr = "::" ];then - check_mark $listener_ns 6 - check_mark $connector_ns 6 + check_mark $listener_ns 6 || retc=1 + check_mark $connector_ns 6 || retc=1 else - check_mark $listener_ns 4 - check_mark $connector_ns 4 + check_mark $listener_ns 4 || retc=1 + check_mark $connector_ns 4 || retc=1 fi check_transfer $cin $sout "file received by server"