All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Pitt <martin@amutable.com>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <xiang@kernel.org>, Yifan Zhao <zhaoyifan28@huawei.com>,
	Martin Pitt <martin@amutable.com>
Subject: [PATCH 1/3] erofs-utils: tests: fix broken loop in POSIX shells
Date: Tue,  4 Aug 2026 05:32:12 +0200	[thread overview]
Message-ID: <20260804033214.211267-2-martin@amutable.com> (raw)
In-Reply-To: <20260804033214.211267-1-martin@amutable.com>

`{1..n}` is a bashism. A POSIX shell iterates once over that literal
string, so the test silently sets a single attribute instead of three and
nothing crosses the block boundary any more. Sadly, `seq` is also not
POSIX (although ubiquitous).

Spell out the loop.

Signed-off-by: Martin Pitt <martin@amutable.com>
---
 tests/erofs/021 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/erofs/021 b/tests/erofs/021
index d36aa56..b77a8d7 100755
--- a/tests/erofs/021
+++ b/tests/erofs/021
@@ -39,7 +39,7 @@ mkdir -p $localdir
 # cross the block boundary; besides set three xattrs to ensure at least
 # one xattr name crosses the block boundary
 touch $localdir/file1
-for i in {1..3}; do
+for i in 1 2 3; do
 	setfattr -n user.p$(_random 249) -v $(_random 512) $localdir/file1 \
 		|| _notrun "no space for xattrs"
 done
-- 
2.55.0



  reply	other threads:[~2026-08-04  3:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  3:32 [PATCH 0/3] erofs-utils: tests: cover the canonical xattr order Martin Pitt
2026-08-04  3:32 ` Martin Pitt [this message]
2026-08-04  3:32 ` [PATCH 2/3] erofs-utils: tests: look up programs with command -v Martin Pitt
2026-08-04  3:32 ` [PATCH 3/3] erofs-utils: tests: check that the xattr layout is order-independent Martin Pitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260804033214.211267-2-martin@amutable.com \
    --to=martin@amutable.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=xiang@kernel.org \
    --cc=zhaoyifan28@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.