]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: ls: use a larger file descriptor limit
authorCollin Funk <collin.funk1@gmail.com>
Sat, 13 Dec 2025 05:51:30 +0000 (21:51 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 14 Dec 2025 02:37:18 +0000 (18:37 -0800)
OpenBSD and Alpine Linux /bin/sh cannot handle a file descriptor limit
of 7.

* tests/ls/recursive.sh: Create 30 directories and use a file descriptor
limit of 20. Don't check the output since we have coverage for that
elsewhere.
Reported by Bruno Haible.

tests/ls/recursive.sh

index 6935bdb53fd77a81d32eac519aeffeb396c16747..c7fe82e3a7415a8c1fb18d646712e7ee59e45cc2 100755 (executable)
@@ -61,39 +61,9 @@ compare exp out || fail=1
 
 # Check that we don't run out of file descriptors when visiting
 # directories recursively.
-mkdir -p 1/2/3/4/5/6/7/8/9/10 || framework_failure_
-(ulimit -n 7 && ls -R 1 > out) || fail=1
-cat <<EOF > exp
-1:
-2
-
-1/2:
-3
-
-1/2/3:
-4
-
-1/2/3/4:
-5
-
-1/2/3/4/5:
-6
-
-1/2/3/4/5/6:
-7
-
-1/2/3/4/5/6/7:
-8
-
-1/2/3/4/5/6/7/8:
-9
-
-1/2/3/4/5/6/7/8/9:
-10
-
-1/2/3/4/5/6/7/8/9/10:
-EOF
-
-compare exp out || fail=1
+mkdir -p $(seq 30 | tr '\n' '/') || framework_failure_
+(ulimit -n 20 && ls -R 1 > out 2> err) || fail=1
+test $(wc -l < out) = 88 || fail=1
+test $(wc -l < err) = 0 || fail=1
 
 Exit $fail