🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14359

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

#14359
From: Hangbin Liu
Date: Wed, 11 Nov 2026 01:32
82 lines
11495 bytes
On Tue, Nov 10, 2026 at 10:41:23AM +0800, Jin Li wrote:
> {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

Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID: <avPFwYGo8ssob1n4@fedora>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360811-linux-kernel-netdev=dewy.ru
References: <20261110024123.535210-1-jinli@lanxincomputing.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360811-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] selftests: net: forwarding: replace bash brace
 expansion with seq
Date: Wed, 11 Nov 2026 09:32:49 +0800
Organization: Usenet Network
Message-ID: <avPFwYGo8ssob1n4@fedora>
References: <20261110024123.535210-1-jinli@lanxincomputing.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="750436"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+x9OU8N2H+1kHFJOkAvuXHOtpkk= sha256:8J/xCPscMmCMUKLbobSlUQdtQ0YMlUsGY5/oTkOczWA=
	sha1:ttnwvdcUAuixOLKtIroytK/U/NY= sha256:dzdOJEjPs2j2dju/He6BYczQc3GXh3ZAwkjSmzUp8k0=
Content-Disposition: inline
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 D1C66113DFE; Wed, 11 Nov 2026 04:33:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-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 (1024-bit key)
	header.d=linux.dev
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 0EsBMddhyrwz;
	Wed, 11 Nov 2026 04:33:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-360811-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C59411139C7; Wed, 11 Nov 2026 04:33:19 +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 20E6639F43; Wed, 11 Nov 2026 01:33:05 +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=1794360785;
	b=xbV5RBB7g4c7DKMYyUZUfi2MWB5dYjLcIQp+45LfkahcHRcjd6hB0QnvgRj/ekHdMNNG
	 BHELBd2h7WtR/Y/piAgNsRzdCxKcQo1hJf0mJim5+D7nsZg7Gs1aQ1JO9rW+D6k+rw5kU
	 9MC4CuSpWbqLcsTCyCM9OBgV7RH/A2Cx+A4oXP2VxyCWs3htmkYUunWs33fLMtpQozwnh
	 lcyAeyFNJt7YxEeSre7fZbJYzmcxPujVbusb8H9UTZSQMsXpVSC2yODUxPeKMPzXRl7lH
	 oAb7KjPO354ivsiArCgmR6Qi2njWnisM+UsYktah8HsvX0TKMwmMyKy+RJAtTA4kNew==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794360785;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=X239ULUfyrkajaKunHQocU2OLTbPnPbw7F9duFc9+NU=;
	b=naZPUKUZxGTTcl+MCrz+Xem4B1cT2s2C17mBHDgPoVY/Ja1sGWd30tn79AYpRkZ9e+ii
	 Cd4yEGAo/cPSLSvK9Ss+Hgeh6CtlmCMUaxst7CucFT5T3Wjq8YQX3XLgeYS7OuJ/m2FjO
	 h3Dw0NLFYBo4nKJnJRAXK0igzPAQY6vVD089+qzCCgBbKmI8QUCZejm3M4WY8iu/0pY6r
	 zBq5YYm94oNR5I8/+DClPNu227Bp/YoZwbsrqZAPLs2G2aapecHrqsjltmNXL3w053BNV
	 DLZEDb9Pn74nwdAyTIOBn7pH3yyzfN63xaOMpX1HZo/FXcWJPCgxzKLQlnCDI4Uu8jg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=bymnudtp;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 E9D1D606A32D;
	Wed, 11 Nov 2026 01:33:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=bymnudtp
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.103
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794360784;
	b=1vd1Sj5PoBWpW8+5idJeoljVKGljTiQBwSJHb4LK0whafK80TvphEcZz9w0YrMhfepsH
	 /ShfYIhnIbH7Dwm3gIob1lYX8kttK5BurHqRM5Mh8XNm3cdbtwq9o1cS/LPqTW8iAE4lT
	 s+J8BVWzhDe2D+q1Xkr80iXq9S/InLGXj3iqPVJwYAXFQRy6oCPw3vmkFthcMq6FWZ/ye
	 /dXAdFhxZhsPIJWMvWRPaYE9SRUzS7jtqW0bPPG5g3QDfa8xdQ5WZA4kIUfXtOOgI4A6X
	 kgMDlbtoSx6E+PEHCYXRO/ayV+SXtQRBlrOFcDlAmPVxXADElxBXGavQAIZ2FwLBZTw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794360784;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=X239ULUfyrkajaKunHQocU2OLTbPnPbw7F9duFc9+NU=;
	b=DwLiXzo1xl5OOXvig6F4gQwtZ0GnFCejBTBNFtKQXlzyjlircFfoNdRqhAG8OL87hQiX
	 aUhUIP7ldvRIvd0TNFKLKvmipzAAZcfRM6ubeLy1Sl2dIpJ70Orp+LHHaPhxjqu5IMkBk
	 eKZazIcjIekErpcHTZPQvSpYY+1pFy38tvDYzNYbL+rEfQIHDKW0nwWTVRlgQjDK5waZQ
	 K3lHWolJpFHsWIWLvcUDi0XM43twvuo0D/beG4IeyOfp5xxToz+VZ4deQ/rgyR8ZOYD3i
	 wnxgrKBuIjrxbCtf2yzxq3do08qbsvK8JAOFM+G5KVOfyxTXMmMt9xLgBLGdVGYwBNA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=bymnudtp;
	arc=none smtp.remote-ip=95.215.58.103
X-Received: from mta1.migadu.com (out-103.mta1.migadu.com [95.215.58.103])
	(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 4406C606A31C
	for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 01:33:02 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4406C606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=DzAs0Ah3oQjKHGbmLPoxZJXiKj68MaVFY04XQvUCebE=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794360781; v=1; x=1794965581;
 b=bymnudtpWXdkL9RA5rCZn+RZe5Ui5Ba8ew1IJLZ4K8caoSfCXwsNjacplXMBfpnjaM27rJ3D
 bkRhFRtQx2yTEBav/NLtaXfuecjxcxgrJfrIcf6/6vh2M0mxrFohmlvTYY6TqeQ8JLqawPtG1Jy
 X970BUWY8xH8l7koK1XIGw7U=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta10.migadu.com with ESMTPS id 66aefd4644d8a26d;
	Wed, 11 Nov 2026 01:33:01 +0000
X-Mizu-Trace-ID: 66aefd4644d8a26d
X-Migadu-Flow: FLOW_OUT
X-Cc: dsahern@kernel.org, idosch@nvidia.com, shuah@kernel.org,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org
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-In-Reply-To: <20261110024123.535210-1-jinli@lanxincomputing.com>