[PATCH 1/3] erofs-utils: tests: fix broken loop in POSIX shells
Martin Pitt <[email protected]> Tue, 4 Aug 2026 05:32:12 +0200
| Newsgroups | org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <[email protected]> |
`{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 <[email protected]>
---
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