summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2010-04-29sort: use long doubles for general numeric modePádraig Brady
* src/sort.c (general_numcompare): Use long doubles unconditionally, and strtold when available, to convert numbers with greater range and precision. Performance was seen to be on par with standard doubles. * doc/coreutils.texi (sort invocation): Amend the -g description to mention long double rather than double, and strtold rather than strtod. * src/getlimits.c (main): Output floating point limits for use in tests. * tests/misc/sort-float: A new test to ensure sort is using long doubles when possible, and that locale specific floats are handled. * tests/Makefile.am: Reference the new test. * tests/test-lib.sh (getlimits_): Normalize indenting. * NEWS: Mention the new behaviour. Reported by Nelson Beebe.
2010-04-24tests: clean up also upon SIGQUITJim Meyering
* tests/test-lib.sh: Also trap on SIGQUIT. Spotted by Dmitry V. Levin.
2010-04-23tests: fix exit status of signal handlers in shell scriptsDmitry V. Levin
The value of `$?' on entrance to signal handlers in shell scripts cannot be relied upon, so set the exit code explicitly. * cfg.mk (sc_always_defined_macros, sc_system_h_headers): Set the exit code in signal handler explicitly to 128 + SIG<SIGNAL>. * src/Makefile.am (sc_tight_scope): Likewise. * tests/test-lib.sh: Likewise.
2010-04-20sort: fix parsing of end field in obsolescent key formatsPádraig Brady
This regression was introduced in commit 224a69b5, 2009-02-24, "sort: Fix two bugs with determining the end of field". The specific regression being that we include 1 field too many when an end field is specified using obsolescent key syntax (+POS -POS). * src/sort.c (struct keyfield): Clarify the description of the eword member, as suggested by Alan Curry. (main): When processing obsolescent format key specifications, normalize eword to a zero based count when no specific end char is given for an end field. This matches what's done when keys are specified with -k. * tests/misc/sort: Add a few more tests for the obsolescent key formats, with test 07i being the particular failure addressed by this change. * THANKS: Add Alan Curry who precisely identified the issue. * NEWS: Mention the fix. Reported by Santiago Rodríguez
2010-04-16cp: preserve "capabilities" when also preserving file ownershipPádraig Brady
* src/copy.c (copy_reg): Copy xattrs _after_ setting file ownership so that capabilities are not cleared when setting ownership. * tests/cp/capability: A new root test. * tests/Makefile.am (root_tests): Reference the new test. * NEWS: Mention the fix.
2010-04-16tests: avoid spurious failure of ls/color-norm testPádraig Brady
* tests/ls/color-norm: Use the "time" output by `ls -l` to check normal style. Previously we used the size from `ls -s`, but the size of "empty" files can vary depending on whether SELinux is enabled for example.
2010-04-14tests: avoid spurious failure of root-only ls/capability testJim Meyering
* tests/ls/capability: Adjust this test not to expect the no-op escape sequence that was removed from all other tests by 2010-01-30 commit 5d43617e, "ls --color: don't emit a final no-op escape sequence".
2010-04-13cp: treat selinux warnings consistentlyPádraig Brady
* src/copy.c (copy_reg): Suppress SELinux ENOTSUP warnings consistently between the destination being present or not. Previously we did not suppress ENOTSUP messages when the destination was present. (copy_internal): Use the same ENOTSUP supression method as copy_reg() even though the issue was not seen in this case. * tests/cp/cp-a-selinux: Add a test case for the issue and group the other test cases in the file more coherently. * tests/cp/cp-mv-enotsup-xattr: Do the same check for xattr warnings, even though they did not have the issue.
2010-04-07tests: add a PATH-sanity-check to help-versionJim Meyering
* tests/misc/help-version: Sync from gzip's version. * tests/check.mk (TESTS_ENVIRONMENT): Export VERSION, as required for new help-version test.
2010-03-29tests: avoid spurious sc_prohibit_test_minus_ao syntax-check failuresJim Meyering
* tests/misc/ls-time: Change comments and diagnostics. * tests/misc/xattr: Likewise.
2010-03-26tests: fix typos in envvar-check scriptJim Meyering
* tests/envvar-check: Fix variable name typos. Probably harmless, since no selected shell would fail to unset.
2010-03-26nice,chroot: use more standard option parsingPádraig Brady
Related to the 2010-03-25 commit, 88d4b346, "timeout: use more standard option parsing". * src/nice.c (main): Don't use parse_long_options() which is a helper for commands that don't have any long options specific to them. * src/chroot.c (main): Likewise. * tests/misc/nice-fail: Remove a case that now passes due to us accepting multiple instances of the --help and --version options. * tests/misc/chroot-fail: Likewise.
2010-03-26timeout: use more standard option parsingKim Hansen
* src/timeout.c (main): Don't use parse_long_options() which is a helper for commands that don't have any long options specific to them. * tests/misc/timeout-parameters: Remove a case that now passes due to us accepting multiple instances of the --help and --version options. * THANKS: Add the author. Signed-off-by: Pádraig Brady <P@draigBrady.com>
2010-03-19tests: change help-version to per-program functionsPaolo Bonzini
* help-version: Change each *_args variable to a *_setup function.
2010-03-16timeout: add the --kill-after optionPádraig Brady
Based on a report from Kim Hansen who wanted to send a KILL signal to the monitored command when `timeout` itself received a termination signal. Rather than changing such a signal into a KILL, we provide the more general mechanism of sending the KILL after the specified grace period. * src/timeout.c (cleanup): If a non zero kill delay is specified, (re)set the alarm to that delay, after which a KILL signal will be sent to the process group. (usage): Mention the new option. Separate the description of DURATION since it's now specified in 2 places. Clarify that the duration is an integer. (parse_duration): A new function refactored from main(), since this logic is now called for two parameters. (main): Parse the -k option. * doc/coreutils.texi (timeout invocation): Describe the new --kill-after option and use @display rather than @table to show the duration suffixes. Clarify that a duration of 0 disables the associated timeout. * tests/misc/timeout-parameters: Check invalid --kill-after. * tests/misc/timeout: Check a valid --kill-after works. * NEWS: Mention the new feature.
2010-03-04tests: don't let the LANGUAGE envvar perturb testsJim Meyering
* tests/envvar-check (vars): Add LANGUAGE to the list of envvars to unset. At least in glibc (as an extension to POSIX), its value actually trumps LC_ALL: $ LC_ALL=es_ES LANGUAGE=fr_FR.UTF-8 /bin/cat no-such /bin/cat: no-such: Aucun fichier ou dossier de ce type but only when the default locale is not C: $ LC_ALL=C LANGUAGE=fr_FR.UTF-8 /bin/cat no-such /bin/cat: no-such: No such file or directory Prompted by a report from Mads Kiilerich.
2010-03-01sort: fix issues with month sorting in some localesPádraig Brady
* src/sort.c (char fold_toupper[]): Change to unsigned so as the correct comparisons are made in getmonth(). This fixes unibyte locales where abbreviated months have characters that are > 0x7F, but it also works for multibyte locales with the caveat that multibyte characters are matched case sensitively. With this change, the following example sorts correctly: $ echo -e "1 márta\n2 Feabhra" | LANG=ga_IE.utf8 sort -k2,2M 2 Feabhra 1 márta * src/sort.c (inittables): Since we ignore blanks around months in the input, don't include them when they're present in the locale. With this change, the following example sorts correctly: $ echo -e "1 2月\n2 1月" | LANG=ja_JP.utf8 sort -k2,2M 2 1月 1 2月 * tests/misc/sort-month: A new test to exercise the above cases. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix.
2010-02-25expr: clarify error messageEric Blake
* src/expr.c (eval4, eval3): Clarify that expr expects integers, and not the broader category of numbers. * tests/misc/expr: Update test accordingly. Suggested by Dan Jacobson.
2010-02-17ls: fix a regression by honoring NORMAL attributes againMoritz Orbach
Output the NORMAL attribute before non file name text. This attribute will continue into file names that would not otherwise be colored unless FILE is also set. The regression was introduced with commit 483297d5, 28-02-2009, "ls --color no longer outputs unnecessary escape sequences". * src/ls.c (set_normal_color): A new function to output the NORMAL attribute sequence if it's enabled. (print_current_files): Output NORMAL before printing long format info. (print_file_name_and_frills): Output NORMAL before printing file name. (print_color_indicator): Reset the attributes before a file name with attributes so that NORMAL attributes will not combine with them. (print_name_with_quoting): Ensure attributes are reset after printing the file name if NORMAL attributes were output. * tests/ls/color-norm: A new test for NORMAL and FILE combinations. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix. Reported in https://savannah.gnu.org/bugs/?26512
2010-02-16tests: fix an unlikely race in tail-2/inotify-hash-abuse2Pádraig Brady
* tests/tail-2/inotify-hash-abuse2: Explicitly kill the process by using cleanup_() rather than using a timeout which may trigger a failure on very slow systems (< 20 iterations of the loop per second).
2010-02-07tests: include help-version test settings used by gzip and grepJim Meyering
* tests/misc/help-version: ...the better to keep this file in sync.
2010-02-02tests: fix various timeout racesPádraig Brady
Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/277485 * tests/misc/timeout: Set all expected timeouts to 1s and all unexpected timeouts to 10s. In this way, tests normally proceed quickly but may delay up to 10s before reporting failures. * tests/ls/infloop: Likewise. * tests/tail-2/pid: Likewise. * tests/tail-2/pipe-f: Likewise. * tests/tail-2/wait: Likewise. * tests/dd/skip-seek-past-dev: Likewise.
2010-02-01tests: cp-a-selinux: skip the test if mounting a loop device failsOndřej Vašík
* tests/cp/cp-a-selinux: Skip the test (instead of fail) if we fail to mount a loop device (e.g., none available).
2010-02-01join: make -t '' operate on the whole linePádraig Brady
Previously passing an empty parameter to -t would raise an error, but now it means to treat each line as a single field for matching. This matches the default operation of `sort` which is usually used in conjunction with join. * src/join.c (main): Set the field delimiter to '\n' if an empty parameter is passed to -t. (usage): Mention the operation of -t ''. * tests/misc/join: Add 2 new tests, for the existing -t '\0' and the new -t '' functionality. * doc/coreutils.texi (join invocation): Mention that join -t '' always operates on the whole line, while join -t '\0' usually does. * NEWS: Mention the change in behavior.
2010-02-01join: add --header option to always output the first lineAssaf Gordon
This essentially allows one to use --check-order with headings. Note join without --check-order will already handle the common case where headings do match in each file, however using --check-order will fail often when the header sorts after the first line of data. Note also that this will join header lines from each file even if they don't match, with headings from the first file being used. * NEWS: Mention the new option. * doc/coreutils.texi (join invocation): Describe the new option. * src/join.c (usage): Likewise. (join): Join the header lines unconditionally. * tests/misc/join: Add 5 new tests.
2010-02-01maint: use $(CONFIG_INCLUDE) rather than the hardcoding lib/config.hPádraig Brady
* tests/check.mk (TESTS_ENVIRONMENT): Use the generated CONFIG_INCLUDE variable. Note $(abs_builddir)/$(CONFIG_HEADER) also currently works, but $(CONFIG_HEADER) is deprecated and may not be generated in future. $(CONFIG_INCLUDE) was made available by gnulib in commit, 22970f8a, "syntax-check: detect incorrect boolean macro values in config.h"
2010-02-01ls --color: don't emit a final no-op escape sequenceJim Meyering
* src/ls.c (main): With --color, avoid emitting the final color- resetting escape sequence when it would be a no-op. * tests/ls/color-clear-to-eol: Adjust expected output accordingly. * tests/ls/color-dtype-dir: Likewise. * tests/ls/multihardlink: Likewise. * tests/ls/stat-free-symlinks: Likewise. * tests/misc/ls-misc: Likewise. * NEWS (Changes in behavior): Mention it. C de-Avillez rebased and adapted four of the new sl-dangle* tests in tests/misc/ls-misc. Reported by Jim Avera in http://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/494663
2010-01-23tests: make cp-mv-enotsup-xattr independent of the host file systemPádraig Brady
* tests/cp-mv-enotsup-xattr: Create a file system from which to copy the xattrs so that the test is not skipped if the host file system does not have user_xattr support. Also don't erroneously fail when built without xattr support.
2010-01-23maint: ensure test independence from config macro formatPádraig Brady
* tests/cp/acl: Support USE_ACL not being defined. * tests/mv/acl: Likewise. Also fix typo in skip message. * tests/cp/preserve-slink-time: Support HAVE_UTIMENSAT being 0. * tests/touch/no-dereference: Likewise. * tests/ls/capability: Normalize so 1 is not required to be last char.
2010-01-13tests: avoid spurious failures on older shellsPádraig Brady
* tests/tail-2/inotify-hash-abuse: Use kill rather than wait to determine if the tail process is still running. * tests/tail-2/inotify-hash-abuse2: Ditto.
2010-01-13tests: work around spurious test failure with OpenBSD4.5's /bin/shJim Meyering
* tests/ls/infloop: OpenBSD4.5's /bin/sh would mistakenly include "set -x"-output in an application's stderr stream when stderr is redirected before stdout. This was causing one spurious test failure. The work-around: redirect stdout first. Reported by Nelson Beebe.
2010-01-13tests: don't silently skip the sort-version testsJim Meyering
* tests/misc/sort-version: Don't use <<- and indented here-doc contents. s/<<-/<</ and unindent the here-document contents. Otherwise, bash would ignore the indented delimiter and use EOF, thus silently skipping this test. OpenBSD5.4's shell reported the failure: $ printf 'cat<<-x\n foo\n x\n'|sh sh: <stdin>[4]: here document `x' unclosed [Exit 1] by contrast, bash warns but still exits successfully: $ printf 'cat<<-x\n foo\n x\n'|bash && echo you lose bash: line 3: warning: here-document at line 1 delimited by \ end-of-file (wanted `x') foo x you lose
2010-01-12tests: avoid spurious failure on old kernelEric Blake
* tests/touch/no-dereference: Skip test if utimensat doesn't support symlinks. Reported by Bernhard Voelker.
2010-01-12maint: fix tests on solaris by using /usr/xpg4/binPádraig Brady
* tests/check.mk: Prepend /usr/xpg4/bin to the $PATH if present. Using the more standard utilities allows tests such as misc/printenv, which uses the -E option to grep, to complete.
2010-01-06pr: ensure the page header line is of the required formatEric Blake
Before this change, with too long a file name, the name would abut the date field on the left and possibly also the "Page N" field on the right, rather than leaving a one-space separator in each case. Fixes a regression introduced on Mar 6 2009, by commit a4053c5291d5797734b3e4f042f9e1adf3944fd6 * src/pr.c (print_header): Ensure that there is at least one space before and after the file name part of the header line. * NEWS: Mention it. * tests/pr/W20l24f-ll: s/xPage/ x Page/. * THANKS: Update. Reported by Denis McKeon, in https://savannah.gnu.org/bugs/?28492.
2010-01-01ls: fix color of broken symlinks colored as targetEric Blake
* src/ls.c (print_color_indicator): When using 'LINK target' in dircolors, treat broken symlink as C_ORPHAN. * tests/misc/ls-misc (sl-dangle2, sl-dangle3, sl-dangle4) (sl-dangle5): Test for it, and add more coverage. * NEWS: Document it. * THANKS: Update. Reported by Chris Jones.
2010-01-01maint: add a few copyrights; remove obsolete README fileJim Meyering
* tests/README: Remove long-obsolete file. * tests/Makefile.am (EXTRA_DIST): Remove README. * tests/misc/truncate-dir-fail: Add copyright comment. * tests/misc/selinux: Likewise. * tests/misc/chcon: Likewise. * tests/misc/chcon-fail: Likewise. * tests/sample-test: Use only 2010 in this list.
2010-01-01maint: update all FSF copyright year lists to include 2010Jim Meyering
Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright
2009-12-30tail: test for a bug in inotify-enabled tail -FJim Meyering
tail -F a b would stop tracking additions to b after "mv a b". * tests/tail-2/F-vs-rename: New file. * tests/Makefile.am (TESTS): Add it.
2009-12-29tail: add another test to exercise abort-inducing flaw in tail -FJim Meyering
* tests/tail-2/inotify-hash-abuse2: New test, based on a reproducer by Rob Wortman. * tests/Makefile.am (TESTS): Add it.
2009-12-29tail: add a test to exercise abort-inducing flaw in tail -FJim Meyering
* tests/tail-2/inotify-hash-abuse: New file, derived from a report by Rob Wortman. * tests/Makefile.am (TESTS): Add it. Improved by: Pádraig Brady.
2009-12-23wc: line-buffer the printed countsPádraig Brady
* src/wc.c (main): Set stdout to line buffered mode to ensure parallel running instances don't intersperse their output. This adds 6.5% to the run time in the worst case of many zero length files, but has neglible impact for standard sized files. * tests/misc/wc-parallel: New test for atomic output. * tests/Makefile.am: Reference it. * NEWS: Mention the fix This is similar to commit 710fe413, 20-10-2009, "md5sum, sha*sum, sum: line-buffer the printed checksums"
2009-12-19rm: fix --one-file-system regression due to fts conversionPádraig Brady
* src/remove.c (rm_fts): Fix incorrect comparison of device and inode numbers. * tests/rm/one-file-system2: Add a separate test so that it can be run as a normal user (It doesn't need to mount). * tests/Makefile.am: Reference it. * NEWS: Mention the fix. Reported by Jan Larres.
2009-12-12tests: tail-without-inotify: avoid spurious test failureJim Meyering
* tests/tail-2/wait: Account for the possibility that the kernel lacks inotify support. Reported by Chris Clayton.
2009-12-11tests: use a slightly better CU_TEST_NAME settingJim Meyering
* tests/check.mk (CU_TEST_NAME): Better test names.
2009-12-10tests: avoid spurious failure when run via valgrindJim Meyering
* tests/misc/printenv: Ignore LD_PRELOAD differences.
2009-12-09tests: don't let "umask 077" cause root-only cp/preserve-gid failureJim Meyering
* tests/cp/preserve-gid: Use working_umask_or_skip_ to set umask to 022.
2009-12-08maint: remove an erroneous commentPádraig Brady
* tests/misc/timeout: Remove an erroneous comment introduced through copy and paste.
2009-12-08sort: fix failure if sort's parent has ignored SIGCHLDPádraig Brady
* src/sort.c (main): Reset the SIGCHLD handler to the default as otherwise wait() could return an error. * tests/misc/sort-compress: Set the CHLD handler in a subshell to SIG_IGN to ensure the sort command resets it to SIG_DFL. * NEWS: Mention the fix.
2009-12-08timeout: fix failure if timeout's parent has ignored SIGCHLDPádraig Brady
* src/timeout.c (main): Reset the SIGCHLD handler to the default as otherwise wait() could return -1 and set errno to ECHILD. This condition was ignored until commit 0b1dcf33, on 31-08-2009, "timeout: defensive handling of all wait() errors" but subsequently timeout would run the command correctly but then fail with an error message. * tests/misc/timeout: In a subshell set the CHLD handler to SIG_IGN to ensure the timeout command resets it to SIG_DFL. * NEWS: Mention the fix.