aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tail (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-11-08tests: tail: avoid a test failure on GNU/HurdHEADmasterCollin Funk1-1/+2
* tests/tail/tail-c.sh: Allow 'tail -c 4096 /dev/urandom' to run forever on GNU/Hurd since lseek fails with ESPIPE.
2025-11-08tests: avoid false failure due to small timeoutPádraig Brady1-1/+1
* tests/tail/tail-c.sh: Tests that fail after a timeout should use as least 10s to avoid intermittent failures on slow/loaded hosts.
2025-09-24tail: fix tailing larger number of lines in regular filesHannes Braun1-0/+28
* src/tail.c (file_lines): Seek to the previous block instead of the beginning (or a little before) of the block that was just scanned. Otherwise, the same block is read and scanned (at least partially) again. This bug was introduced by commit v9.7-219-g976f8abc1. * tests/tail/basic-seek.sh: Add a new test. * tests/local.mk: Reference the new test. * NEWS: mention the bug fix.
2025-09-21tests: tail: avoid false failure with overlayfsPádraig Brady1-0/+8
* tests/tail/inotify-dir-recreate.sh: Add an extra check that inotify is in use, as it's required for this test. Inotify is avoided with overlayfs for which the df --local check is not sufficient exclusion for.
2025-09-18tests: tail/overlay-headers.sh: protect against hangPádraig Brady1-2/+2
* tests/tail/overlay-headers.sh: Protect tail invocation with timeout, and extend the possible running period to 60 seconds like other tests. Reported by Brudno Haible on T2SDE Linux/alpha
2025-09-18tests: tests/tail/wait.sh: protect against hangPádraig Brady1-1/+1
* tests/tail/wait.sh: This test was seen to hang occasionally on an Alpine Linux 3.20 system, so protect the tail(1) call with `timeout 60` as done in similar tests. Reported by Bruno Haible.
2025-08-12maint: use short form bug URLsPádraig Brady2-2/+2
* cfg.mk (sc_prohibit-long-form-bug-urls): Disallow long form in code. * scripts/git-hooks/commit-msg: Disallow long form in commit messages. * NEWS: Shorten long urls. * bootstrap.conf: Likewise. * configure.ac: Likewise. * scripts/git-hooks/commit-msg: Likewise. * src/csplit.c: Likewise. * src/fmt.c: Likewise. * src/make-prime-list.c: Likewise. * src/nohup.c: Likewise. * tests/od/od-float.sh: Likewise. * tests/rm/r-root.sh: Likewise. * tests/tail/inotify-race.sh: Likewise. * tests/tail/inotify-race2.sh: Likewise.
2025-08-03tail: refactor to skip stat call on failurePaul Eggert1-1/+0
* src/tail.c (tail_bytes): New function. (tail_bytes, tail_lines, tail): Accept struct stat pointer from caller instead of calling fstat ourselves. All callers changed. (tail_file): Skip a call to fstat if fstat already failed. * tests/tail/follow-stdin.sh: Adjust to match new behavior on failure, which omits a redundant diagnostic.
2025-08-03tail: allow >=2**64 in traditional formPaul Eggert1-0/+1
This better matches the treatment of POSIX form, e.g., ‘tail +Nc’ is now like ‘tail -c +N’ even when N is large. * src/tail.c: Don’t include xstrtol.h. (parse_obsolete_option): Treat numbers greater than UINTMAX_MAX as if they are UINTMAX_MAX. Parse the number by hand with saturating arithmetic; nowadays that’s simpler than using xstrtoumax. There is no need for a diagnostic now, as the error cannot happen any more. * tests/tail/tail.pl (obs-plus-c3): New test.
2025-01-16tests: tail-c.sh: avoid failure on Linux kernels <= 2Pádraig Brady1-1/+9
tests/tail/tail-c.sh: Exclude older kernels from timeout failure.
2025-01-15tests: tail: avoid failure on Solaris 11Pádraig Brady1-1/+8
* tests/tail/tail-c.sh: On Solaris 11, tail -c 4096 /dev/urandom, will induce an lseek(,-4096,SEEK_END) which returns -4096 without setting errno, and a subsequent read() then gives EINVAL. Since tailing the end of a psuedo device is an edge case, we just verify that we don't spin reading the device forever.
2025-01-08tail: honor --pid with fifosPádraig Brady1-0/+36
* src/tail.c (tail_file): Open files with O_NONBLOCK if we might need async processing. (pipe_bytes): Ignore EAGAIN read() errors. (pipe_lines): Likewise. * tests/tail/pid-pipe.sh: Add a new test. * tests/local.mk: Reference the new test. * NEWS: Mention the bug fix. Reported by Berhard Voelker.
2025-01-01maint: update all copyright year number rangesPádraig Brady34-34/+34
Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * gnulib: Update included in this commit as copyright years are the only change from the previous gnulib commit. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2024-12-21tail: always fail when followed files become inaccessiblePádraig Brady2-9/+13
* src/tail.c (tail_forever): Without --retry, exit with failure status like we do for the inotify case (since v8.11-15-g61de57cd2). This is also consistent with the failure exit if no file was accessible at tail startup. * tests/tail/follow-stdin.sh: Tweak due to earlier exit. * tests/tail/follow-name.sh: Test with and without inotify. * NEWS: Mention the bug fix.
2024-12-05tail: ensure --follow=name unfollows renamed filesPádraig Brady2-8/+15
Require --retry to continue to track files upon rename. We already unfollowed a file if it was renamed to another file system (unlinked), so this makes the behavior consistent if renaming to a file in the same file system. I.e. --follow=name without --retry, means unfollow if the name is unlinked or moved, so this change ensures that behavior for all rename cases. Related commits: v8.0-121-g3b997a9bc, v8.23-161-gd313a0b24 * src/tail.c (tail_forever_notify): Remove watch for a renamed file if --retry is not specified. * tests/tail/F-vs-rename.sh: Related test cleanup. * tests/tail/follow-name.sh: Add a test case. * NEWS: Mention the bug fix. Fixes https://bugs.gnu.org/74653
2024-08-10tail: support counts > 2**64Paul Eggert1-6/+2
* src/tail.c (tail_lines): If skipping all input, use lseek if possible. (parse_options): Allow counts to exceed 2**64. (main): Don’t subtract 1 from UINTMAX_MAX, since it stands for infinity in this context. (main): Also don’t read anything when given infinite elisions. * tests/tail/tail.pl: Adjust to match new behavior. Rename err-5 test to big-c and expect the invocation to succeed, since ‘tail -c99999999999999999999’ now succeeds instead of (unnecessarily) failing.
2024-04-19tail: avoid infloop with -c on /dev/zeroPaul Eggert1-0/+10
Problem reported by Ionut Nicula in: https://bugs.gnu.org/70477 * src/tail.c (tail_bytes): Do not loop forever on commands like 'tail -c 4096 /dev/zero'. * tests/tail/tail-c.sh: Test this fix.
2024-01-01maint: update all copyright year number rangesPádraig Brady34-34/+34
Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * gnulib: Update included in this commit as copyright years are the only change from the previous gnulib commit. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Manually update copyright year, until we fully sync with gnulib at a later stage. * tests/sample-test: Adjust to use the single most recent year.
2023-12-01tail: fix tailing sysfs files where PAGE_SIZE > BUFSIZdann frazier1-0/+34
* src/tail.c (file_lines): Ensure we use a buffer size >= PAGE_SIZE when searching backwards to avoid seeking within a file, which on sysfs files is accepted but also returns no data. * tests/tail/tail-sysfs.sh: Add a new test. * tests/local.mk: Reference the new test. * NEWS: Mention the bug fix. Fixes https://bugs.gnu.org/67490
2023-09-20tail: allow multiple PIDsStephen Kitt1-0/+4
tail can watch multiple files, but currently only a single writer. It can be useful to watch files from multiple writers, or even processes not directly related to the files (e.g. watch log files written by a server process, for the duration of a test driven by a separate client). * src/tail.c (writers_are_dead): New function. (tail_forever): Use it to wait for writers. (tail_forever_inotify): As above. (parse_options): Manage --pid options in an array. * doc/coreutils.texi: Update documentation. * tests/tail/pid.sh: Add a variant with two PIDs. * News: Mention the new feature.
2023-06-19tests: move tests to a directory per utilitySylvestre Ledru33-0/+2303
* cfg.mk: Adjust syntax check exclusion paths. * tests/local.mk: Adjust for renamed tests.
2008-05-10tests: remove directory, tests/tail/Jim Meyering1-142/+0
* configure.ac (AC_CONFIG_FILES): Remove tests/tail/Makefile. * tests/Makefile.am (SUBDIRS): Remove tail. * tests/misc/tail: New file, with tests from... * tests/tail/Test.pm: ...here. Remove file.
2007-08-25Remove all .cvsignore files from version control.Jim Meyering1-7/+0
2007-07-23Update all copyright notices to use the newer form.Jim Meyering1-5/+3
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering1-1/+1
2007-05-13Remove the generated tests/*/Makefile.am files from version control.Jim Meyering1-78/+0
* tests/cut/Makefile.am: git-remove this generated file. * tests/head/Makefile.am: Likewise. * tests/join/Makefile.am: Likewise. * tests/pr/Makefile.am: Likewise. * tests/sort/Makefile.am: Likewise. * tests/tac/Makefile.am: Likewise. * tests/tail/Makefile.am: Likewise. * tests/test/Makefile.am: Likewise. * tests/tr/Makefile.am: Likewise. * tests/uniq/Makefile.am: Likewise. * tests/wc/Makefile.am: Likewise. * .cvsignore, .gitignore: Ignore these generated files. * src/.cvsignore, src/.gitignore: Add chcon here, ... * .cvsignore, .gitignore: ... not here.
2007-01-13Put CU_TEST_NAME in the environment for each test run by "make check".Jim Meyering1-0/+1
* Transform all Makefile.am files so that when running "make check", CU_TEST_NAME is set to the name of the test. This is so that when I run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" on the entire package it is more convenient to map a leak or error found in a valgrind log file back to the offending test. Use this command: (echo tests/Makefile.am.in; find tests -name Makefile.am) \ |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2006-08-22* aclocal.m4, config.hin, configure:Paul Eggert1-5/+4
Remove from CVS, since ./bootstrap generates them automatically. * .cvsignore: Add INSTALL, Makefile.in, *.cache, *.lineno, *.log. Remove more-specific entries. This catches files like configure.lineno. * man/.cvsignore: Add Makefile.in. * src/.cvsignore: Add Makefile.in. Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c. For .cvsignore file under the tests directory: Add Makefile.in. Sort entries if necessary. Remove *.I, *.E, *.X, *.O, *-tests, build-script, mk-script if they're never created in this directory. * build-aux/.cvsignore: New file. * doc/.cvsignore: Add Makefile.in, coreutils.html, coreutils.pdf, coreutils.ps, coreutils.tps. Remove coreutils.cm (dunno what it is, but the makefile doesn't mention it). Remove coreutils.info as it is subsumed by coreutils.info*. * lib/.cvsignore: Add Makefile.in, getdate.tab.h. Remove stat.c, sysexit.h. * m4/.cvsignore: Remove Makefile, dev-ino.m4, glibc2.m4, intdiv0.m4, inttypes-h.m4, inttypes-pri.m4, jm-glibc-io.m4, lcmessage.m4, lock.m4, printf-posix.m4, same-inode.m4, size_max.m4, uintmax_t.m4, ulonglong.m4, visibility.m4, xsize.m4. Many of these are put in automatically by ../bootstrap, but that's a bootstrap bug that I plan to fix shortly. * po/.cvsignore: More ../bootstrap-related fixes, plus remove old cruft. Add *.po, LINGUAS, Makevars. Remove *.cat, *.msg, cat-id-dbl.c, messages.mo, stamp-cat-id.
2006-08-21Remove from CVS, since the bootstrap script generates them automatically.Paul Eggert1-641/+0
2006-08-19.Jim Meyering1-1/+22
2006-08-19Some of my 2006-07-03 changes to tests/*/Makefile.am were beingJim Meyering1-2/+3
backed out due to updates provoked by the copyright changes. * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that it propagates to the derived Makefile.am files. ($(srcdir)/Makefile.am): Mark generated .am files as read-only, so we don't mistakenly edit them again. * tests/cut/Makefile.am: Regenerate. * tests/head/Makefile.am: Likewise. * tests/join/Makefile.am: Likewise. * tests/pr/Makefile.am: Likewise. * tests/sort/Makefile.am: Likewise. * tests/tac/Makefile.am: Likewise. * tests/tail/Makefile.am: Likewise. * tests/test/Makefile.am: Likewise. * tests/tr/Makefile.am: Likewise. * tests/uniq/Makefile.am: Likewise. * tests/wc/Makefile.am: Likewise.
2006-08-17Add/fix copyright notices and adjust to latest GNU FDL.Paul Eggert2-1/+39
2006-08-15.Jim Meyering1-39/+46
2006-08-09Regenerate.Paul Eggert1-13/+15
2006-08-09Regenerate.Paul Eggert1-34/+36
2006-07-17Regenerate.Paul Eggert1-36/+35
2006-07-09Regenerate.Paul Eggert1-44/+66
2006-07-03* tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):Jim Meyering1-1/+1
Add $VG_PATH_PREFIX as a prefix to $PATH
2006-07-03.Jim Meyering1-4/+4
2006-07-01(f-pipe-1): Renamed from f-1.Paul Eggert1-2/+5
(test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
2006-05-06.Jim Meyering1-2/+0
2006-03-26.Jim Meyering1-3/+4
2006-03-12.Jim Meyering1-6/+6
2006-02-20.Jim Meyering1-5/+7
2006-01-12.Jim Meyering1-5/+8
2006-01-04.Jim Meyering1-14/+14
2005-12-21.Jim Meyering1-1/+2
2005-12-17.Jim Meyering1-0/+1
2005-12-15.Jim Meyering1-3/+5
2005-12-03.Jim Meyering1-1/+0