]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
sort: port sort-continue test back to Solaris 10
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 28 Aug 2023 02:13:42 +0000 (19:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 28 Aug 2023 02:15:31 +0000 (19:15 -0700)
* tests/sort/sort-continue.sh: Use ulimit -n 7 not -n 6.  On
Solaris 10 'sort' uses Gnulib mkostemp, which calls Gnulib
getrandom, which opens /dev/urandom to calculate the temp file's
name, which means 'sort' needs one more file descriptor to work.

tests/sort/sort-continue.sh

index c2733639542c0c43ef90f5ffc9e727edd8dfc81c..5326bfece5e7049611813cffbc68879aea153e48 100755 (executable)
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ sort
 
+# This script uses 'ulimit -n 7' 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.
+
 # Skip the test when running under valgrind.
-( ulimit -n 6; sort 3<&- 4<&- 5<&- < /dev/null ) \
+( ulimit -n 7; sort 3<&- 4<&- 5<&- 6<&- < /dev/null ) \
   || skip_ 'fd-limited sort failed; are you running under valgrind?'
 
 for i in $(seq 31); do
@@ -31,16 +37,16 @@ done
 test_files=$(echo __test.*)
 
 (
- ulimit -n 6
- sort -n -m $test_files 3<&- 4<&- 5<&- < /dev/null > out
+ ulimit -n 7
+ sort -n -m $test_files 3<&- 4<&- 5<&- 6<&- < /dev/null > out
 ) &&
 compare in out ||
   { fail=1; echo 'file descriptor exhaustion not handled' 1>&2; }
 
 echo 32 | tee -a in > in1
 (
- ulimit -n 6
- sort -n -m $test_files - 3<&- 4<&- 5<&- < in1 > out
+ ulimit -n 7
+ sort -n -m $test_files - 3<&- 4<&- 5<&- 6<&- < in1 > out
 ) &&
 compare in out || { fail=1; echo 'stdin not handled properly' 1>&2; }