Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp313149lqs; Tue, 5 Mar 2024 02:53:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWEj1GrbkcOrWCQ50Qju/9rcgRw72wZYu2fUa2hULxEGIcbxVhX1juJhXTwrxhvufzfaMvKvMXtof0EOq0Rg5e31KIO1sriYmNsjD/g1Q== X-Google-Smtp-Source: AGHT+IG/4lTp3gVOpl94V69qAnBpGMlUvxRP8O9l33109D0dipwSvFmkgCliWuKoM7BuTfc8gWwP X-Received: by 2002:a17:903:22d1:b0:1dc:1c81:1b17 with SMTP id y17-20020a17090322d100b001dc1c811b17mr1386067plg.55.1709636001829; Tue, 05 Mar 2024 02:53:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709636001; cv=pass; d=google.com; s=arc-20160816; b=BunVFz8QW0KD8AE7k4Oi2rD0EoCvIJS2V8n55v7ixnKRU7PxHbsk994DciAUfs3CY/ qIjwsdyy3mymODpmL5rQcSONigh54Js7UmWLuFMGVJBH4lzEnhA8JflSttxfzkDvLiN4 yPA7+I5Q1nyS+7jADzxXWCljPg5jpEHmqdCotO0Yk4aii+vB6Jf0N2LwTyozSPKktq1T WV7Y2J1y73Mac64ewrKwqJViovg7az1TGey+tMO6jjLKxKVc0TtgCUjCUfkCd+xTXk+P WYVNsC17uGd81bUWxCHqPFCp4xE22FN7V+Dq96xszqsDahVBFNq28GpGL5+0I9ucogdp A7EQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=U8M5tjwc34CuHZU0kIKBRejReo3dQ++G+qikLobXbRI=; fh=Z1YWgvxkmJ0/+y4FkLRSZ5mzUdtmyDAS67SU6REkp38=; b=PD/rtlqhhh5FTZAOiKkqKw4f4k54t8n8qOGeqkzU139FX9NRd7IWF9nxY3H4ltY6ar l7GZHYa++iLkj/IB0iyZZvqs6Dxt5t9Cw3axG9K4lR0zHOvKknpMO9bnturTNigFsPIM Zrq2+NfDwAFk+RQUINnCOFQQ5UKyRE2X7FrDeVx6XUinFOmJTux8t48bccE1MHQ9vBtO rVl43VttWt1x95PjiPcjXRNf1YhUomX/yHkI95PzbUtKLk4CbE4VkxWYnhbGyuxT5fH8 XJRueXMt5wTvBr/zEaVE1wXW491UtW+zNENCdGyDN/EHNTaUQcFLgkGbW4ejUJG4MU8v hmBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZCwGM0XE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lq14-20020a170903144e00b001dc6cd28614si10094416plb.231.2024.03.05.02.53.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 02:53:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZCwGM0XE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92171-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 24B78285016 for ; Tue, 5 Mar 2024 10:53:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD352629FA; Tue, 5 Mar 2024 10:43:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZCwGM0XE" 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 EABCA627FA; Tue, 5 Mar 2024 10:43:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709635409; cv=none; b=dCX1RmAbdmcz1uFvCyXRV+/oVMo3MT8yf7da7Z9ne5ZKTYFPD1/bi2c7lGUa6CH9w3MVl7UVt4GXi5IvzsGOTMdlYbTQ4mdgnyGZNPBH6flkcAxkINNehaPHC0bkc+KnScaorxOvI3Z7xntYBWO+3WKh7tsNnn/aSpBpnkz3ZsI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709635409; c=relaxed/simple; bh=QtfJT5E6kufllfcFPKcwgPK1Il9pci90VCMQW43RTRo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MpdvxPE32xLD1x1CH4+LQBe+Xk+sDlCXIq62jy1Ifvgpv07l538Cw93UIp4pVA5IwTMqvrbtGQPeSCCBxqtQB/pdc1B3z7U0rQkAMc3wvUrBdPApqh8gq+9gd41wAWCCdrAvJZndd1XWopghi+FmCFa5N2/JL8RpddzD00TTXuI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZCwGM0XE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E372C433A6; Tue, 5 Mar 2024 10:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709635408; bh=QtfJT5E6kufllfcFPKcwgPK1Il9pci90VCMQW43RTRo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZCwGM0XEt6P62ijtQFD8qpzWeflGR/wBtGc5n2PgR4pYkpO7vjPambe44QKg5bDmE 0dyeDR/65PiMgWBPoG5f5fq0heVKmJ/QYLuB1+Cnr7SgQfEa1MabbfKOWvtZQLW4Nb pYssD51obEpexmryr0xBUcA0CctHkl6gzxvXIKphPhDzb4Jz/jrVUp0q81jr2vO1g0 d4s8GGmOIieMwvbmUWQo51AIuOBXkWdyRMPcOzhmqW+plJ4Sad23/Px/cKftOYYtXn 5tp2vXbE0af4qu1j1boRpzOXKjMALNfHG+F7Il932Pwn20z8Mtucq04RQiJ3t8riVh 5qhZuCckbmfmQ== From: "Matthieu Baerts (NGI0)" Date: Tue, 05 Mar 2024 11:42:42 +0100 Subject: [PATCH net-next 12/13] selftests: mptcp: simult flows: fix shellcheck warnings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240305-upstream-net-next-20240304-selftests-mptcp-shared-code-shellcheck-v1-12-66618ea5504e@kernel.org> References: <20240305-upstream-net-next-20240304-selftests-mptcp-shared-code-shellcheck-v1-0-66618ea5504e@kernel.org> In-Reply-To: <20240305-upstream-net-next-20240304-selftests-mptcp-shared-code-shellcheck-v1-0-66618ea5504e@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2107; i=matttbe@kernel.org; h=from:subject:message-id; bh=QtfJT5E6kufllfcFPKcwgPK1Il9pci90VCMQW43RTRo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBl5vcdd5How8Yc22x+ON6/6wV9gS4fvwjKhJb8w b4wUPFNineJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZeb3HQAKCRD2t4JPQmmg c2X6EACgvvfo2GzCA1eyXyCLnYa2KLuKWCUIe9KChl3U5IBG+sTXrOhaGYmVOs/YyuPeHK9KPtT Iv8sE0cOpWJluKhyYIlAq/aXSm6BDgY1rjUZdGsgQEeIleCPN95yY5/6ZSHDXH3eMDuEfp16sbM oS6imX2b6zrlQG1ZGKfewzp4JTfJVDm7vZluuzmZzJJeBtPEhs3UAe8Lu+IMAsrgZvP+9I5YxB3 PTCBTZU8CCiGSltb1nXtN6VB08f6lh9g/iapSKeLobBWLfBu/mtAZzl7NkGiCJqFMKPmdNpgIo6 z6PK0S+PK2oN5paChr2/Lk7RoTxgpvxqar3m8OBITWjlBqNQeR0GYK5ETw1JtPLnj3sCCfgucEB qBNag5JZz4/1inIhYSkq9q+WsI3TWe67FvtiYRAwH6tA3QXSS8FTTernqB6KsIaHWEG8FiN4pKS v6KI61DeV6ciPxPeiwkoanBpk7FJzbdJMP791CEXKAlOQ9TJrEp65UV43/82uxc6HJN1lK4H01A yxty8P9sKLB1oBs+zKnR5bLN00k1AupwOA6r7a1m+VqkI4aY80+nvWdiXoc2n+twTpcYxXSEuNx pF4GoOu+iWTbXxYEfZaw0m8393AADgbdrEaVEcx81bn2d/MPWO+HHY8lPnyGuCj8//j8ly78jVT J5Ahl5qupPIEr6A== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 shellcheck recently helped to prevent issues. It is then good to fix the other harmless issues in order to spot "real" ones later. Here, two categories of warnings are now ignored: - SC2317: Command appears to be unreachable. The cleanup() function is invoked indirectly via the EXIT trap. - SC2086: Double quote to prevent globbing and word splitting. This is recommended, but the current usage is correct and there is no need to do all these modifications to be compliant with this rule. For the modifications: - SC2034: ksft_skip appears unused. - SC2004: $/${} is unnecessary on arithmetic variables. Now this script is shellcheck (0.9.0) compliant. We can easily spot new issues. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/simult_flows.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 5a4b83cdaaa9..365fb3d6ef55 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -1,13 +1,17 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +# Double quotes to prevent globbing and word splitting is recommended in new +# code but we accept it, especially because there were too many before having +# address all other issues detected by shellcheck. +#shellcheck disable=SC2086 + . "$(dirname "${0}")/mptcp_lib.sh" ns1="" ns2="" ns3="" capture=false -ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) test_cnt=1 @@ -28,6 +32,8 @@ usage() { echo -e "\t-d: debug this script" } +# This function is used in the cleanup trap +#shellcheck disable=SC2317 cleanup() { rm -f "$cout" "$sout" @@ -120,7 +126,7 @@ do_transfer() local sin=$2 local max_time=$3 local port - port=$((10000+$test_cnt)) + port=$((10000+test_cnt)) test_cnt=$((test_cnt+1)) :> "$cout" -- 2.43.0