]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: dd: avoid a false failure when ulimit fails
authorCollin Funk <collin.funk1@gmail.com>
Tue, 19 May 2026 00:25:43 +0000 (17:25 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Tue, 19 May 2026 00:32:58 +0000 (17:32 -0700)
This test failure was seen on NetBSD 10.0 machine, where ulimit failed
with EINVAL.

* tests/dd/bytes.sh: Don't fail the test case if ulimit fails.
Reported by Bruno Haible.

tests/dd/bytes.sh

index fa7295ac8ae6c5e27a3d294610e330efd6a3cf6b..013cc0006c989cc07d836d46ef0fd3dc13d86b74 100755 (executable)
@@ -71,8 +71,9 @@ done
 # Check that long multiplier chains don't exhaust a restricted stack.
 if (ulimit -S -s 256 && dd if=/dev/null count=1) 2>/dev/null; then
   long_multiplier=$(yes 1x | head -n 10000 | tr -d '\n')1 || framework_failure_
-  (ulimit -S -s 256 &&
-    dd count="$long_multiplier" if=/dev/null of=/dev/null status=none) || fail=1
+  (ulimit -S -s 256 && touch ulimit-worked &&
+    dd count="$long_multiplier" if=/dev/null of=/dev/null status=none) \
+      || { test -f ulimit-worked && fail=1; }
 fi
 
 # Negative checks for integer parsing