summaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorLines
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.
2026-04-09tests: all: check empty tty input is handled appropriatelyPádraig Brady-40/+56
* tests/tty/tty-eof.pl: Test all commands twice. Once with input and once with empty input.
2026-04-09tests: tee: ensure intermittent data is handledoech3-0/+5
* tests/tee/tee.sh: Add test case for input from pipe containing sleep. https://github.com/coreutils/coreutils/pull/247
2026-04-07tests: date: fix false failure on OpenBSD 7.8Pádraig Brady-2/+4
* tests/date/date.pl: Set the max supported year to INT_MAX. Most systems support INT_MAX+1900, but mktime() on OpenBSD 7.8 limits the passed tm_year to INT_MAX. Reported by Bruno Haible.
2026-04-07tests: numfmt: avoid false failure on systems without long doublePádraig Brady-5/+5
* tests/numfmt/numfmt.pl: Move recently added test that depends on long double support to the appropriately guarded set. Also reduce the value to be in the definitely safe long double range. Reported by Bruno Haible.
2026-04-07tests: cat: avoid false failure on systems without splicePádraig Brady-1/+8
* tests/cat/splice.sh: Ensure splice is called multiple times before we check specific invocation counts. On Linux kernel 5.10 for example, splice from /dev/zero returns EINVAL.
2026-04-06cat: use splice if operating on pipes or if copy_file_range failsCollin Funk-0/+67
On a AMD Ryzen 7 3700X system: $ timeout 10 taskset 1 ./src/cat-prev /dev/zero \ | taskset 2 pv -r > /dev/null [1.67GiB/s] $ timeout 10 taskset 1 ./src/cat /dev/zero \ | taskset 2 pv -r > /dev/null [9.03GiB/s] On a Power10 system: $ taskset 1 ./src/yes | timeout 10 taskset 2 ./src/cat-prev \ | taskset 3 pv -r > /dev/null [12.9GiB/s] $ taskset 1 ./src/yes | timeout 10 taskset 2 ./src/cat \ | taskset 3 pv -r > /dev/null [81.8GiB/s] * NEWS: Mention the improvement. * src/cat.c: Include isapipe.h, splice.h, and unistd--.h. (splice_cat): New function. (main): Use it. * src/local.mk (noinst_HEADERS): Add src/splice.h. * src/splice.h: New file, based on definitions from src/yes.c. * src/yes.c: Include splice.h. (pipe_splice_size): Use increase_pipe_size from src/splice.h. (SPLICE_PIPE_SIZE): Remove definition, moved to src/splice.h. * tests/cat/splice.sh: New file, based on some tests in tests/misc/yes.sh. * tests/local.mk (all_tests): Add the new test.
2026-04-06tests: date: add large year testSylvestre Ledru-0/+17
* tests/date/date.pl: Add the test case. Add test case for https://github.com/uutils/coreutils/issues/9774 to verify with large dates. https://github.com/coreutils/coreutils/pull/237
2026-04-06tests: expr: add short-circuit tests with parenthesized branchesSylvestre Ledru-0/+6
* tests/expr/expr.pl: Add tests to verify that short-circuit evaluation of | and & correctly skips parenthesized dead branches, including nested parenthesized expressions containing division by zero. https://github.com/uutils/coreutils/pull/11395 https://github.com/coreutils/coreutils/pull/238
2026-04-06tests: split: verify non-UTF-8 bytes are preserved in filenamesSylvestre Ledru-0/+39
* tests/split/non-utf8.sh: New test to ensure that non-UTF-8 bytes in the prefix and --additional-suffix are preserved as-is in output filenames, rather than being replaced by UTF-8 replacement characters. * tests/local.mk: Register new test. https://github.com/uutils/coreutils/pull/11397 https://github.com/coreutils/coreutils/pull/239
2026-04-06tests: ln: add test for non-UTF-8 source names in target-dir modeSylvestre Ledru-0/+41
* tests/ln/non-utf8-src.sh: New test ensuring ln handles source filenames containing non-UTF-8 bytes when linking into a target directory, for both hard links and symbolic links with -t. * tests/local.mk: Register the new test. https://github.com/uutils/coreutils/pull/11403 https://github.com/coreutils/coreutils/pull/240
2026-04-06test: od: verify -t f defaults to double precisionSylvestre Ledru-0/+15
* tests/od/od-float.sh: Add cases to ensure -t f = -t fD, and also verify the resulting number. https://github.com/uutils/coreutils/pull/11396 https://github.com/coreutils/coreutils/pull/241
2026-04-06tests: ls: add quoting-utf8 test for Unicode quotes in UTF-8 localesSylvestre Ledru-0/+71
* tests/ls/quoting-utf8.sh: New test verifying that --quoting-style=locale and --quoting-style=clocale use Unicode left/right single quotation marks in UTF-8 locales, and that embedded apostrophes and double quotes are not escaped when the delimiters are different characters. Also check C locale fallback to ASCII quotes. * tests/local.mk: Reference the new test. https://github.com/coreutils/coreutils/pull/243
2026-04-06tests: numfmt: cover GNU/uutils compatibility edge casesSylvestre Ledru-0/+38
* tests/numfmt/numfmt.pl: Add tests exercising corner cases around negative-argument rejection, large integer precision, scientific notation rejection, '--from-unit' fractional precision, zero-padded format sign ordering, '--to-unit' prefix selection, and '--format=%.0f' with '--to=<scale>'. https://github.com/uutils/coreutils/pull/11668
2026-04-06tests: cut: add remaining tests to ensure 100% coveragePádraig Brady-0/+14
* tests/cut/cut.pl: Add new tests to ensure `make coverage` shows 100% coverage for cut.c.
2026-04-06tests: cut: expand GB18030 testsPádraig Brady-1/+48
* tests/cut/mb-non-utf8.sh: Add more test cases.
2026-04-06cut: -f: fix handling of multi-byte delimiters that span buffersPádraig Brady-0/+3
* src/cut.c (cut_fields_bytesearch): Ensure up to delim_bytes -1 is left for the next refill. * tests/cut/cut.pl: Add a test case.
2026-04-05cut: fix logic issue with field delim in last byte of bufferPádraig Brady-0/+5
With field delimiter = line delimiter we need to know if there is any more data to be read, as field delimiter in the last byte of the file is treated differently. So reiterate the loop to ensure enough read()s to make the appropriate determination.
2026-04-05tests: cut: add more multi-byte testsPádraig Brady-0/+73
* tests/cut/cut.pl: Add more multi-byte combinations.
2026-04-05cut: optimize UTF-8 input with 0xF5-0xFF delimitersPádraig Brady-0/+3
* src/cut.c (bytesearch_field_delim_ok): Expand the range of bytes that can be simply searched for. 0xF5-0xFF can't appear in valid UTF-8 characters, and so may be used as delimiters in UTF-8 input, so it's worth optimizing for. * tests/cut/cut.pl: Add a test case (mainly as documentation).
2026-04-05cut: optimize when no delimiter in inputPádraig Brady-0/+1
This is about 20x faster. Note we only do the delimiter search once per chunk, and it's usually quick as delimiters wouldn't be too far into the a chunk if present, so we don't bother to cache the found delimiter.
2026-04-05tests: cut: ensure multi-byte delimiter is rejected in uni-byte localesPádraig Brady-0/+19
tests/cut/cut.pl: Check the appropriate diagnostic is presented.
2026-04-05cut: merge cut_fields and cut_fields_bytesearchPádraig Brady-0/+2
TODO: See why this is much slower: time LC_ALL=C.UTF-8 src/cut -f1 -dc as.in > /dev/null
2026-04-05cut: faster utf8 processingPádraig Brady-0/+6
TODO: improve to use bounded memory where possible
2026-04-05cut: support -F as an alias for -f -w -O ' 'Pádraig Brady-0/+3
To improve compatibility with toybox/busybox scripts.
2026-04-05cut: support --whitespace-delimited=trimmedPádraig Brady-0/+6
Support ignoring leading and trailing whitespace. E.g. this matches awk's default field splitting mode. * src/cut.c * tests/cut/cut.pl: Add test cases.