🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13570

[PATCH net v2] selftests: net: forwarding: replace bash brace expansion with seq

#13570
From: "Jin Li"
Date: Tue, 10 Nov 2026 02:41
79 lines
11635 bytes
{1..16384} is bash-specific brace expansion and will not work with POSIX
shells like dash or busybox ash. This breaks the flowlabel test when
/bin/sh is not bash.

Use $(seq 1 16384) for portable iteration. Fix the same issue in
custom_multipath_hash.sh, gre_custom_multipath_hash.sh and
ip6gre_custom_multipath_hash.sh.

Fixes: 555e5531635a ("selftests: net/forwarding: spawn sh inside vrf to speed up ping loop")
Signed-off-by: Jin Li <jinli@lanxincomputing.com>
---
v2:
- Add Fixes tag

 .../selftests/net/forwarding/custom_multipath_hash.sh     | 8 ++++----
 .../selftests/net/forwarding/gre_custom_multipath_hash.sh | 8 ++++----
 .../net/forwarding/ip6gre_custom_multipath_hash.sh        | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh b/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
index 5dbfab0e2..92940370e 100755
--- a/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
+++ b/tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
@@ -224,10 +224,10 @@ send_dst_ipv6()
 send_flowlabel()
 {
 	# Generate 16384 echo requests, each with a random flow label.
-	ip vrf exec v$h1 sh -c \
-		"for _ in {1..16384}; do \
-			$PING6 -F 0 -c 1 -q 2001:db8:4::2 >/dev/null 2>&1; \
-		done"
+	ip vrf exec v$h1 sh -c '
+		for _ in $(seq 1 16384); do
+			'"$PING6"' -F 0 -c 1 -q 2001:db8:4::2 >/dev/null 2>&1
+		done'
 }
 
 send_src_udp6()
diff --git a/tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh b/tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
index b4f17a5bb..19384be4b 100755
--- a/tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
+++ b/tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
@@ -319,10 +319,10 @@ send_dst_ipv6()
 send_flowlabel()
 {
 	# Generate 16384 echo requests, each with a random flow label.
-	ip vrf exec v$h1 sh -c \
-		"for _ in {1..16384}; do \
-			$PING6 -F 0 -c 1 -q 2001:db8:2::2 >/dev/null 2>&1; \
-		done"
+	ip vrf exec v$h1 sh -c '
+		for _ in $(seq 1 16384); do
+			'"$PING6"' -F 0 -c 1 -q 2001:db8:2::2 >/dev/null 2>&1
+		done'
 }
 
 send_src_udp6()
diff --git a/tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh b/tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh
index b24acfa52..d848e82d4 100755
--- a/tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh
+++ b/tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh
@@ -321,10 +321,10 @@ send_dst_ipv6()
 send_flowlabel()
 {
 	# Generate 16384 echo requests, each with a random flow label.
-	ip vrf exec v$h1 sh -c \
-		"for _ in {1..16384}; do \
-			$PING6 -F 0 -c 1 -q 2001:db8:2::2 >/dev/null 2>&1; \
-		done"
+	ip vrf exec v$h1 sh -c '
+		for _ in $(seq 1 16384); do
+			'"$PING6"' -F 0 -c 1 -q 2001:db8:2::2 >/dev/null 2>&1
+		done'
 }
 
 send_src_udp6()
-- 
2.53.0
Technical Details
Message-ID: <20261110024123.535210-1-jinli@lanxincomputing.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359767-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359767-linux-kernel-netdev=dewy.ru
From: jinli@lanxincomputing.com ("Jin Li")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2] selftests: net: forwarding: replace bash brace expansion with seq
Date: Tue, 10 Nov 2026 10:41:23 +0800
Organization: Usenet Network
Message-ID: <20261110024123.535210-1-jinli@lanxincomputing.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="503846"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Z2/DneqvkyO8nGF3p3733HhkoiI= sha256:CuddGWSAb/HySllt8HHolaZHMZa3eWHXVHvPsYJZ2is=
	sha1:yyq3xgm/YAKLFg76y7E+hSuR9EA= sha256:HxiONpENxPHdRMIPSeBSDW3GwrvGpF111f3WvbQa1+o=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8DC2E1139E7; Tue, 10 Nov 2026 05:45:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=lanxincomputing-com.20200927.dkim.feishu.cn
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id I3Ql8OKTyKdB;
	Tue, 10 Nov 2026 05:45:05 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359767-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=lanxincomputing.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id A3A9E11397C; Tue, 10 Nov 2026 05:44:56 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id BB38A3D3F4; Tue, 10 Nov 2026 02:41:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794278505;
	b=dyVPEgOh3HU6f9IisOiCZh/ksvAfk5K2MY1eTdBEyMobFvMPWTUDO+2dYk3fTpPgRzBv
	 uM/rivVnoB8z2JVnL9lAu5TVQDjsTcWXRK6qkCx6+kiVYN4dpNc7xw2B8Vj9RZC9fJsPW
	 J1EUNUVIkzWC/7/ugqurMbK4Y09ShFv5s7C5ijUJz+PEARWRYyHtFwE5Xp67t4dt1F4e0
	 1+uKiKaKIKNZirbVfAgCk0qf7e/Iq+USHR9D/IUTzyCLE3tVulRwoZqXnV57G6AFT0odT
	 SYtKNrSNy5dDdNsPagmMjexqAogR7vtVQwYZYSzWAaWo48UbsMEg40HpXONVkTfnyKA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794278505;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:
	 X-Lms-Return-Path:Content-Transfer-Encoding:To:From:Date:
	 X-Original-From:Cc:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:Mime-Version:
	 X-Mailer:Subject:Message-Id:Content-Type;
	bh=rPoVYl5XhffNID/3V35m4DVz5rHd/NjoZ7mdTI10EK8=;
	b=ujhSqqSsqXmLItG9xnq5LUZEBS+owXFeNeX/4CRpLR9ooCjizAFJAsWWdEd33K6X5RAi
	 bPf+b7nKRc/Uwc+10o05Cu4Gqo1jSqiHrRHMYFiXE9NPeo1GaGPuVHtL+wJkEXqFOUoZl
	 V/mQpJMyzNyBwVkeldc9a/4djhf6R9nMgO+8f5Nah8hJN8ECyVCRdLA1UZ0U4uXDYSSwP
	 R9UGLnzDAHVRViDPEahTF5rYloqgoi+YeU+ymiyN+ibfj9cs/dV4g7dsBeV+NGOiK9qdE
	 /6q7Ey3BGD9klXr7soHJ6rDohVqckJDUw6VvzfN+ENZAvVlGE5tAVsMaAZ7JMvxzI1Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.a=rsa-sha256 header.s=s1 header.b="gzAiSxe/";
	dmarc=none header.from=lanxincomputing.com;
	spf=pass smtp.mailfrom=lanxincomputing.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id EC078606A332;
	Tue, 10 Nov 2026 02:41:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.a=rsa-sha256 header.s=s1 header.b=gzAiSxe/
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.127.231.40
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794278499;
	b=nG+6rBp+3D92Sw0yClaHVORrUsA5dwsB79neWwY0XJVhceykVebvG1Cx2Z9RJfXxkCQT
	 sQx5vOTXGlscmNJiATwa3n6L3hRd3DzLU8U4dK3ONd3sNSOYtNJG2c1Pb0Vce6xKwwAEv
	 irAHuIeWmeV2aBh1iI/1l1Rcf+GJm1h6p9rglh0aI3ANujsxe50CpCV/5CCub3GOJ6XAs
	 u7vQlmhOVmZchRLXDdj3p1WH+ecLTq/7LkmQXMc2IQT2N9DdH53kCP1ZNr1YsEMhhw3Yv
	 M3vxQZgjtcboFy6C/LLKkzSUjbBTmIZF0maDrmFtFmtpFDxCB287MkZ69dQ1vwp1omQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794278499;
	h=DMARC-Filter:DKIM-Signature:Received:X-Lms-Return-Path:
	 Content-Transfer-Encoding:To:From:Date:X-Original-From:Cc:
	 Mime-Version:X-Mailer:Subject:Message-Id:Content-Type;
	bh=rPoVYl5XhffNID/3V35m4DVz5rHd/NjoZ7mdTI10EK8=;
	b=e0yVs335/mSFy9PiCkEsYnjLnKbUXiftTSXUDR4wSnkLQ0e8kr720SOBzkWPB+3u941x
	 sceDKGVkDVu2JEgG5YoVTTWx8DvPrP1kR2fLTI+trrUAxIZXN6/wldl9LYwgwKhae2iE8
	 06+t6pKGavYtRBp+M4ctWTds3rmssWPWcLmpTeFErNbdx0l6KDvCfsqHmEytfjmjiz+5n
	 1hST5m15E4WXtLJ33mAJcWe+9o3y3OyAfWOxx93UpoiPGqRA8YAyDyZzRcEz4TeqNqN4V
	 DH8rXPUecEL08Tku4cX3l38Gq1C7P8IeuCad6kxZ8uY0nMm8skyyVL+PKZYmykkp3Ow==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=lanxincomputing.com;
	spf=pass smtp.mailfrom=lanxincomputing.com;
	dkim=pass header.d=lanxincomputing-com.20200927.dkim.feishu.cn header.i=@lanxincomputing-com.20200927.dkim.feishu.cn header.a=rsa-sha256 header.s=s1 header.b="gzAiSxe/";
	arc=none smtp.remote-ip=209.127.231.40
X-Received: from va-2-40.ptr.blmpb.com (va-2-40.ptr.blmpb.com [209.127.231.40])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C36D606A321
	for <netdev@vger.kernel.org>; Tue, 10 Nov 2026 02:41:36 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1C36D606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lanxincomputing.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lanxincomputing.com
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 s=s1; d=lanxincomputing-com.20200927.dkim.feishu.cn; t=1794278491;
  h=from:subject:mime-version:from:date:message-id:subject:to:cc:
 reply-to:content-type:mime-version:in-reply-to:message-id;
 bh=rPoVYl5XhffNID/3V35m4DVz5rHd/NjoZ7mdTI10EK8=;
 b=gzAiSxe/p0SPFoUDwY3q4yCkV6tuziRId6awtTfPqmkdYvK1BzhrDsW/7psvU8R2FaYkn+
 w/IryLVgTEbwkcg/Bt4tOkcpEVm08/njFnN7O5M6X8itUKIVf2NrrsiJ7F7XezHQ+Ge8X2
 0AP2xHeANP6sixQ1Vad4JRK6cGq9qaEX2Wg7pMxnJ5mIpOPGNkA4nb3xhI5zK8z8WTeOTz
 pQTpkbQKUMLBxSxImUJP5f52du7GOcLpNV9jBAuW+JkPOiRCBihQWrHEAhqs1EP5oCXik5
 3Sihgbg6dEHP4AQjnGr9JHSXDq9b3G6RUMLO3/WVeI4PaMIA7kXHRlnCgmkpmw==
X-Received: from Test-PC-Jinli.lan ([123.120.5.129]) by smtp.feishu.cn with ESMTPS; Tue, 10 Nov 2026 10:41:28 +0800
X-Lms-Return-Path: <lba+26af28459+5267c9+vger.kernel.org+jinli@lanxincomputing.com>
X-Original-From: Jin Li <jinli@lanxincomputing.com>
X-Cc: <davem@davemloft.net>, <edumazet@kernel.org>, <kuba@kernel.org>, 
	<pabeni@redhat.com>, <horms@kernel.org>, <netdev@vger.kernel.org>, 
	<linux-kselftest@vger.kernel.org>, "Jin Li" <jinli@lanxincomputing.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Mailer: git-send-email 2.53.0