summaryrefslogtreecommitdiffstats
path: root/tests/misc
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-16tests: Avoid accidental matching of the vendor field of $host, part 2Collin Funk-1/+1
* 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: 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-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-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: 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-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/+85
* 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: 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-09maint: move tty-eof.pl to misc directoryPádraig Brady-0/+164
* tests/tty/tty-eof.pl: Rename to ... * tests/misc/tty-eof.pl: ... this more general directory. * tests/local.mk: Adjust accordingly.
2026-04-05tests: cut: ensure no unecessary bufferingPádraig Brady-0/+3
* tests/misc/write-errors.sh: Ensure we write output when possible.
2026-03-30tests: coreutils: ensure empty arg is diagnosedoech3-0/+3
* tests/misc/coreutils.sh: Add a test case. https://github.com/coreutils/coreutils/pull/232
2026-03-24tests: yes: support more zero-copy related syscallsoech3-4/+13
* tests/misc/yes.sh: Disable other related zero-copy syscalls to ensure better testing of future or other implementations. https://github.com/coreutils/coreutils/pull/227
2026-03-21tac: promptly diagnose write errorsCollin Funk-0/+1
This patch also fixes a bug where 'tac' would print a vague error on some inputs: $ seq 10000 | ./src/tac-prev > /dev/full tac-prev: write error $ seq 10000 | ./src/tac > /dev/full tac: write error: No space left on device In this case ferror (stdout) is true, but errno has been set back to zero by a successful fclose (stdout) call. * src/tac.c (output): Call write_error() if fwrite fails. * tests/misc/io-errors.sh: Check that 'tac' prints a detailed write error. * NEWS: Mention the improvement.
2026-03-21tests: support checking for specific write errorsPádraig Brady-3/+8
* tests/misc/io-errors.sh: Support checkout for a specific error in commands that don't run indefinitely. Currently all the explicitly listed commands output a specific error and do not need to be tagged.
2026-03-10yes: use a zero-copy implementation via (vm)splicePádraig Brady-0/+20
A good reference for the concepts used here is: https://mazzo.li/posts/fast-pipes.html We don't consider huge pages or busy loops here, but use vmsplice(), and splice() to get significant speedups: i7-5600U-laptop $ taskset 1 yes | taskset 2 pv > /dev/null ... [4.98GiB/s] i7-5600U-laptop $ taskset 1 src/yes | taskset 2 pv > /dev/null ... [34.1GiB/s] IBM,9043-MRX $ taskset 1 yes | taskset 2 pv > /dev/null ... [11.6GiB/s] IBM,9043-MRX $ taskset 1 src/yes | taskset 2 pv > /dev/null ... [175GiB/s] Also throughput to file (on BTRFS) was seen to increase significantly. With a Fedora 43 laptop improving from 690MiB/s to 1.1GiB/s. * bootstrap.conf: Ensure sys/uio.h is present. This was an existing transitive dependency. * m4/jm-macros.m4: Define HAVE_SPLICE appropriately. We assume vmsplice() is available if splice() is as they were introduced at the same time to Linux and glibc. * src/yes.c (repeat_pattern): A new function to efficiently duplicate a pattern in a buffer with memcpy calls that double in size. This also makes the setup for the existing write() path more efficient. (pipe_splice_size): A new function to increase the kernel pipe buffer if possible, and use an appropriately sized buffer based on that (25%). (splice_write): A new function to call vmplice() when outputting to a pipe, and also splice() if outputting to a non-pipe. * tests/misc/yes.sh: Verify the non-pipe output case, (main): Adjust to always calling write on the minimal buffer first, then trying vmsplice(), then falling back to write from bigger buffer. and the vmsplice() fallback to write() case. * NEWS: Mention the improvement.
2026-03-03maint: tests: decouple debug output determinationPádraig Brady-14/+3
* tests/misc/warning-errors.sh: Simply check there is output to stderr before checking that output induces an error.
2026-03-03tests: avoid false test failure when using address sanitizerCollin Funk-0/+3
* tests/misc/warning-errors.sh: Skip commands which have been built with sanitizers, since standard error will not be closed and checked for errors. Reported by Bruno Haible.
2026-03-02tests: avoid failure on systems without an optimized 'cksum' or 'wc -l'Collin Funk-0/+10
* tests/misc/warning-errors.sh: Expect 'wc' and 'cksum' to exit successfully if there is not an optimized 'wc -l' implementation or CRC32 implementation. Reported by Bruno Haible.
2026-02-26id: promptly diagnose write errorsCollin Funk-0/+1
* NEWS: Mention the improvement. * src/id.c (print_stuff): Call fflush for each listed user to check for write errors. * tests/misc/io-errors.sh: Add an invocation of 'id'.
2026-02-26groups: promptly diagnose write errorsCollin Funk-0/+1
* NEWS: Mention the improvement. * src/groups.c (main): Call fflush for each listed user to check for write errors. * tests/misc/io-errors.sh: Add an invocation of 'groups'.
2026-02-26tests: ensure failure to write warnings is handled gracefullyPádraig Brady-0/+63
* tests/misc/warning-errors.sh: Add a new test to ensure failure to write warnings is diagnosed in the exit status. * tests/local.mk: Reference the new test.
2026-02-26maint: fix description of tests/misc/io-errors.shPádraig Brady-1/+1
* tests/misc/io-errors.sh: Promptness is checked in write-errors.sh, not this test.
2026-02-23tests: whoami, logname: verify error handlingoech3-0/+31
* tests/df/no-mtab-status-masked-proc.sh: Tweak unshare check. * tests/local.mk: Reference new test. * tests/misc/user.sh: Add new test using unshare -U, to verify that whoami and logname diagnose failure correctly. https://github.com/coreutils/coreutils/pull/195
2026-02-21tests: shuf: check that write errors are promptly diagnosedCollin Funk-0/+1
* tests/misc/write-errors.sh: Add a shuf invocation that would run forever if write errors weren't diagnosed.
2026-02-18maint: tests: avoid ENOSPC specific handlingPádraig Brady-2/+3
* tests/csplit/csplit-io-err.sh: Adjust determination of ENOSPC. * tests/csplit/split-io-err.sh: Likewise. * tests/fold/fold-zero-width.sh: Verify full ENOSPC message. * tests/tac/tac-continue.sh: Likewise. * tests/misc/io-errors.sh: Likewise. * tests/misc/write-errors.sh: Likewise.
2026-02-18tests: use system ENOSPC messagePádraig Brady-3/+3
* tests/head/head-write-error.sh: Verify ENOSPC is output. * tests/misc/yes.sh: Likewise.
2026-02-18tests: use system EACCES messagePádraig Brady-3/+3
* tests/chgrp/no-x.sh: Don't harcode "Permission denied". * tests/chmod/no-x.sh: Likewise. * tests/du/inacc-dest.sh: Likewise. * tests/du/no-x.sh: Likewise. * tests/misc/nohup.sh: Likewise. * tests/mv/part-fail.sh: Likewise. * tests/mv/perm-1.sh: Likewise. * tests/rm/fail-eacces.sh: Likewise. * tests/rm/rm1.sh: Likewise. * tests/rm/rm2.sh: Likewise. * tests/rm/unread2.sh: Likewise. * tests/rm/unreadable.pl: Likewise.
2026-02-18maint: tests: avoid AIX specific EACCES handlingPádraig Brady-2/+3
* tests/rm/inaccessible.sh: Remove AIX specific handling. * tests/cp/fail-perm.sh: Likeise. Also remove confusing EPERM/HPUX mentions. * tests/misc/sync.sh: Don't hardcode EISDIR and EACCES.
2026-02-12tests: coreutils: remove redundant validity checkoech3-3/+1
* tests/misc/coreutils.sh: Remove the check for non-empty coreutils.h, as the existing `print_ver_ coreutils` is sufficient to determine support for single binary mode. https://github.com/coreutils/coreutils/pull/189
2026-02-12tests: arch: add option parsing checkoech3-0/+2
* tests/misc/arch.sh: Ensure -- to indicate end of options is accepted. https://github.com/coreutils/coreutils/pull/191
2026-02-10tests: determine errno string more efficientlyPádraig Brady-8/+2
* tests/misc/read-errors.sh: Use getlimits_ determined EIO error string, rather than inferring the string from bash's output. See https://bugs.gnu.org/80353
2026-02-09maint: remove extraneous code from testPádraig Brady-3/+0
* tests/misc/usage_vs_refs.sh: Remove copy and paste slop. * tests/local.mk: Fix indentation.
2026-02-08nl: support multi-byte section delimitersCollin Funk-127/+0
* NEWS: Mention the improvement. * src/nl.c: Include mcel.h. (DEFAULT_SECTION_DELIMITERS): Resize to fit 2 multi-byte characters. (section_del_len): New variable. (check_section): Compare against section_del_len instead of 2. (main): Support multi-byte characters for the -d option. * tests/nl/multibyte.sh: New file. * tests/nl/nl.sh: New file, moved from tests/misc/nl.sh. * tests/local.mk (all_tests): Add the new test. Adjust the existing tests file name. * cfg.mk (exclude_file_name_regexp--sc_space_tab): Adjust Adjust the existing tests file name.
2026-02-08tests: fix false failure with dash or kshPádraig Brady-0/+1
* tests/misc/read-errors.sh: Avoid dash or ksh as they do _not_ print an error message upon EIO from read. Fixes https://bugs.gnu.org/80353
2026-02-06tests: nl: check that all files are processedCollin Funk-0/+14
* tests/misc/nl.sh: Add a test case.
2026-02-02tests: avoid false failure sync'ing busy systemsPádraig Brady-2/+6
* tests/misc/sync.sh: Increase the timeout to 60s, and restrict the case to when RUN_VERY_EXPENSIVE_TESTS=yes.
2026-01-23tests: usage_vs_refs.sh: fix false failure with AlpinePádraig Brady-1/+1
* tests/misc/usage_vs_refs.sh: Fix missing escape on literal {, required by busybox grep. Reported by Bruno Haible.
2026-01-22tests: fix false failure with pr -COLSPádraig Brady-1/+1
* tests/misc/usage_vs_getopt.sh: Fix false failure induced by commit v9.9-239-ga06f0cf67
2026-01-22doc: use TERM=dumb rather than HELP_NO_MARKUP to disable markupPádraig Brady-3/+3
This is a more standard mechanism to disable markup. * src/system.h (oputs_): Logic change to honor TERM=dumb, rather than HELP_NO_MARKUP=something. * doc/coreutils.texi: Adjust the description for --help. * man/local.mk: Ensure TERM is set to something, so that man pages have links included. * man/viewman: Just honor users $TERM. * tests/misc/getopt_vs_usage.sh: Remove env var complication, as TERM is unset automatically. * tests/misc/usage_vs_refs.sh: Likewise. * NEWS: Adjust the change in behavior note.
2026-01-21tests: avoid false failure with non standard pathPádraig Brady-2/+2
* tests/misc/usage_vs_refs.sh: Properly quote arguments to avoid false failure with paths containing spaces etc.
2026-01-21tests: avoid false failure on setgid dirPádraig Brady-3/+5
* tests/misc/mknod.sh: Skip a portion of the test in the edge case of setgid directories.
2026-01-21tests: ensure there is an anchor for each --help optionPádraig Brady-0/+71
* tests/misc/usage_vs_refs.sh: A new test to correlation options listed in --help, and anchors referenced in the texinfo (html) manual. * tests/local.mk: Add the new test.
2026-01-21doc: ls: support styling and links in --help outputPádraig Brady-2/+2
* src/ls.c (oputs): A new function that wraps puts(), but also highlights the --option-text portion, and adds links to the appropriate part of the online manual. (usage): Call oputs() rather than puts(). * doc/coreutils.texi (--help): Document new HELP_NO_MARKUP env var, which can be used in the edge case one wants to suppress ansi escapes. * tests/misc/getopt_vs_usage.sh: Use HELP_NO_MARKUP to ensure the test continues to pass.
2026-01-19tests: sync: check that all files are processed even when errors occurCollin Funk-0/+8
* tests/misc/sync.sh: Add the test case.
2026-01-19tests: sync: also test that -d and -f don't block on a FIFOCollin Funk-1/+4
* tests/misc/sync.sh: Check 'sync fifo' with no arguments, -d, and -f separately. Only perform the check for -f if RUN_EXPENSIVE_TESTS=yes since it may be expensive.
2026-01-18tests: strace: consider splice a "read" syscallPádraig Brady-3/+3
* tests/cksum/cksum-c.sh: Add 'splice' to the injection set. * tests/misc/read-errors.sh: Likewise. From https://github.com/coreutils/coreutils/pull/167
2026-01-18tests: use `command -v` to identify binaryPádraig Brady-1/+1
* tests/misc/coreutils.sh: Be more flexibile by using `command -v` to identify the binary to be executed, rather than linking directly to the built binary.
2026-01-17tests: avoid a test hang on AIXCollin Funk-0/+1
* init.cfg (uses_strace_): New function. (require_strace_): Use it. tests/cksum/cksum-c.sh: Likewise. tests/misc/read-errors.sh: Likewise.