From: oech3 <79379754+oech3@users.noreply.github.com> Date: Sun, 1 Feb 2026 13:46:42 +0000 (+0900) Subject: tests: sort: ensure --batch-size=(rlimit+1) fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f638c29df65270401e7edf8e1f7a66e8b482a2a8;p=thirdparty%2Fcoreutils.git tests: sort: ensure --batch-size=(rlimit+1) fails * tests/sort/sort-merge-fdlimit.sh: Add test case. https://github.com/coreutils/coreutils/pull/182 --- diff --git a/tests/sort/sort-merge-fdlimit.sh b/tests/sort/sort-merge-fdlimit.sh index bb9c2c0816..54e790d066 100755 --- a/tests/sort/sort-merge-fdlimit.sh +++ b/tests/sort/sort-merge-fdlimit.sh @@ -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