1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-14 14:09:35 +02:00

tests: sort: ensure --batch-size=(rlimit+1) fails

* tests/sort/sort-merge-fdlimit.sh: Add test case.
https://github.com/coreutils/coreutils/pull/182
This commit is contained in:
oech3
2026-02-01 22:46:42 +09:00
committed by Pádraig Brady
parent 7f592adc44
commit f638c29df6
+5 -2
View File
@@ -34,12 +34,15 @@ seq 17 >some-data
# inside the ATF, then the same test with batch size b+1 may pass outside
# the ATF but fail inside it.
(ulimit -n 19 && touch ulimit-worked &&
returns_ 2 sort --batch-size=20 /dev/null) || fail=1
rm ulimit-worked || skip_ 'cannot modify open file descriptor limit'
# The default batch size (nmerge) is 16.
(ulimit -n 19 && touch ulimit-worked \
&& sort -m --batch-size=16 in/* 2>err/merge-default-err \
|| ! grep "open failed" err/merge-default-err) || fail=1
test -f ulimit-worked || skip_ 'cannot modify open file descriptor limit'
rm ulimit-worked || skip_ 'cannot modify open file descriptor limit'
# If sort opens a file to sort by random hashes of keys,
# it needs to consider this file against its limit on open file