tests: avoid false failure on older Linux kernels

* tests/fold/fold-zero-width.sh: Check the shell was able to create
the redirection file, as intermittently on CentOS 5,6,7 this wasn't
the case, with the shell giving an xmalloc failure due to the ulimit.
Reported by William Bader and Bruno Haible.
This commit is contained in:
Pádraig Brady 2025-09-21 16:37:26 +01:00
parent 076e247416
commit 8a1f434463

View File

@ -56,7 +56,9 @@ vm=$(get_min_ulimit_v_ fold /dev/null) && {
for c in '\n' '\0' '\303'; do
tr '\0' "$c" < /dev/zero | timeout 10 $SHELL -c \
"(ulimit -v $(($vm+12000)) && fold 2>err >/dev/full)"
{ test $? = 124 || ! grep 'space' err >/dev/null; } &&
ret=$?
test -f err || skip_ 'shell ulimit failure'
{ test $ret = 124 || ! grep 'space' err >/dev/null; } &&
{ fail=1; cat err; echo "fold didn't diagnose ENOSPC" >&2; }
done
}