aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-08-27 20:49:33 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-08-27 20:50:04 -0700
commit9348edb6b650db58a501e4e26e5dbf8e8b13e84d (patch)
tree2ad078fc9c43de147cc63bcb0a046961affe18a0 /tests
parentsort: port sort-continue test back to Solaris 10 (diff)
downloadcoreutils-9348edb6b650db58a501e4e26e5dbf8e8b13e84d.tar.gz
coreutils-9348edb6b650db58a501e4e26e5dbf8e8b13e84d.zip
sort: port sort-merge-fdlimit test to Solaris 10
* tests/sort/sort-merge-fdlimit.sh: Give 'sort' fd 6 too. Needed for the same reason sort-continue.sh needed a ulimit -n boost.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/sort/sort-merge-fdlimit.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/sort/sort-merge-fdlimit.sh b/tests/sort/sort-merge-fdlimit.sh
index db2d8ebf0..7dda7f8f5 100755
--- a/tests/sort/sort-merge-fdlimit.sh
+++ b/tests/sort/sort-merge-fdlimit.sh
@@ -61,9 +61,16 @@ done
# This test finds the bug only with shells that do not close FDs on
# exec, and will miss the bug (if present) on other shells, but it's
# not easy to fix this without running afoul of the OpenBSD-like sh bugs.
+#
+# This script uses 'ulimit -n 10' with 7, 8 and 9 open
+# to limit 'sort' to at most 7 open files:
+# stdin, stdout, stderr, two input and one output files when merging,
+# and an extra. The extra is for old-fashioned platforms like Solaris 10
+# where opening a temp file also requires opening /dev/urandom to
+# calculate the temp file's name.
(seq 6 && echo 6) >exp || framework_failure_
echo 6 >out || framework_failure_
-(exec 3<&- 4<&- 5<&- 6</dev/null 7<&6 8<&6 9<&6 &&
+(exec 3<&- 4<&- 5<&- 6<&- 7</dev/null 8<&7 9<&7 &&
ulimit -n 10 &&
sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out
) &&