summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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.
2009-12-08tests: fix stty-row-col failure on small fixed terminalsPádraig Brady
* tests/misc/stty-row-col: Linux virtual consoles at least, issue an error if you try to increase their size, so skip the test if we can't increase the dimensions of the tty by 1 cell. Reported by Matthew Burgess.
2009-12-08tests: fix stty failure with serial control settingsPádraig Brady
* tests/misc/stty: Don't check the serial control settings as these are ignored by various Linux kernels. Reported by Matthew Burgess.
2009-12-06tests: readdir-mountpoint-inode avoid false-positive w/virtualboxJim Meyering
* tests/ls/readdir-mountpoint-inode: With some systems, stat can succeed on a mount point and report that the inode number is 0. Since ls displays "?" for those, that would otherwise show up as a difference. Skip such mount points. Reported by Sergei Steshenko in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19142
2009-12-06tests: don't run tail-2/inotify-race by defaultPádraig Brady
* tests/tail-2/inotify-race: Note the caveats of the test. I.E. the intermittent skips and the gdb hang reported by Alan Curry. Add extra info to the log on why the test is skipped as it may be due to multiple reasons. Mark the test as very expensive so that it's not normally run.
2009-12-03tests: fix a bug in sanitize_path_ that inhibited verbose outputJim Meyering
* tests/test-lib.sh (sanitize_path_): Use "set -- ...", not "set - ...", since the latter turns off the -x setting we rely on for VERBOSE=yes output.
2009-12-01rm: fix empty-name bug introduced with conversion to use ftsJim Meyering
While "rm ''" would properly fail, "rm F1 '' F2" would fail to remove F1 and F2, due to the empty string argument. This bug was introduced on 2009-07-12, via commit 4f73ecaf, "rm: rewrite to use fts". * gnulib: Update to latest, for fixed fts.c. * NEWS (Bug fixes): Describe it. * tests/rm/empty-name: Adjust for changed diagnostic. (mk_file): Define, copied from misc/ls-misc. (empty-name-2): New test, for today's fix. * lib/xfts.c (xfts_open): Reflect the change in fts_open, now that it no longer fails immediately when one argument is the empty string. Assert that the bit flags were not the cause of failure. * po/POTFILES.in: Remove xfts.c. * THANKS: Update. Reported by Ladislav Hagara.
2009-11-23tests: avoid test failures when PATH contains an unsearchable directoryJim Meyering
* tests/test-lib.sh (sanitize_path_): New function. Always call it.
2009-11-22tests: do not fail on read-only root file systemDmitry V. Levin
* tests/touch/not-owner: Handle the case when the root file system is mounted read-only. Reported by Solar Designer.
2009-11-20maint: correct comments in test scriptsJim Meyering
* tests/misc/pwd-long: Fix spelling of cygwin1.dll in comment. * tests/rm/fail-eperm: Likewise. Reported by Eric Blake.
2009-11-19tests: avoid spurious failures due to insecure directory in PATHJim Meyering
These tests perform no PATH search, and used to simply delete PATH from the environment. However, that is not portable, as seen on Cygwin, where cygwin.dll must be resolvable via PATH when starting a sub-shell. With commit 0cc04241, we took the alternate approach of untainting the incoming $ENV{PATH}, but that fails when it contains an other-writable directory. Instead, now we hard code it to '/bin:/usr/bin'. * tests/misc/pwd-long: Hard code $ENV{PATH} to a safe value. * tests/rm/fail-eperm: Likewise. Reported by Gilles Espinasse, Andreas Schwab, and Bauke Jan Douma.
2009-11-16tail -F can fail to track a file after it's been rotatedJim Meyering
Tailing forever and by-name (--follow=name, -F), tail would sometimes fail to follow a file that had been removed via rename. If you can't apply this patch and have tail 7.6 or newer, you can work around the bug via the undocumented --disable-inotify option. * src/tail.c (tail_forever_inotify): When tailing by name (-F), do not un-watch a file upon receipt of the IN_MOVE_SELF event. Reported by Arjan Opmeer in http://bugs.debian.org/548439. * NEWS (Bug fixes): Mention it. Also see http://marc.info/?l=coreutils-bug&m=125829031916515 * tests/Makefile.am (TESTS): Add tail-2/inotify-rotate. * tests/tail-2/inotify-rotate: New test.
2009-11-14tests: help-version: exit nonzero when $built_programs is emptyJim Meyering
* tests/misc/help-version: Use "Exit 1", rather than "Exit $fail" with fail defined to 0 when $built_programs is empty.
2009-11-14tests: avoid a spurious failure on a loaded systemPádraig Brady
* tests/misc/timeout-parameters: This test could fail due to the 1-second timeout expiring before a command of "no_such" could be exec'd and fail. Increase to 10 seconds.
2009-11-13tests: avoid a spurious timeout on a heavily-loaded systemJim Meyering
* tests/misc/timeout-parameters: This test would fail due to the 1-second timeout expiring before a command of "." could be exec'd and fail. Increase to 10 seconds.
2009-11-09ls: fix capability coloringPádraig Brady
Capability checking was incorrectly done on just the base name rather than on the whole path. Consequently there could be both false positives and negatives when coloring files with capabilities. Also capability checking was not done at all in certain cases for non executable files. Note passing absolute rather than relative names to cap_get_file() reduces the has_capability() overhead from around 33% to 30%. I.E. ls --color is now around 3% faster. * src/ls.c (struct fileinfo): Add a has_capability member. (print_color_indicator): Refactor to pass just a fileinfo pointer and a flag to say if we're dealing with a symlink target. (print_name_with_quoting): Likewise. (gobble_file): Set has_capability in the fileinfo struct. Also do a capability check even if executable coloring is disabled. Ditto for SETUID and SETUID coloring. Comment on how expensive has_capability() is. (print_long_format): Adjust to refactored print_name_with_quoting. (quote_name): Likewise. (print_file_name_and_frills): Likewise. * tests/ls/capability: Test the various false positive and negatives. * THANKS: Add reporter (Ivan Labath). * NEWS: Mention the fix.
2009-11-07mktemp: fix bug with -q and closed stdoutEric Blake
If stdin or stdout is closed, then freopen(,stderr) can violate the premise that STDERR_FILENO==fileno(stderr), which in turn breaks mktemp -q. * bootstrap.conf (gnulib_modules): Add freopen-safer. * src/mktemp.c (includes): Use stdio--.h. * tests/misc/close-stdout: Enhance test to catch bug.
2009-11-06nproc: A new program to count the available processorsGiuseppe Scrivano
* AUTHORS: Add my name. * NEWS: Mention it. * README: Likewise. * bootstrap.conf (gnulib_modules): Add nproc. * doc/coreutils.texi (nproc invocation): Add nproc info. * man/Makefile.am (nproc.1): Add dependency. * man/nproc.x: New template. * man/.gitignore: Ignore generated man page. * po/POTFILES.in: Add src/nproc.c. * src/.gitignore: Exclude nproc. * src/Makefile.am (EXTRA_PROGRAMS): Add nproc. * src/nproc.c: New file. * tests/Makefile.am (TESTS): Add misc/nproc-{avail,positive}. * tests/misc/nproc-avail: New file. * tests/misc/nproc-positive: New file.
2009-11-05mktemp: enhance test to catch just-fixed typo behaviorEric Blake
Penance for botching the conflict resolution while rebasing my series. * tests/misc/mktemp (check_tmp): Test for the bug when wrong parameter is used.
2009-11-05mktemp: add suffix handlingEric Blake
Now that mkstemps is supported, we might as well use it. * src/mktemp.c (TMPDIR_OPTION): New enum value. (longopts): Add new option. (usage): Document it. (count_trailing_X_s): Rename... (count_consecutive_X_s): ...to this, and add parameter. (mkstemp_len, mkdtemp_len): Add parameter. (main): Implement new option. (AUTHORS): Add myself. * AUTHORS (mktemp): Likewise. * tests/misc/mktemp: Test new option. * doc/coreutils.texi (mktemp invocation): Document it. * NEWS: Likewise. Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548316.
2009-11-05tests: enhance mktemp testEric Blake
* tests/misc/mktemp: Add more coverage.
2009-11-05mktemp: don't leave file behind on write failureEric Blake
* src/mktemp.c (main): Remove just-created file if stdout had problems. * bootstrap.conf (gnulib_modules): Add remove. * tests/misc/close-stdout: Test it. * NEWS: Document it.
2009-11-03tests: rm: add test for today's change in behaviorJim Meyering
* tests/Makefile.am (root_tests): Add rm/read-only to the list. * tests/rm/read-only: New file.