]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false failure on older Linux kernels
authorPádraig Brady <P@draigBrady.com>
Sun, 21 Sep 2025 15:37:26 +0000 (16:37 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 21 Sep 2025 15:37:26 +0000 (16:37 +0100)
* 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.

tests/fold/fold-zero-width.sh

index 04cbe4afd6caad4e9965fa1ab645256e52be3a13..d90fd0c9cf1d5c2008ba75fa235a67baa6510c1e 100755 (executable)
@@ -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
 }