summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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.
2009-11-03tests: inotify-race: don't let malfunctioning gdb hang the testJim Meyering
* tests/tail-2/inotify-race: Apply timeout to each gdb invocation.
2009-10-30tests: factor 350 fail=0 initializations into test-lib.shJim Meyering
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
2009-10-30tests: remove the less-regular fail=0 assignments manuallyJim Meyering
* tests/tail-2/assert-2: * tests/tail-2/assert: * tests/cp/file-perm-race: * tests/misc/df: * tests/misc/truncate-dir-fail:
2009-10-29tests: don't let a fail=1 env. setting induce unwarranted test failureJim Meyering
* cfg.mk (sc_fail_is_initialized): New rule. Fix the offenders: * tests/cp/acl: Set fail=0 * tests/cp/backup-is-src: Likewise. * tests/cp/file-perm-race: Likewise. * tests/cp/reflink-auto: Likewise. * tests/cp/same-file: Likewise. * tests/ln/backup-1: Likewise. * tests/misc/su-fail: Likewise. * tests/misc/truncate-owned-by-other: Likewise. * tests/mkdir/p-3: Likewise. * tests/mkdir/selinux: Likewise. * tests/mkdir/special-1: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/touch/now-owned-by-other: Likewise.
2009-10-28nice, nohup, su: detect write failure to stderrEric Blake
These programs can print non-fatal diagnostics to stderr prior to exec'ing a subsidiary program. However, if we thought the situation warranted a diagnostic, we insist that the diagnostic be printed without error, rather than blindly exec, as it may be a security risk. For an example, try 'nice -n -1 nice 2>/dev/full'. Failure to raise priority (by lowering niceness) is not fatal, but failure to inform the user about failure to change priority is dangerous. * src/nice.c (main): Declare failure if writing advisory message to stderr fails. * src/nohup.c (main): Likewise. * src/su.c (main): Likewise. * tests/misc/nice: Test this. * tests/misc/nohup: Likewise. * NEWS: Document this.
2009-10-28echo, printf: interpret \e as the Escape characterPádraig Brady
Match gcc, perl, bash, ksh, tcsh, ... in supporting \e. * src/printf.c (print_escape_char): Output \x1B when \e encountered. * src/echo.c (main): Likewise. * src/stat.c (print_escape_char): Likewise. * doc/coreutils.texi (echo invocation): Add \e to the list. * tests/misc/printf: Verify that \e outputs \x1B. * NEWS: Mention the change in behaviour.
2009-10-28printenv: ignore bogus variable namesEric Blake
Exposed by env a=b=c printenv a=b. * src/printenv.c (main): Silently reject = in names. * tests/misc/printenv: Test for it. * NEWS: Document this.
2009-10-27env, printenv: add -0/--null optionEric Blake
Allows for unambiguous processing when environment values (or even non-portable names!) contain newline. * src/env.c (longopts): Add new option. (usage): Document it. (main): Implement it. * src/printenv.c (longopts): New variable. (usage): Document new option. (main): Implement it. * doc/coreutils.texi (Common options): New macro optNull. (du invocation, env invocation, printenv invocation): Use it. * NEWS: Mention this. * tests/misc/env-null: New test. * tests/Makefile.am (TESTS): Run it.
2009-10-27tests: add printenv coverageEric Blake
* tests/misc/printenv: New test. * tests/Makefile.am (TESTS): Run it. * .gitignore: Ignore more cruft.
2009-10-27tests: fix PATH problems on cygwinEric Blake
* tests/misc/sort-compress: Remove non-portable over-restriction of PATH; besides, commit 3ea177e changed sort to no longer default to gzip. * tests/rm/fail-eperm: Untaint, rather than clear, PATH. * tests/misc/pwd-long: Likewise. Also skip test if long path cannot be created. (normalize_to_cwd_relative): Use eq rather than ==, since cygwin perl doesn't properly handle 64-bit ino_t numerically.
2009-10-26tests: clean up tests of env -- handlingEric Blake
The comment in env.c about -- handling has not matched the behavior in the code since the initial commit back in 1992. * src/env.c: Fix bogus comment. * tests/misc/env: Further tweaks, avoiding PATH problems inherent in testing -i, and testing program name containing =. * doc/coreutils.texi (env invocation): Mention that intermediate program is needed to invoke program with name containing =.
2009-10-26doc: document PATH interactions with envEric Blake
* doc/coreutils.texi (env invocation): Mention that PATH is modified prior to exec. * tests/misc/env: Test this.
2009-10-26env: reject bogus -u argumentsEric Blake
* src/env.c (main): Use unsetenv rather than putenv to remove items from environ, and check for failure. * bootstrap.conf (gnulib_modules): Add unsetenv. * tests/misc/env: Test this. * NEWS: Document it.
2009-10-26tests: avoid file name not portable to cygwinEric Blake
* tests/misc/chroot-fail: Use 'no_such', not '...', since cygwin 1.5 silently strips trailing dots. * tests/misc/nice-fail: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/timeout-parameters: Likewise.
2009-10-26tests: rm/one-file-system: work around umount failureJim Meyering
* tests/rm/one-file-system (cleanup_): Unmount a/b, rather than "$other_partition_tmpdir", to accommodate those who link /etc/mtab to /proc/mounts. Reported by Gilles Espinasse in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18508
2009-10-26tests: adjust new env test not to failJim Meyering
* tests/misc/env: Create ./-i as a link to our "echo" binary, rather than as a bourne shell script, so that env can exec it. Set PATH to ".".
2009-10-26tests: nice: adjust new tests to work more portablyJim Meyering
* tests/misc/nice (tests): Accommodate a nice program for which "nice -n -1 nice" prints nothing. It should print -1 or (usually) 0. Otherwise, we'd get syntax errors.
2009-10-23tests: test recent status changesEric Blake
* tests/misc/nice: Enhance test. * tests/misc/chroot-fail: New test. * tests/misc/env: Likewise. * tests/misc/nice-fail: Likewise. * tests/misc/su-fail: Likewise. * tests/Makefile.am (TESTS): Run new tests.
2009-10-23maint: move chroot testEric Blake
* tests/chroot/credentials: Move... * tests/misc/chroot-credentials: ...here, to reduce number of directories. * tests/Makefile.am (root_tests): Reflect rename.
2009-10-23tests: enhance stdbuf and timeout testsEric Blake
* tests/misc/timeout-parameters: Validate exact exit status. * tests/misc/stdbuf: Likewise. * tests/misc/timeout: Likewise. Use require_built_. * tests/misc/arch: Likewise.