summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2009-09-01ls -i: print consistent inode numbers also for mount pointsJim Meyering
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT would print the wrong inode number for any entry that is a mount point. It would do that by relying on readdir's dirent.d_ino values, while most readdir implementations return the inode number of the underlying, inaccessible directory. Thus, it is not consistent with what you'd get when applying stat to the same entry. This bug led to surprising results like "ls -i" and "ls -i --color" printing different numbers (ls must usually "stat" a file to colorize its name). This change makes it so that on offending systems, ls must stat non-command-line-arguments for which otherwise it would be able to use "for free" dirent.d_ino values. Regardless of this change, ls is already required to stat every command-line argument. Note: versions of GNU ls prior to coreutils-6.0 did not perform the invalid optimization, and hence always printed correct inode numbers. Thus, for the sake of correctness, ls -i is forgoing the readdir optimization, for any kernel (including linux!) with POSIX-nonconforming readdir. Note that currently, only Cygwin has been agile enough to conform. * src/ls.c (RELIABLE_D_INO): Define. (print_dir): Use it. For plenty of discussion, see this long thread: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020 This bug was introduced by the 2006-02-26 commit, 33eb3efe: "In ls, avoid calling stat for --inode (-i), when possible." * tests/ls/readdir-mountpoint-inode: New test. * tests/Makefile.am (TESTS): Add it. * tests/ls/stat-vs-dirent: Don't suppress failure of this test, now that ls -i is fixed. Though note that it doesn't test well, since it compares only the always-stat'd command-line arguments. * NEWS (Bug fixes): Mention it.
2009-08-30tests: don't misbehave if $TMPDIR contains spacesPádraig Brady
* tests/misc/xattr: Add quotes. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/sticky-to-xpart: Likewise.
2009-08-29tests: other-fs-tmpdir: don't misbehave for quote-unfriendly $TMPDIRJim Meyering
* tests/other-fs-tmpdir: Quote uses of variables that might expand to strings containing e.g., whitespace.
2009-08-29tests: cp/reflink-auto guard against a pathological $TMPDIRJim Meyering
* tests/cp/reflink-auto: Add quotes.
2009-08-29cp --reflink: preserve attributes on cloned files if askedPádraig Brady
* src/copy.c (copy_reg): When cloning only skip the data copying * tests/cp/reflink-perm: New test to check times and modes copied * tests/Makefile.am: Reference the new test * NEWS: Mention the fix
2009-08-29cp --reflink: add an "auto" parameter to fall back to a normal copyPádraig Brady
* doc/coreutils.texi (cp invocation): Document the new "auto" and "always" options to --reflink. * src/copy.c (copy_reg): Fall back to a standard copy when reflink() is not supported and --reflink=auto specified. * src/copy.h [struct cp_options] (reflink): Change type s/bool/enum/. * src/cp.c (usage): Describe the --reflink={always,auto} options and expand a little on what --reflink does. (main): parse the new parameters to --reflink and allow all --sparse options with --reflink=auto. * src/install.c (cp_option_init): Init the enum instead of bool. * src/mv.c (cp_option_init): Likewise. * tests/cp/reflink-auto: A new test for falling back to normal copy. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature.
2009-08-28dd: detect closed stderrEric Blake
* src/dd.c (maybe_close_stdout): Always flush stderr; regression introduced in commit 381e69ea. * tests/misc/close-stdout (p): Use consistent style. * tests/dd/stderr: New test, borrowing from misc/close-stdout. * tests/Makefile.am (TESTS): Run it. * NEWS: Mention this.
2009-08-26tests: mkdir/selinux: avoid spurious failure on some SELinux systemsJim Meyering
* tests/test-lib.sh (require_selinux_enforcing_): New function. * tests/mkdir/selinux: Use it. Otherwise, this test would fail on Rawhide with SELinux disabled.
2009-08-26tests: tail-2/assert: avoid risk of race conditionJim Meyering
* tests/tail-2/assert: Avoid spurious failure due to race condition. Rather than sleeping for 1 second and crossing fingers, wait explicitly for backgrounded tail process to start. Otherwise, this test would fail under heavy load.
2009-08-25maint: remove Local Variables: indent-tabs-mode: nil from all sourcesJim Meyering
* src/getlimits.c: Likewise. * src/group-list.c: Likewise. * src/groups.c: Likewise. * src/mktemp.c: Likewise. * src/setuidgid.c: Likewise. * src/stdbuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise. * gl/lib/mbsalign.c: Likewise. * tests/test-lib.sh: Likewise. * bootstrap: Likewise. * README-hacking: Likewise.
2009-08-25global: convert indentation-TABs to spacesJim Meyering
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-08-23tests: skip (don't fail) a cp test, upon mount-related failureJim Meyering
* tests/cp/cp-mv-enotsup-xattr: Upon a set-up failiure, rather than failing the test with a "framework failure" diagnostic, just skip it. Russell Whitaker reported that this test failed on slackware.
2009-08-20tests: skip the stdbuf tests when the abs build directory name is bogusJim Meyering
* tests/misc/stdbuf: Avoid spurious failure when the directory name from which we'd set LD_PRELOAD contains unsafe characters.
2009-08-19tests: make install-C slightly less prone to confusionJim Meyering
* tests/install/install-C: Invoke framework_failure, if necessary.
2009-08-18tests: stdbuf: fix a bug in test scriptJim Meyering
* tests/misc/stdbuf: Use skip_test_ only after it's defined. Reported by Berhnard Voelker. (sc_check-AUTHORS): Rename rule from check-AUTHORS.
2009-08-16tests: tail-2/append-only: don't discard stderrJim Meyering
* tests/tail-2/append-only: Don't discard a diagnostic that may help explain why this test fails for some. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17621/focus=17641
2009-08-14tests: skip the misc/stdbuf test if stdbuf was not builtJim Meyering
* tests/misc/stdbuf: Skip this test when stdbuf is not built. Reported by Eric Blake.
2009-08-14cp,mv: fix issues with preserving timestamps of copied symlinksPádraig Brady
* src/copy.c (copy_internal): On systems without utimensat don't use utimens on a symlink, as that would dereference the symlink. * tests/cp/abuse: To work around possible attribute preservation failures breaking the test, use cp -dR rather than cp -a.
2009-08-13tests: raise ulimit virt-mem limit to avoid new failureJim Meyering
* tests/cp/link-heap: Raise limit from 16MB to ~20MB, to avoid spurious failure on rawhide.
2009-08-12tests: improve one of the tail --pid testsPádraig Brady
* tests/tail-2/pid: Speed up the test by specifying a timeout of 100ms rather than the default 1s. Also skip the test instead of failing in the unlikely case were the pid required to be missing pid is present.
2009-08-07cp: accept the --reflink optionGiuseppe Scrivano
* NEWS: Mention it. * doc/coreutils.texi (cp invocation): Describe it. * src/copy.h (struct cp_options) [reflink]: New member. * src/copy.c (usage): Describe it. (copy_reg): If reflink is true try to clone the file. (main): Check for --reflink. (cp_option_init): Initialize the new member. * src/install.c (cp_option_init): Initialize the new member. * src/mv.c (cp_option_init): Likewise. * tests/cp/sparse: Add a new test case.
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.