summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2009-08-06dd: work around buffer length restrictions with oflag=direct (O_DIRECT)Jim Meyering
dd oflag=direct would fail to copy a file with size that is not a multiple of 512 (destination file system specific) * NEWS (Bug fixes): Mention it. * src/dd.c (iwrite): Turn off O_DIRECT for any smaller-than-obs-sized write. Don't bother to restore it. * tests/dd/direct: New test for the above. * tests/Makefile.am (TESTS): Add dd/direct. * doc/coreutils.texi (dd invocation): Mention oflag=direct buffer size restriction. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17586 Reported by Eric Sandeen.
2009-08-04cp -pP (and e.g., -a): preserve time stamps on symlinks, tooJim Meyering
* src/copy.c (utimensat_if_possible): New function. (copy_internal): Remove variable, "preserve_metadata". Replace with "dest_is_symlink". That covers all cases but one: the one in which cp --link has created hard links to non-directories. In that case, there is no need to update attributes of the links. Use utimensat_if_possible, to preserve timestamps of symlinks. * NEWS (New features): Mention this. * tests/Makefile.am (TESTS): Add cp/preserve-slink-time. * tests/cp/preserve-slink-time: New file. * m4/jm-macros.m4 (coreutils_MACROS): Test for utimensat. Reported in http://bugzilla.redhat.com/230866
2009-07-30tests: new function: require_openat_support_Jim Meyering
* tests/rm/inaccessible: Factor out openat-support-detection code... * tests/test-lib.sh (require_openat_support_): ...into this new function.
2009-07-30tail: properly parse fractional seconds when monitoring a pidPádraig Brady
* src/tail.c (tail_forever_inotify): The fractional part of the delay was 1000 times too large. * tests/tail-2/pid: Add a test to ensure the timeout happens for this case.
2009-07-30tests: test for just-fixed tail --pid bugJim Meyering
* tests/tail-2/pid: Ensure tail exits successfully when PID dies.
2009-07-29maint: update sleep.c's copyright year listJim Meyering
* src/sleep.c: Update copyright year list to include 2009. * tests/sort-time/rand-gen: Remove long-unused file. * tests/sort-time/README: Likewise.
2009-07-27tests: new test for bug in ls -1U dir arg ...Jim Meyering
* tests/misc/ls-misc (multi-arg-U1): New test.
2009-07-09tests: avoid false-positive cp/link-heap failureJim Meyering
* tests/cp/link-heap: Increase address space limit from 14000KB to 16000KB, to avoid failure with Debian unstable's libc6-dev-2.9-19
2009-07-04tests: refactor code to use require_proc_pid_status_Giuseppe Scrivano
* tests/tail-2/tail-n0f: Read the process status using the test-lib.sh require_proc_pid_status_ function.
2009-07-04tests: use the "nobody" user's group as the default group idGiuseppe Scrivano
* tests/chroot/credentials: Use the group id, not its name. * tests/test-lib.sh (NON_ROOT_GROUP): Use the "nobody" user's group in place of "nogroup".
2009-07-03sort: allow SI and IEC units on separate human sort fieldsPádraig Brady
* src/sort.c: Store the si_present state per key rather than globally * tests/misc/sort: Add a check that would have previously failed. Also add a test to demonstrate that invalid IEC/SI mixtures are not always noticed when they're not significant to the sort.
2009-07-03tests: tail-2/wait: rename internal file nameJim Meyering
* tests/tail-2/wait: Rename file from not_accessible to unreadable, since all the test cares about is readability.
2009-07-03tests: tail-2/wait: don't fail when run as rootGiuseppe Scrivano
* tests/tail-2/wait: Ensure that the unreadable file really is not readable before trying to run "tail -f" on it.
2009-06-27stdbuf: fix to stop -i option causing an assertionPádraig Brady
* src/stdbuf.c (main): Fix the array bounds check in the assert * tests/misc/stdbuf: Add a test for all standard streams
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2009-06-23maint: remove old TODO filesJim Meyering
* lib/TODO: Remove file. * tests/join/TODO: Likewise.
2009-06-23tests: tail-2/pid: include more info upon failureJim Meyering
* tests/tail-2/pid: Print unexpected $state upon failing.
2009-06-17stdbuf: A new program to run a command with modified stdio bufferingPádraig Brady
* AUTHORS: Register as the author. * NEWS: Mention this change. * README: Add stdbuf command to list. * configure.ac: Only enable on ELF systems with GCC. * cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than VC_LIST, so we can add an exception, if needed. * .x-sc_system_h_headers: New file. Exempt libstdbuf.c. * Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers. * doc/coreutils.texi (stdbuf invocation): Add stdbuf info. * man/.gitignore: Ignore generated manpage. * src/.gitignore: Ignore stdbuf and libstdbuf.so binaries. * man/Makefile.am (stdbuf.1): Add dependency. * man/stdbuf.x: New file with example usage. * po/POTFILES.in: Reference new command and shared library sources. * src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf, (pkglib_PROGRAMS): Reference optional shared lib, (libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a. (libstdbuf_so_LDFLAGS): Add -shared GCC option, (libstdbuf_so_CFLAGS): Add -fPIC GCC option. (check-README): Exclude libstbuf. (check-AUTHORS): ditto. (sc_tight_scope): Exclude functions starting with __. * src/libstdbuf.c: The LD_PRELOAD shared library to control buffering. * src/stdbuf.c: New file to setup env variables before execing command. * tests/Makefile.am: Reference new test file. * tests/misc/help-version: Set expected exit codes. * tests/misc/invalid-opt: ditto. * tests/misc/stdbuf: Add 9 tests.
2009-06-15maint: revert last change: we're not ready for "local" in scripts, yetJim Meyering
Revert "use a local var: more readable" This reverts commit c0d82452883a10911c9cbc69c84144d99b7e6b08.
2009-06-15use a local var: more readableJim Meyering
2009-06-15tail: use inotify if it is availableGiuseppe Scrivano
* NEWS: Document the new feature. * m4/jm-macros.m4: Check if inotify is present. * src/tail.c (tail_forever_inotify): New function. (main): Use the inotify-based function, if possible. * tests/Makefile.am: Add new tests for tail. * tests/test-lib.sh (require_proc_pid_status_, get_process_status_): New functions. * tests/tail-2/pid: New file. * tests/tail-2/wait: New file. * tests/tail-2/tail-n0f: Refactor code into the test-lib.sh require_proc_pid_status_ function.
2009-06-13sort: Ignore fields where end position is before the start positionCliff Miller
* NEWS: Mention the fix * THANKS: Add Cliff Miller * src/sort.c (keycompare): Ensure lima >= texta * tests/misc/sort: Add 3 corresponding tests Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-06-11tests: ls --color, permissions override hardlink coloringPádraig Brady
* tests/ls/multihardlink: Add a test case to demonstrate and test this non obvious behavior.
2009-06-11ls --color: do not colorize files with multiple hard links by defaultKamil Dudka
* src/ls.c: Rename hl->mh, do not colorize files with multiple hard links by default. * src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh. * src/dircolors.hin: Do not colorize files with multiple hard links by default. * tests/Makefile.am: Rename the test case accordingly. * tests/ls/multihardlink: Additionally test ls' default behavior and factor out some duplication. * NEWS: Mention the change in behavior.
2009-06-02chroot: make --groups= work without --userspec=; be more robustJim Meyering
* src/chroot.c (set_additional_groups): Add comments. Given an empty or all-comma group list, diagnose it and return nonzero. When more than one group is invalid, diagnose all of them, not just the first. (main): Honor --groups= also when --userspec= is not specified. Now that set_additional_groups consistently diagnoses its failures, don't diagnose it separately here. * tests/chroot/credentials: Do not invoke with an empty group list.
2009-06-02chroot: don't set bogus user-ID or group-ID for --u=U: or --u=:GJim Meyering
* src/chroot.c (main): Initialize both "uid" and "gid". To -1. This also allows one to set the user-ID or primary group-ID to 0, in case it's not that already. * tests/chroot/credentials: Test for the above.
2009-06-02tests: use "nobody" as the default group name in chroot testJim Meyering
* tests/test-lib.sh (NON_ROOT_GROUP): Use "nobody", not "nogroup".
2009-05-26sort: new --human-numeric-sort option to sort KiB MB etc.Michael Speer
* NEWS: Document the new option * doc/coreutils.texi (sort invocation): ditto * src/sort.c (main): handle the new --human-numeric-sort option (-h). (human_numcompare): A new function to compare SI and IEC suffixes before falling back to the standard --numeric comparison. (find_unit_order): A new helper function to find the order of magnitude of a number string as determined by its suffix. (check_mixed_SI_IEC): A new helper function to exit with error if both SI and IEC suffixes are presented. * tests/misc/sort: Add 8 tests to test the new functionality. * THANKS: Update
2009-05-26chroot: accept new options --userspec=U:G and --groups=G1,G2,G3Giuseppe Scrivano
* NEWS: Note chroot's new options. * doc/coreutils.texi: Document them. * src/chroot.c (main): Add support for --userspec and --groups. * tests/Makefile.am (root-tests): Add chroot/credentials. * tests/chroot/credentials: New file. * tests/test-lib.sh: Define NON_ROOT_GROUP to a default value.
2009-05-15tests: fix date-next-dow failure on older systemsPádraig Brady
* tests/misc/date-next-dow: In the strftime call use %Y-%m-%d rather than the newer %F equivalent which is not available on Solaris 8 for example.
2009-05-05tests: rm/one-file-system: umount more reliablyJim Meyering
* tests/rm/one-file-system: Run umount via trap, so it runs also upon irregular termination.
2009-05-03tests: add tests of e.g., date -d 'next monday'Jim Meyering
* tests/misc/date-next-dow: New file. * tests/Makefile.am (TESTS): Add misc/date-next-dow. * gnulib: Update submodule to latest, for getdate.y that handles "next Monday" properly when run on a Monday.
2009-04-28tests: ensure that cp's -a doesn't silence --preserve=contextOndřej Vašík
* tests/cp/cp-a-selinux: Ensure that the -a option does not silence error diagnostics from --preserve=context, when preserving context is required.
2009-04-28tests: add test for xattr diagnostics on dest. FS lacking xattr supportOndřej Vašík
* tests/cp/cp-mv-enotsup-xattr: Ensure that xattr diagnostics are displayed correctly when destination filesystem lacks xattr support. * tests/Makefile.am (root_tests): Add new root-only test.
2009-04-24tests: avoid unusual (~1-in-20) failure of a new testJim Meyering
* tests/misc/sort: Remove one of the generated tests. 363 remain in this file alone.
2009-04-23sort -m: don't segfault when output file is also an input fileJim Meyering
* src/sort.c (avoid_trashing_input): Fix an off-by-one error and guard the use of memmove. * NEWS (Bug fixes): Mention it. * tests/misc/sort: Add tests to exercise the offending code. * THANKS: Update. Reported by Otavio Salvador in http://bugs.debian.org/525048.
2009-04-22cp: work around linux kernel bug: short-read != EOF on /procJim Meyering
Remove the optimization that avoided up to 50% of cp's read syscalls. Do not assume that a short read on a regular file indicates EOF. When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29] into a 4k-byte buffer or larger, a short read does not always indicate EOF. For example, "cp /proc/slabinfo /tmp" copies only 4068 of the total 7493 bytes. This optimization (25719a33154f0c62ea9881f0c79ae312dd4cec7a, Improve performance a bit by optimizing away; 2005-11-24) appears to have been worth less than a 2% speed-up (and usually much less), so the impact of removing it is negligible. * src/copy.c (copy_reg): Don't exit the loop early. * tests/cp/proc-short-read: New test, lightly based on a suggestion from Mike Frysinger, to exercise this fix. * tests/Makefile.am (TESTS): Add cp/proc-short-read. * NEWS (Improve robustness): Mention this change.
2009-04-22tests: avoid new "make distcheck" failure due to newer File::TempJim Meyering
With newer perl (e.g., Fedora 10's 4:5.10.0-68.fc10), tests/CuTmpdir.pm stopped removing its temporary directories, with diagnostics like this: cannot remove path when cwd is /c/coreutils/tests/misc/seq.tmp-e2up \ for /c/coreutils/tests/misc/seq.tmp-e2up: at \ /usr/lib/perl5/5.10.0/File/Temp.pm line 902 Chdir out of the target directory before that code runs: * tests/CuTmpdir.pm (END): chdir '..'. (chmod_tree): Remove explicit "chdir $dir".
2009-04-19tests: avoid failure of install-C test on FreeBSD UFS file systemAurelien Jarno
* tests/install/install-C: Use 2755 (set-gid), not 1755 (sticky), to test install -C with non-permission mode bits set. At least on FreeBSD with a UFS file system, a non-root user may not set the sticky bit on a non-directory.
2009-04-09tests: misc/ls-misc: avoid shadowing local decl of $eJim Meyering
* tests/misc/ls-misc (make_j_d): Rename latter $e to $env
2009-04-09id: fix infinite loop on some systemsPádraig Brady
Steven Parkes reported that `id -G $USER` went into an infinite loop on Darwin systems for users in more than 10 groups: http://bugs.gentoo.org/show_bug.cgi?id=264007 * gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist implementations that don't update the required size correctly, by doubling the result buffer and retrying. Also return the parameter updated by getgrouplist rather than its return value, as the documentation doesn't actually state the number of groups stored is returned by getgrouplist. * tests/misc/id-groups: Add test to exercise this logic * tests/Makefile.am: Reference new test * NEWS: Mention the fix * THANKS: Update
2009-04-07maint: Clarify ambiguous refs to Linux kernels or GNU/Linux systemsPádraig Brady
* README-prereq: s_linux_GNU/Linux_ or s_linux_Linux kernel_ * README-valgrind: ditto * src/chown-core.c: ditto * src/dd.c: ditto * src/df.c: ditto * src/ls.c: ditto * src/mv.c: ditto * src/pwd.c: ditto * src/remove.c: ditto * src/shred.c: ditto * src/stat.c: ditto * src/su.c: ditto * src/system.h: ditto * src/timeout.c: ditto * src/truncate.c: ditto
2009-04-03ls: fix alignment when month names have varying widthsPádraig Brady
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR locale has recently changed to use the official but variable width abbreviated month names. Other glibc locales also have variable widths. http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html http://sourceware.org/bugzilla/show_bug.cgi?id=9859 * NEWS: Mention the fix * gl/lib/mbsalign.c: A new module to align and truncate a string in a specified number of screen cells, while handling multi-byte characters appropriately. * gl/lib/mbsalign.h: Ditto * gl/modules/mbsalign: Ditto * bootstrap.conf: Reference the new module * src/ls.c (abmon_init): New function, precompute the abbreviated months aligned left in a minimum width column <= 5 screen cells. (align_nstrftime): New function, replace the first %b in the format specification to strftime with the precomputed month string. Note using the cached month strings speeds up `ls -lU` by around 17% on glibc-2.7-2 on linux at least. Also if we implement this function using heap storage rather than automatic storage, and use snprintf instead of strcpy, ls will slow down by 2% and 1% respectively (i.e. a net gain of 14% rather than 17%). * tests/ls/abmon-align: A new test to test ls alignment for various formats and locales * tests/Makefile.am: Reference the new test
2009-04-02tests: skip mv/i-3 if /dev/stdin is unreadableJim Meyering
* tests/mv/i-3: Skip if /dev/stdin is unreadable. Reported by Sergei Steshenko.
2009-03-31tests: enable automake's color-tests and parallel-tests via configure.acJim Meyering
* gnulib-tests/Makefile.am (AUTOMAKE_OPTIONS): Don't define here. * tests/Makefile.am (AUTOMAKE_OPTIONS): Likewise. * configure.ac (AM_INIT_AUTOMAKE): Instead, add color-tests and parallel-tests here.
2009-03-31build: use Automake's new parallel-tests featureRalf Wildenhues
* build-aux/check.mk: Remove, not needed any more. * tests/Makefile.am (AUTOMAKE_OPTIONS): Add parallel-tests and color-tests. * tests/check.mk: Do not include build-aux/check.mk any more. (SUFFIXES, TEST_LOGS): Remove. (TESTS_ENVIRONMENT): Use $$f rather than $$tst in $PERL invocation. * gnulib-tests/Makefile.am: Do not include build-aux/check.mk. (AUTOMAKE_OPTIONS): New macro, add parallel-test and color-tests. (TEST_LOGS): Remove.
2009-03-29tests: don't use lang-default from individual testsJim Meyering
* tests/sample-test: Don't recommend using lang-default here. It is now run for each test automatically, via TESTS_ENVIRONMENT. * tests/dd/reblock: Don't source lang-default here. * tests/misc/truncate-fail-diag: Likewise.
2009-03-29tests: other-fs-tmpdir: remove just-added duplicate /usr/tmpJim Meyering
* tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Remove 2nd /usr/tmp.
2009-03-29tests: other-fs-tmpdir: avoid bogus "skipped **********..." diagnosticJim Meyering
* tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Add /dev/shm to the list. Don't use a line of asterisks as the first line of the "why skipped" diagnostic, now that that line is printed on 'make check's stderr.
2009-03-27tests: avoid spurious test failure in set-GID build dirJim Meyering
* tests/install/install-C-root: Skip this test if in set-gid directory. Reported by Sven Joachim and C de-Avillez.