🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12929

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

#12929
From: Hangbin Liu
Date: Mon, 09 Nov 2026 01:57
83 lines
11466 bytes
On Sat, Nov 07, 2026 at 09:34:16PM +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.
> 

As Sashiko suggested, I think it makes sense to add

Fixes: 555e5531635a ("selftests: net/forwarding: spawn sh inside vrf to speed up ping loop")

> Signed-off-by: Jin Li <jinli@lanxincomputing.com>
> ---
>  .../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: <avEogwUP8hr4IXpS@fedora>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358960-linux-kernel-netdev=dewy.ru
References: <20261107133416.212677-1-jinli@lanxincomputing.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358960-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] selftests: net: forwarding: replace bash brace
 expansion with seq
Date: Mon, 9 Nov 2026 09:57:23 +0800
Organization: Usenet Network
Message-ID: <avEogwUP8hr4IXpS@fedora>
References: <20261107133416.212677-1-jinli@lanxincomputing.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="248539"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wfEU8+ETRJYJ+VFcakfdrxsMR+I= sha256:67asrOmoab+YUPB90uXfuFiQOEVsEHgOwLswr0B3/RI=
	sha1:PUSjsQ3hB9EAP2n3pWIib4GQ02Y= sha256:CSXDJaknbQulozJG2BTveC7rd76v0VP9D3UCQHORA28=
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 AFD79113646; Mon,  9 Nov 2026 04:58:04 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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] 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 MLyyCgkwhNpK;
	Mon,  9 Nov 2026 04:58:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-358960-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 353A311368C; Mon,  9 Nov 2026 04:57:53 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 72B0E66BAF; Mon,  9 Nov 2026 01:57:50 +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=1794189468;
	b=1Bbl71hHpD7vFZ7pMssGxhsCVnVkd8jCy/L0Z7whBVgqMYO4qnXRz+GWxXFZZrysMj6G
	 aYW+w1tAUVUvnLcKBfpP8JszZlK06HVzN90ex0wPA72FOJYitW8RaOPAuOJkpFsMJrx/o
	 VjvqED/fZGQ1TJOe/ZWcxyO3oVdqV2XYK6RG1EpB+wDvhSFWlzb6wUd61ZCxdh2gyUw0y
	 YCiDGceK6Laz1HJXs+e48bgvuP5l/XQbwgCq9l1P0VoSEmvc+3YC0V6ZL4bXVmedEXOYx
	 EX3G/zgNZogKD5hHzowy7PG344rQZDoeajpEQlptrTtB5ByXzqZQCKKV+fvm1TV40EQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794189468;
	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=A7ZxBYqNVCXEXK6aupNcjX9RAPitglwASVMpqA1lXnk=;
	b=ANX30kRSnPWRw0dIPfmPlu4YTuaDKUFi6QxLJbq4us2GK5MpaGnLQDUIwUYaUOQ3k5YW
	 pX9aEmy1iZU3DeeCOEbM9rOp3AlXUiKJ/LRRy9T2IxW0wTw+DFK4brWVZPZeAJfCtjwHZ
	 N2FBSbOUC5lkf5yCNo+NrbG28zQiO8KmYkEsHSzB3/LN/KY5+zVvEa9NIjf1fv61gbnSj
	 V1yCbrvyo1NLnjrdgjIfHjP2hpLQERCFxbmqIFDaCngkuo6j/+jg0bG45iahQCVNvm/Xl
	 MvtPrr6x83ouSrrC+V3PMO4wLKRdSiswPz5No9pQaH34rJSG/MbzZd3IrKxR58RAmrQ==
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=VpeOhxES;
	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 3F74C606A32A;
	Mon,  9 Nov 2026 01:57:48 +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=VpeOhxES
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.1
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794189462;
	b=GYNQ6unZ8tcl4uy2Nn59FQX+xLXLicshhzU3kh69C1o+buwa8miTBbTVHwSsYMbUqCae
	 +RnQlJeQ/Kpummxs1gCbpMsRm3pGju1iR96bX/m2qC08As82mBBCIA/34OAgfbJU69tfd
	 EFVMRJf+/bLQqOQMbIldFt1W/xJcJVDXbkLiOGvw1OUJbQlldErRdnWHgPDBYhvmkMXfR
	 DBIGMi5YTn3E0ks92d+sJzzrWPuboaK/RKtBILxUsuWdH0fq/GM5Mho04c0mz4UvRovdA
	 9t/Yiuig4+HMUA3lVYN1IRZlp0LcUFpm0tKkVGdMi66ORsPSWe1r1T3Ae5OERRQXwSg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794189462;
	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=A7ZxBYqNVCXEXK6aupNcjX9RAPitglwASVMpqA1lXnk=;
	b=QUv6p+N3CXhn3nEXmTPI4RfjoDN2i7LiNG0NHTNoSuuaDTxnw4PK5nEJ42KQoQwBoNrE
	 7igTNKtgQSSnJ70/4Z/BCwE/rn00vv6xedZRbHnvFt1OPcSFU/nuoj/89JPuFaRDd/xCf
	 LcP/E6+ZzDv7Al/iN91sFi6X5i8FDKao/ztztn44NzkWILtXXvyc4zd1anbXOdbRsbJhO
	 C7ITSjrmx4seaJh6zkbE3w3nnhYhwA6mOj2QS4Z6H1t04GWyL3/ymSd/C+eB/DMCxYUyM
	 DEHswmr00IvoxGepG6lENZY8BYSUTPzStcxhxo7qoUf5PifbIAPl/BHMaoBfooKlCJA==
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=VpeOhxES;
	arc=none smtp.remote-ip=95.215.58.1
X-Received: from mta1.migadu.com (out-1.mta1.migadu.com [95.215.58.1])
	(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 42B66606A322
	for <netdev@vger.kernel.org>; Mon,  9 Nov 2026 01:57:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 42B66606A322
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=bequIIgc0ooAYgel8f/D35b7e5MsNbckYxDf2IP2oTU=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794189459; v=1; x=1794794259;
 b=VpeOhxESQJ503dIsurVClbeI/tdEodd0bOtSczm60Yam+FzJwoYWsfPnURVPMdaWUcG8MiQe
 3wNgh6clRwe+a/Ow1eaJvos6TcZLGIzfapOtHNUprmNuTTzNp2gk5Fzgf3AvYYsqA8dWGJXb6B7
 C5xpWxkHFcE6gU86AlossBhs=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta10.migadu.com with ESMTPS id c3915ad15dbfa47b;
	Mon, 09 Nov 2026 01:57:39 +0000
X-Mizu-Trace-ID: c3915ad15dbfa47b
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: <20261107133416.212677-1-jinli@lanxincomputing.com>