summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2011-11-11ls: -k no longer affects -l's file sizesPaul Eggert
This fixes an incompatibility with POSIX 2008 and with BSD. Problem reported by Abdallah Clark (Bug#9939) via Alan Curry (Bug#10016). * NEWS: Document this. * doc/coreutils.texi (General output formatting): Document the new -k behavior, and --kibibytes. * src/ls.c (file_human_output_opts): New static var. (long_options, usage): Add --kibibytes. (decode_switches, gobble_file, print_long_format): Implement the new -k behavior. * tests/ls/block-size: New file. * tests/Makefile.am (TESTS): Add it.
2011-11-03tests: avoid signal issues in timeout-groupPádraig Brady
These issues were seen on an OpenSuse 10.3 system (kernel 2.6.22.5 x86_64, glibc 2.6.1-18, bash updated to 4.2), and also on a 64 bit SLES system with a 2.6.16 kernel. Both systems had 2 CPUs. There were two issues seen. 1. Occasionally the timeout.cmd shell script would block SIGINT until the sleep command exited. 2. Much less frequently the signal handler in the timeout command itself was ignored, causing SIGALRM to kill the process. * tests/misc/timeout-group: Detect the above two cases, and skip rather than fail. Note only issue 2. causes a failure unless skipped, but we skip for case 1. also, for diagnostic purposes.
2011-11-03tests: fix a race in timeout-groupPádraig Brady
This could cause a false failure, or even an infinite loop in rare circumstances. * tests/misc/timeout-group: Increase the timeouts passed to the timeout command, so that they're effectively not used. Instead the command termination is triggered by the kill commands when everything is in the correct state. Reported by Bernhard Voelker.
2011-10-30tests: doc: fix stale comment in new rm/many-dir-entries-vs-OOMJim Meyering
2011-10-29tests: don't make tail's pipe-f2 test take the full 10 secondsJim Meyering
* tests/tail-2/pipe-f2: Don't always wait 10 seconds. Before, this test would always wait 10 seconds. Now, it stops early when it detects that tail -f has written output. BTW, the race condition that prompted changing the timeout from 1 second to 10 was that tail -f could be killed by the timeout before producing any output.
2011-10-19maint: tac: prefer "failed to" diagnostic over "cannot"Jim Meyering
* src/tac.c: Change wording in diagnostic: "failed to open" seems clearer than "cannot open".
2011-10-17tac: don't misbehave with multiple non-seekable inputsJim Meyering
* src/tac.c (copy_to_temp): Do not reuse the template buffer. Instead, scribble only on a freshly-xstrdup'd copy each time. Free that buffer both here, upon failure, and ... (tac_nonseekable): ...free the buffer in caller, upon success. * tests/misc/tac-2-nonseekable: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. Reported by Ambrose Feinstein in http://debbugs.gnu.org/9762.
2011-10-17maint: speed up make check (vc_exe_in_TESTS)Pádraig Brady
* tests/check.mk (vc_exe_in_TESTS): The main change is to not start a sed process for each file under tests/, which was taking around 2.5s on a 2.1GHz i3-2310M. Also adjust the rule to no longer use temporary files.
2011-10-12tests: avoid a false failure on systems without inotifyPádraig Brady
* tests/tail-2/follow-name: Exclude the inotify warning from the comparison. Reported by Bruno Haible.
2011-10-09tests: skip rather than failing when perl is not availableJim Meyering
* tests/df/total-verify: Use require_perl_, so that this test is skipped when perl is not available. * tests/rm/deep-2: Likewise, and fix wording in a comment. Reported by Bruno Haible.
2011-10-08tests: avoid tail-2/F-vs-missing failure on NFSJim Meyering
* tests/tail-2/F-vs-missing: This test would fail about 80% of the time on linux/powerpc when run in an NFS-mounted directory. Reported by Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1727
2011-10-08tests: avoid ls/slink-acl test failure on Solaris 10Jim Meyering
* tests/ls/slink-acl: Use setfacl's "-m user::r" option rather than less-portable "-m m::r". The latter did not work with Solaris 10's version of setfacl. Reported by Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1737
2011-10-08tests: avoid false-positive failures on linux/sparc64Jim Meyering
* tests/init.cfg (require_strace_): Detect a version of strace that fails on linux/sparc64 for 64-bit executables. Report and most of the suggested fix from Bruno Haible: http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1728
2011-10-05tests: add a test to exercise today's ls-lL-vs-ACL bugJim Meyering
* tests/ls/slink-acl: New file. * tests/Makefile.am (TESTS): Add it. * tests/init.cfg (require_setfacl_): New function. * gnulib: Update to latest, for file-has-acl changes. * NEWS (Bug fixes): Mention it. See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538. This ":>k; setfacl -m m::r k; ln -s k s; ls -Log s" should print e.g., -rw-r-----+ 1 0 Oct 5 19:22 s With the ls from coreutils-8.13, it would print this (with "." or nothing in place of the "+"): -rw-r-----. 1 0 Oct 5 19:22 s
2011-10-01ls: fix output of dangling symlinks colored as targetPádraig Brady
This is related to commit b7f2b51c, 2010-01-01, "ls: fix color of broken symlinks colored as target" which didn't handle the --dereference case. The simplest way to reproduce the resultant erroneous "argetm" is as follows: $ ln -s /no-such dangle $ env LS_COLORS=ln=target ls --dereference --color ls: cannot access dangle: No such file or directory argetmdangle This is also an issue with the `tree` utility, reported here: http://bugs.debian.org/586765 * src/ls.c (print_color_indicator): Move the handling of 'ln=target' in $LS_COLORS (color_symlink_as_referent == true) to a higher scope, to handle all cases where type == C_LINK. * tests/misc/ls-misc: Add a test case for the specific issue, and 2 further test cases to verify other code paths in this area. Reported by Jason Glassey.
2011-09-27sort: avoid a NaN-induced infloopJim Meyering
These commands would fail to terminate: yes -- -nan | head -156903 | sort -g > /dev/null echo nan > F; sort -m -g F F That can happen with any strtold implementation that includes uninitialized data in its return value. The problem arises in the mergefps function when bubble-sorting the two or more lines, each from one of the input streams being merged: compare(a,b) returns 64, yet compare(b,a) also returns a positive value. With a broken comparison function like that, the bubble sort never terminates. Why do the long-double bit strings corresponding to two identical "nan" strings not compare equal? Because some parts of the result are uninitialized and thus depend on the state of the stack. For more details, see http://bugs.gnu.org/9612. * src/sort.c (nan_compare): New function. (general_numcompare): Use it rather than bare memcmp. Reported by Aaron Denney in http://bugs.debian.org/642557. * NEWS (Bug fixes): Mention it. * tests/misc/sort-NaN-infloop: New file. * tests/Makefile.am (TESTS): Add it.
2011-09-24tests: mention new check-expensive/check-very-expensive in test logsBernhard Voelker
* tests/init.cfg: (very_expensive_): Mention toplevel make target, check-very-expensive. (expensive_): Likewise for check-expensive.
2011-09-19tests: init.sh: support any non-GNU diffBruno Haible
* tests/init.sh (compare): If "diff -c" is supported but "diff -u" is not, use "diff -c". Useful on AIX 6.1, HP-UX 11.31, OSF/1 5.1, Solaris 8.
2011-09-19tests: cp-parents: don't let a failing chmod go unnoticedJim Meyering
* tests/cp/cp-parents: If somehow a chmod set-up command failed, subsequent tests would fail in a harder-to-diagnose manner.
2011-09-16md5sum: handle BSD reversed format checksumsPádraig Brady
* src/md5sum.c (split_3): Detect and handle BSD reversed format checksums. * tests/misc/md5sum-bsd: Add a new test. * tests/Makefile.am: Reference new test. * NEWS: Mention the improvement Suggested by Rimas Kudelis.
2011-09-08doc: fix typo in test script commentJim Meyering
* tests/d_type-check: Fix typo in comment.
2011-09-07tests: adjust PATH to include /sbin for mkfs-using testsBernhard Voelker
* tests/init.cfg (require_mkfs_PATH_): New function to test whether mkfs is in PATH, otherwise adding /sbin to PATH. Needed for distributions (OpenSuSE, Solaris) in which sudo does not include /sbin in PATH. * tests/cp/cp-a-selinux: Use require_mkfs_PATH_. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/sparse-fiemap: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/rm/read-only: Likewise.
2011-09-02tests: init.sh: work also with any non-GNU diff that supports -uBruno Haible
* tests/init.sh: Relax check for diff -u support. Rather than checking for GNU diff via --version, simply check for support for -u itself. Useful at least on OpenBSD 4.9.
2011-09-02tests: remove require-perl script; use function insteadJim Meyering
* tests/require-perl: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove it from this list. * tests/init.cfg (require_perl_): New function. * tests/misc/pwd-long: Use the new function, not the file. * tests/ls/nameless-uid: Likewise. * tests/misc/sum-sysv: Likewise.
2011-09-02tests: cut: exercise distro-added multibyte code pathsJim Meyering
* tests/misc/cut: Repeat each test using a multibyte locale, if the configure-time test found such a locale. Adjust the tests so that they also accept a slightly different diagnostic that is specific to the MB-patched cut.
2011-09-01tests: split/l-chunk: avoid a portability issuePádraig Brady
* tests/split/l-chunk: Don't use the `test "$var"` idiom to test that var is set to something as that's not supported by all shells. The new style matches the usage is the rest of the test in any case. Reported by Bruno Haible on AIX 6.1 and 7.1
2011-09-01tests: pwd-long: diagnose failure earlierJim Meyering
Without this change, we'd get use-of-uninit value warnings and harder-to-diagnose failure down the road. * tests/misc/pwd-long (normalize_to_cwd_relative): Diagnose stat failure. This failed on AIX 6.1 and 7.1. Reported by Bruno Haible.
2011-09-01tests: printf-surprise: avoid false-positive failureJim Meyering
* tests/misc/printf-surprise: Also accept a strerror-style string after the usual 'printf: write error:' diagnostic prefix. Otherwise, this test would fail on HP-UX 11. Reported by Bruno Haible.
2011-09-01tests: improve message in 'require_membership_in_two_groups_' functionBernhard Voelker
* tests/init.cfg (require_membership_in_two_groups_): Add quotes around the suggested groups for the COREUTILS_GROUPS variable.
2011-09-01tests: misc/printf: accommodate alternate behaviorJim Meyering
* tests/misc/printf: Avoid false positive failure on MacOS X 10.5 due to a slightly differing diagnostic. Reported by Bruno Haible.
2011-09-01tests: invoke via "env printf", rather than using an absolute nameJim Meyering
* tests/misc/printf: This results in more concise diagnostics.
2011-08-31date: support parsing of ISO-8601-with-"T" datesJim Meyering
Thanks to an improvement in gnulib's parse-datetime module, commands like this now succeed (output manually indented): $ ./date -u -d 2004-02-29T16:21:42.33+07:00 +%FT%T.%N%z 2004-02-29T09:21:42.330000000+0000 * tests/misc/date: Add a test to exercise the new-in-gnulib parsing of ISO8601-with-"T" dates. * NEWS (New features): Mention it. * gnulib: Update, to pull in this parse-datetime improvement.
2011-08-24maint: rename a testJim Meyering
Lesson: do not include details like "4 million" in a file name. * tests/rm/many-dir-entries-vs-OOM: Renamed from ... * tests/rm/4-million-entry-dir: ...this. * tests/Makefile.am (TESTS): Reflect renaming.
2011-08-24tests: adjust the new, very expensive rm test to be less expensiveJim Meyering
* tests/rm/4-million-entry-dir: Create only 200,000 files, rather than 4 million. The latter was overkill, and was too likely to fail due to inode exhaustion. Not everyone is using btrfs yet. Now that this test doesn't take so long, label it as merely "expensive", rather than "very expensive". Thanks to Bernhard Voelker for pointing out the risk of inode exhaustion.
2011-08-24pr: fix so that LAST_PAGE is honored with -TPádraig Brady
Ever since the LAST_PAGE functionality was added in commit ed0923a1, 1996-12-05, "Apply big patch (patch-20) from Roland Huebner" it was ignored when -t or -T were specified or when -l <= 10. * src/pr.c (print_page): Increment the current page here. (print_header): Don't increment the current page here. * tests/pr/pr-tests: Add a test case. * NEWS: Mention the fix Reported at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347
2011-08-19rm, du, chmod, chown, chgrp: use much less memory for large directoriesJim Meyering
For details, see the gnulib commit, http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=47cb657e * tests/rm/4-million-entry-dir: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. * gnulib: Update to latest to get the required fts fixes.
2011-08-08tests: avoid lack-of-support du test failure on HP-UX 11.31Jim Meyering
* tests/du/inaccessible-cwd: Skip this test on systems like HP-UX 11.31 that lack both the *at functions and the /proc/self/fd-based support we might have used to emulate them. Reported by Bruno Haible in http://debbugs.gnu.org/8846
2011-08-08join: with --check-order print offending file name, line number and dataJim Meyering
* src/join (g_names): New global (was main's "names"). (main): Update all uses of "names". (line_no[2]): New globals. (get_line): Increment after reading each line. (check_order): Print the standard "file name:line_no: " prefix as well as the offending line when reporting disorder. Here is a sample old/new comparison: -join: file 1 is not in sorted order +join: in:4: is not sorted: contents-of-line-4 * tests/misc/join: Change the two affected tests to expect the new diagnostic. Add new tests for more coverage: mismatch in file 2, two diagnostics, zero-length out-of-order line. * NEWS (Improvements): Mention it. Suggested by David Gast in http://debbugs.gnu.org/9236
2011-08-08maint: add copyright notice to init.cfgJim Meyering
* tests/init.cfg: Add copyright. Suggested by Stefano Lattarini.
2011-08-08tests: complete the renaming framework_failure -> framework_failure_Stefano Lattarini
These changes were mostly mechanical, made by running the following command: git grep -lw framework_failure | grep -v ChangeLog \ | xargs perl -pi -e 's/\b(framework_failure)\b/${1}_/' and then editing init.cfg and `tests/cp/cp-a-selinux' by hand. * tests/init.cfg (framework_failure): Remove, `framework_failure_' from init.sh should be used instead in the tests. Remove now-obsolete "FIXME" comment. (is_local_dir_, require_strace_, require_membership_in_two_groups_, require_sparse_support_, skip_if_mcstransd_is_running_, mkfifo_or_skip_) Use `framework_failure_', not `framework_failure'. * Many test scripts: Likewise.
2011-08-04tests: remove obsolete 'error_' shell functionStefano Lattarini
* tests/init.cfg (framework_failure, getlimits_): Use 'fatal_' instead of 'error_'. (error_): Delete, it's not used anymore (and one is anyway advised to use 'fatal_' instead). Update heading comments. * tests/shell-or-perl (error_): Renamed ... (fatal_): ... to this, for consistency. Also, add a useful comment.
2011-07-27maint: copy: refactor hard link creationPádraig Brady
* src/copy.c (create_hard_link): A new function refactored from existing code. (copy_internal): Call the new function from all 3 locations that create hard links. * tests/cp/same-file: Amend to match the adjusted diagnostic.
2011-07-27tests: cp/preserve-link: test all relevant pathsPádraig Brady
* tests/cp/preserve-link: Add test cases for when a missing link in the destination tree is encountered first and second. Also add cases for old and new separate files in the destination tree, both to make the clobbering behavior explicit, and to test any changes in this area in future.
2011-07-26maint: use consistent style in C and test scriptsJim Meyering
* src/copy.c (copy_internal): Adjust formatting style to conform with guidelines in HACKING: put braces around two one-line "else" blocks. * tests/cp/existing-perm-dir: Use $(...), not `...`, and stat rather than ls+cut to get the mode string. mode=$(stat --p=%A dst/dir)
2011-07-25cp: don't mishandle existing dir dest permissions (Bug#9170)Paul Eggert
* src/copy.c (copy_internal): If we don't create the directory, then we cannot have omitted permissions. Problem and trivial fix reported by Eric Lammerts. * tests/Makefile.am (TESTS): Add cp/existing-perm-dir. * tests/cp/existing-perm-dir: New file.
2011-07-25cp -up: preserve all hard linksJim Meyering
* src/copy.c (copy_internal): With --update (-u), this function would return early once it found that the destination is not older than the source, *without* recording the source-dev/ino--to--dest_name mapping. That mapping is required in order to preserve src hard links in the destination tree, so when using cp with --update and --preserve=links (perhaps via -p or -a), cp could fail to preserve one hard link per inode when at least one of the hard-linked names already exists in the destination tree. Reported by Odd Harry Mannsverk in http://debbugs.gnu.org/8419. * tests/cp/preserve-link: New file. Exercise the flaw/fix. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
2011-07-25timeout: support sub-second timeoutsPádraig Brady
* src/timeout.c (settimeout): A new function to convert from a floating point duration and call alarm() or timer_settime() if that's available. (parse_duration): Return a double rather than unsigned int. (usage): Mention floating point is supported. (main): Pass the double to settimeout() rather than calling alarm() directly with the parsed int. (cleanup): Likewise. * doc/coreutils.texi (timeout invocation): Say floating point timeouts now supported, and mention the caveat with resolution. * bootstrap.conf: Include the timer-time gnulib module. * tests/misc/timeout-parameters: Add a test with nanoseconds. * NEWS: Mention the improvement.
2011-07-20unexpand: fix misalignment when spaces span a tabstopPádraig Brady
The following dropped the space from the first field printf "1234567 \t1\n" | unexpand -a Note POSIX says that spaces should not precede tabs. Also a single trailing space should not be converted if the next field starts with non blank characters. So we enforce those rules too, with this change. * src/unexpand.c (unexpand): Implement as per POSIX rules. * tests/misc/unexpand: Add tests, and adjust existing tests as per POSIX rules. * NEWS: Mention the fix. Reported by Hallvard B Furuseth
2011-07-17timeout: add regression test (Bug#9098)Paul Eggert
* tests/misc/timeout: Check that 'timeout' is not confused when starting off with a child.
2011-07-16timeout: treat seconds counts like 'sleep' doesPaul Eggert
Treat fractions as a request to round up to the next representable value, and treat out-of-range values as maximal ones. This is consistent with how "sleep" works. And this way, "timeout 999999999999999999d FOO" and "timeout 4.5 foo" are more likely to do what the user wants. * src/timeout.c: Include c-strtod.h and xstrtod.h, not xstrtol.h. (apply_time_suffix): Change it to the way sleep.c's time_suffix does things. Maybe this function (identical in both programs, other than its name) should be moved to a library? (parse_duration): Return a maximal value on overflow. Return unsigned int, not unsigned long. Allow fractions, which round up to the next integer value. * tests/misc/timeout-parameters: Adjust tests to match new behavior. Add a very large number.