summaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorLines
2026-05-16tests: tail: ensure --pid is responsive to intermittent inputHEADmasterPádraig Brady-2/+41
* tests/tail/pid-pipe.sh: Ensure not only open() is handled asynchronously with --pid.
2026-05-15tests: date: test format options combined with format stringsCollin Funk-0/+14
* tests/date/date.pl (@Tests): Add a few test cases.
2026-05-14tests: mktemp: test the creation of hidden files in a subdirectoryCollin Funk-0/+19
* tests/mktemp/mktemp.pl (@Tests): Add two test cases.
2026-05-14test: mktemp: test creation of a directory with a subdirectory templateCollin Funk-3/+12
* tests/mktemp/mktemp.pl (@Tests): Remove an unlink call handled in the previous call to check_tmp. Add a test case.
2026-05-14tests: shred: check shred explicit deallocationPádraig Brady-1/+10
* tests/shred/shred-remove.sh: Ensure shred deallocates with read-only directories, or '-' used to represent standard output.
2026-05-11tests: date: test the behavior with multiple --iso-8601 optionsCollin Funk-0/+8
* tests/date/date.pl (@Tests): Add test cases.
2026-05-10shred: don't block when opening FIFOs with no readersCollin Funk-0/+44
* NEWS: Mention the bug fix. * src/shred.c (wipefile): Open the file with O_NONBLOCK. * tests/shred/fifo.sh: New file. * tests/local.mk (all_tests): Add the new test.
2026-05-07shuf: prefer fwrite over fputs and fputcCollin Funk-0/+12
On an AMD Ryzen 7 3700X running GNU/Linux: $ timeout 30 taskset 1 ./src/shuf-prev \ -r -i 1000000-1000000 | pv -r > /dev/null [ 302MiB/s] $ timeout 30 taskset 1 ./src/shuf \ -r -i 1000000-1000000 | pv -r > /dev/null [ 434MiB/s] * src/shuf.c (print_number): New function. (write_permuted_numbers, write_random_numbers): Use it. * tests/shuf/shuf.sh: Add a test case to run 'shuf -i' with varying numbers of digits to check that the string conversion is correct.
2026-05-05tests: head: test 'head -n 0' and 'head -c 0' open files for readingCollin Funk-0/+82
* tests/head/head-n0.sh: New file. * tests/local.mk: Add the new test case.
2026-05-05tests: ls: verify correct alignment with ACLsSylvestre Ledru-0/+15
* tests/ls/acl.sh: Check that the gap between the '+' indicator and the link count is the same whether the listing contains one or several ACL entries. https://github.com/coreutils/coreutils/pull/251
2026-05-04ls: exclude newline from consideration in line widthPádraig Brady-2/+28
* src/ls.c (calculate_columns): Treat width as inclusive max. (print_with_separator): Likewise. Also handle commas explicitly, since they're not catered for by an implicit newline in the count. * tests/ls/w-option.sh: Adjust exact-fit column tests. Note this change also makes the existing `ls -w4 -x -T0 a b` test behave consistently with other output width limits. Also add the test case from: https://github.com/coreutils/coreutils/pull/213 * tests/ls/m-option.sh: Add a test case to ensure appropriate wrapping when trailing comma at the line limit. * NEWS: Mention the change in behavior.
2026-05-04ls: fix too few display columns edge casePádraig Brady-0/+17
In the edge case where the right most column would consist of only files taking 1 or 2 cells, we accounted for 3 cells, which would result in using 1 column too few. This should have been part of commit v8.24-59-ge71be1292 * src/ls.c (init_column_info): Don't account for separator in the the final column. * tests/ls/w-option.sh: Add a test case.
2026-05-04tests: fix false failure with spaces in hierarchyPádraig Brady-3/+5
* tests/sort/sort-buffer-size.sh: Use `pwd` rather than $PWD, and quote appropriately. Reported by Bruno Haible.
2026-05-03tests: tee: ensure tee is non bufferedPádraig Brady-0/+6
* tests/tee/tee.sh: tests/misc/responsive.sh only confirms responsiveness to lines, so add a test for non line terminated. https://github.com/coreutils/coreutils/pull/259
2026-05-02tests: all: ensure closed stdin is handled appropriatelyCollin Funk-0/+87
* tests/misc/close-stdin.sh: New file. * tests/local.mk (all_tests): Add the new test.
2026-04-30sum,cksum: consistently emit detailed write errorsCollin Funk-0/+10
Previously the string from strerror would only be printed for some algorithms: $ cksum -a sha2 -l 256 /dev/null > /dev/full cksum: write error: No space left on device $ cksum -a sysv /dev/null > /dev/full cksum: write error This patch fixes it so that the error information is always printed: $ ./src/cksum -a sha2 -l 256 /dev/null > /dev/full cksum: write error: No space left on device $ ./src/cksum -a sysv /dev/null > /dev/full cksum: write error: No space left on device * src/cksum.c (output_file): Don't check for a write error here. (main): Check for it here instead. * tests/misc/io-errors.sh: Add a 'cksum' invocation for each supported algorithm. https://github.com/coreutils/coreutils/issues/258
2026-04-29unexpand: fix heap overflowPádraig Brady-0/+8
* src/unexpand.c (unexpand): Use xinmalloc() to gracefully handle overflow. Also use the runtime locale specific MB_CUR_MAX rather than the worst case MB_LEN_MAX. * tests/unexpand/mb.sh: Add a test case that fails in a default glibc build with either MB_CUR_MAX or MB_LEN_MAX. * NEWS: Mention the bug fix. Reported by Michał Majchrowicz.
2026-04-29unexpand: consolidate error messagesPádraig Brady-1/+1
* src/unexpand.c (main): Use the same error as in parse_tab_stops().
2026-04-29sort: use more dynamic memory allocation with pipesPádraig Brady-0/+51
The default memory allocation with pipes was too passive/static, resulting in not allocating enough memory to enable threading. By dynamically reallocating the buffer when reading from unknown sized inputs we better use available memory and threads. $ time seq 10000000 -1 0 | sort-old >/dev/null real 0m16.523s user 0m16.900s sys 0m0.167s $ time seq 10000000 -1 0 | sort-old -S1G >/dev/null real 0m12.263s user 0m29.646s sys 0m0.527s $ time seq 10000000 -1 0 | sort-new >/dev/null real 0m12.994s user 0m31.266s sys 0m0.716s It also avoids the overhead of writing to temp files for modestly sized inputs. For example the following input would induce interaction with temp storage: $ seq 125000 | wc -c 763895 * src/sort.c (sort_buffer_size): Rename to ... (sort_buffer_policy): ... here, and adjust to set an initial size and limit, rather than just a size. (fillbuf): Add a POLICY parameter, and use that to call maybe_growbuf() as needed. (maybe_growbuf): Return true if POLICY dictates we should grow the buffer, and try_growbuf() was able to reallocate the larger buffer. * tests/sort/sort-buffer-size.sh: Add a new test. * tests/local.mk: Reference new test. * NEWS: Mention the improvement. Related to https://bugs.gnu.org/10877
2026-04-28uniq: fix read overrun with -wPaul Eggert-0/+3
Problem reported by Michał Majchrowicz. * src/uniq.c (find_field): Fix typo. * tests/uniq/uniq.pl (add_z_variants): Test for the bug.
2026-04-27tests: avoid false failure with perl-IO-Tty >= 1.24Pádraig Brady-1/+2
* tests/misc/tty-eof.pl: https://bugzilla.redhat.com/2463168
2026-04-25tests: all: ensure closed stdout is handled appropriatelyPádraig Brady-7/+23
* tests/misc/io-errors.sh: Add a check to ensure we diagose writing to closed stdout. Also ensure we exit with failure in other cases. * tests/misc/write-errors.sh: Likewise.
2026-04-24tests: tail: avoid a rare false failurePádraig Brady-5/+13
I noticed a single failure on cfarm29 (Linux 6.12 ppc64le), where the output was missing: -tail: directory containing watched file was removed -tail: inotify cannot be used, reverting to polling -tail: 'dir/file' has appeared; following new file * tests/tail/inotify-dir-recreate.sh: Leverage the new tail --debug output to sync to a point where we know the inotify watches are in place. Also normalize the file argument quoting a bit.
2026-04-23dd: avoid recursive parsing of multipliersPádraig Brady-1/+8
* src/dd.c (parse_integer): Use iterative rather than recursive parsing, to avoid potential stack overflow. * tests/dd/bytes.sh: Add a test case. https://github.com/coreutils/coreutils/issues/254
2026-04-22comm: don't close standard input twiceCollin Funk-1/+33
* NEWS: Mention the bug fix. * src/comm.c (usage): Remove mention that FILE1 and FILE2 cannot both be standard input. (compare_files): Only close standard input once. * doc/coreutils.texi (comm invocation): Document the behavior of 'comm - -' which is not portable to all implementations. * tests/comm/dash-dash.sh: New file. * tests/misc/comm.pl: Move to tests/comm/comm.pl. * tests/local.mk (all_tests): Add the new test. Rename the existing test.
2026-04-17tests: reinstate logname error verificationBruno Haible-3/+4
* tests/misc/user.sh: Modify the "unshare -U logname" test, so that it does not fail on glibc versions (< 2.28, >= 2.38) that do a fallback lookup based on the tty.
2026-04-17tests: fix false failure with dashPádraig Brady-1/+1
* tests/date/date-locale-hour.sh: Just strip the char before the last x, assuming it's going to be the newline output by `locale`. dash doesn't support $'' within ${}.
2026-04-16tests: Avoid accidental matching of the vendor field of $host, part 2Collin Funk-3/+2
* tests/local.mk (TESTS_ENVIRONMENT): Remove host_triplet. * tests/chgrp/basic.sh: Use $host_os instead of $host_triplet. * tests/misc/io-errors.sh: Likewise.
2026-04-16tests: mktemp: test the behavior when writing to standard output failsCollin Funk-0/+37
* tests/mktemp/write-error.sh: New file. * tests/local.mk (all_tests): Add the test.
2026-04-16tests: avoid a failure on muslCollin Funk-0/+9
* tests/misc/io-errors.sh: Allow a generic error string on musl since the first line is emitted immediately instead of being buffered as expected. Reported by Bruno Haible.
2026-04-16test: avoid false failure on OpenBSDPádraig Brady-1/+2
* tests/numfmt/numfmt.pl: Use standard getopt error map, needed on OpenBSD. Reported by Bruno Haible.
2026-04-16tests: avoid false failure with hidden /proc on GuixPádraig Brady-1/+4
* tests/stat/stat-mount.sh: Don't try our stat under unshare unless mount(8) exits gracefully. Reported by Bruno Haible.
2026-04-16tests: avoid failure on Manjaro LinuxPádraig Brady-2/+3
* tests/misc/user.sh: Comment out part of test. Reported by Bruno Haible.
2026-04-16tests: fix false failure due to ulimit usagePádraig Brady-3/+4
* tests/dd/no-allocate.sh: Run getlimits_ to ensure we have $SSIZE_MAX etc. available. Also give some buffer for the configured ulimit to leave space for returns_ to work.
2026-04-16tests: avoid failure on older Centos 7Pádraig Brady-1/+5
* tests/cp/sparse-perf.sh: Old Centos 7 can give EINVAL from SEEK_DATA on sparse files being copied from /dev/shm. Avoid this failure as it's not practical to fix.
2026-04-16tests: fix false failure on Centos 7Pádraig Brady-1/+2
* tests/date/date-locale-hour.sh: Ensure `locale date_fmt` is propagated exactly, even when it contains trailing new lines, as was seen with Serbian locales on Centos 7.
2026-04-15tests: avoid intermittent false failures with kshPádraig Brady-0/+6
As noted in https://bugs.gnu.org/9089 ksh gives intermittent ECONNRESET errors with closed pipes. This can be seen reliably on Linux with: ksh -c 'yes | (sleep .1; head -n10 >/dev/null)' * tests/misc/io-errors.sh: Avoid part of test on ksh. * tests/misc/write-errors.sh: Likewise.
2026-04-15tests: use more accurate ulimit with $SHELL -cPádraig Brady-1/+1
* tests/misc/write-errors.sh: Use a more accurate ulimit determination when we're using $SHELL -c.
2026-04-15tests: avoid $SHELL -c "ulimit ..." patternPádraig Brady-26/+16
As described in commit v9.10-283-g5cb0cca3b avoid using ulimit with $SHELL -c, and explict invocation of the shell like that can require lots of memory, often due to loading the locale archive. * tests/basenc/bounded-memory.sh: Avoid $SHELL -c with ulimit. * tests/cut/bounded-memory.sh: Likewise. * tests/expand/bounded-memory.sh Likewise. * tests/pr/bounded-memory.sh Likewise. * tests/unexpand/bounded-memory.sh Likewise. * tests/fold/fold-zero-width.sh: Bring the ulimit bound down to the standard 6M over the determined limit.
2026-04-15tests: fix false failure due to racePádraig Brady-23/+37
* tests/misc/tty-eof.pl: Fix a race that commit v9.10-269-gf312af49a made more apparent, and resulted in intermittent failure like: "... (with input) didn't produce expected output". Now Instead of waiting for overlapping echo and output, just wait for EOF, and if received, use exp->before() to inspect the accumulated output.
2026-04-15df: improve detection of duplicate entriesLukáš Zaoral-2/+4
Do not compare only with the latest entry for given device id but also all previously saved entries with the same id. * src/df.c (struct devlist): Add next_same_dev struct member. (filter_mount_list): Iterate over next_same_dev to find duplicates. * tests/df/skip-duplicates.sh: Add test cases. * NEWS: Mention the improvement. https://redhat.atlassian.net/browse/RHEL-5649
2026-04-12tests: fix false failure under some shellsPádraig Brady-4/+3
Verified with: make -j4 PREFERABLY_POSIX_SHELL=/bin/ksh SUBDIRS=. check * tests/fold/fold-zero-width.sh: Don't timeout $SHELL -c ... as the ulimit induces a failure in the subshell depending on the order of the allocations it does. The main issue is disparity between the probed ulimit and that needed by $SHELL -c. Such subshells load the often very large locale archive, thus if there are any allocations done after the now too low ulimit is set, then the $SHELL command fails. Note we timeout fold rather than the whole pipeline so any 124 exit status is propagated.
2026-04-11tests: validate error handling when reading multiple filesPádraig Brady-41/+53
* tests/misc/read-errors.sh: Validate that commands which read multiple files, read all files on error, and exit with appropriate status.
2026-04-10tests: validate command responsivenessPádraig Brady-0/+86
* tests/misc/responsive.sh: Test commands that should output immediately upon receiving input, and that there is no unecessary buffering. * cfg.mk: Avoid false failure in sc_prohibit_test_backticks. * tests/local.mk: Reference the new test.
2026-04-10tests: stat: ensure independence from /proc/Pádraig Brady-1/+9
* tests/stat/stat-mount.sh: Ensure stat -c '%a' is independent from /proc. https://github.com/coreutils/coreutils/pull/250
2026-04-10tests: cut: ensure separate read paths checkedPádraig Brady-1/+1
* tests/misc/read-errors.sh: Use cut -b as that has a separate read path to cut -c.
2026-04-10tests: Avoid accidental matching of the vendor field of $hostBruno Haible-15/+15
* tests/chgrp/basic.sh: Test $host_os, not $host_triplet. * tests/chown/separator.sh: Likewise. * tests/rm/r-root.sh: Likewise. * tests/tail/pipe-f.sh: Likewise. * tests/tail/tail-c.sh: Likewise. * tests/tee/tee.sh: Likewise. * tests/touch/dangling-symlink.sh: Likewise.
2026-04-09maint: move tty-eof.pl to misc directoryPádraig Brady-1/+1
* tests/tty/tty-eof.pl: Rename to ... * tests/misc/tty-eof.pl: ... this more general directory. * tests/local.mk: Adjust accordingly.
2026-04-09tests: tty-eof.pl: address FIXME re hardcoded Ctrl-dPádraig Brady-4/+34
* tests/tty/tty-eof.pl: Try to explicitly set EOF char to Ctrl-d in case it's different.
2026-04-09tests: tty-eof.pl: make fully table drivenPádraig Brady-8/+8
* tests/tty/tty-eof.pl: Remove command specific logic, and adjust commands to support general input. Also add cut -b, as cut_bytes has its own read loop.