summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2016-03-06tests: avoid false-failure of split/filter.sh on XFSJim Meyering
* tests/split/filter.sh: Use OFF_T_MAX-1 rather than OFF_T_MAX as the size of a test file, to avoid false failure on an XFS file system (or any file system permitting a file of size OFF_T_MAX). Reported as http://bugs.gnu.org/22931
2016-02-23all: be less strict about usage if POSIX 2008Paul Eggert
sort, tail, and uniq now support traditional usage like 'sort +2' and 'tail +10' on systems conforming to POSIX 1003.1-2008 and later. * NEWS: Document this. * doc/coreutils.texi (Standards conformance, tail invocation) (sort invocation, uniq invocation, touch invocation): Document new behavior, or behavior's dependence on POSIX 1003.1-2001. * src/sort.c (struct keyfield.traditional_used): Rename from obsolete_used, since implementations are now allowed to support it. All uses changed. (main): Allow traditional usage if _POSIX2_VERSION is 200809. * src/tail.c (parse_obsolete_option): Distinguish between traditional usage (which POSIX 2008 and later allows) and obsolete (which it still does not). * src/uniq.c (strict_posix2): New function. (main): Allow traditional usage if _POSIX2_VERSION is 200809. * tests/misc/tail.pl: Test for new behavior.
2016-02-15split: adjust recent --number changesPádraig Brady
* src/split.c (lines_rr): Reinstate the conditional setting of the WROTE boolean, as otherwise split -n r/1 would consume all input when all --filter commands are stopped. There was a test in place to check for this, but it was incorrect as detailed below. (input_file_size): Immediately disallow --number with non seekable inputs, as such an invocation is not currently generally supported and will fail as the data overflows the internal buffer. * tests/split/l-chunk.sh: Adjust to again disallow -n /dev/zero. Also change all '&& fail=1' checks to use the 'returns_ 1' form. * tests/split/filter.sh: Change the no longer supported /dev/zero case to a regular $OFF_T_MAX file (supported on XFS for example). Also fix the timeout(1) commands so they're not subject to pipefail issues.
2016-02-12tests: don't wait forever on GNU/HurdPaul Eggert
* tests/cp/parent-perm-race.sh: Add timeouts so that the test does not wait forever on GNU/Hurd. This does not fix the underlying bug but at least lets the tests make progress. Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624 Also, check that 'cp' actually copies the data; this is a better test anyway, and simplifies the test code. Also, avoid unlikely race if 'pid' is set in the environment.
2016-02-12split: fix problems with /dev/zeroPaul Eggert
Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624 Other problems also fixed: basically, the code got confused because GNU/Linux reports that /dev/zero has size zero. * src/split.c (input_file_size): Now takes struct stat *, not just size. Always store the first buffer. All callers changed. Treat /dev/zero as an infinitely-large file, both on GNU/Linux where fstat and lseek say its size is zero, and on GNU/Hurd where they say the size is OFF_T_MAX. (cwrite): Return true on success. (bytes_split): Don't try to read past EOF, and stop if a write fails. (lines_rr): Omit stray check for ignorable errno. (main): Get file size only when n_units > 1, since that's the only time it is needed. Defer most of the work to input_file_size. * tests/split/l-chunk.sh: Adjust tests to match new behavior on oddball inputs.
2016-01-19tests: avoid false failure in tail inotify testPádraig Brady
* tests/tail-2/wait.sh: Restrict inotify specific test portion to local file systems and also not with ---disable-inotify specified. Failure noticed on NFS.
2016-01-19tests: avoid false failure due to remove() ignoring u-w on NFSPádraig Brady
* tests/rm/rm1.sh: Also remove the group write bit which was required on one NFS setup at least. Note u-w was enough to deny file creation, g-w was also required to deny file removal. * tests/rm/cycle.sh: Likewise. * tests/mv/perm-1.sh: Likewise.
2016-01-19tests: avoid false failure in preserve-slink-time.sh on GPFSPádraig Brady
* tests/cp/preserve-slink-time.sh: Add a delay between the ln and the cp so that there is enough difference between the timestamps so GPFS won't discard the update. Reported by Assaf Gordon.
2016-01-19tests: avoid false failure in shred-passes.shPádraig Brady
* tests/misc/shred-passes.sh: Specify an exact amount to shred, to avoid running out of simulated random data on file systems with a large st_blksize like GPFS for example. Reported by Assaf Gordon.
2016-01-18tests: adjust memory limits in head-c.shAssaf Gordon
* tests/misc/head-c.sh: Further increase the limit to 8MB over the base test command. 5.1MB was seen as minimum extra needed on FreeBSD 9.3 x86_64.
2016-01-18tests: adjust delays to avoid false positivesPádraig Brady
* tests/rm/dangling-symlink.sh: The effective delay was only 1.5s. So delay before the operation, and increase the iteration count by 1 to increase the delay to 6.3s. This failure was noticed once on a FreeBSD 10.2 x86_64 virtual machine. * tests/dd/stats.sh: Remove quotes on sleep argument to ensure arguments are accumulated appropriately. * tests/du/move-dir-while-traversing.sh: sleep before operation, to increase the effective delay from 1.6s to 3.2s. * tests/tail-2/flush-initial.sh: Likewise. * tests/tail-2/pipe-f2.sh: Sleep first so that the effective delay matches the commented value.
2016-01-18test: skip test rather than fail with Solaris 10 sedPádraig Brady
* tests/rm/r-root.sh: This test was seen to ERROR due to sed input not having a terminating '\n'. Therefore just skip with diagnostics upon failure to adjust the error output with sed. Reported by Assaf Gordon.
2016-01-16tests: fix false failure with spaces in absolute $PWDPádraig Brady
* tests/install/create-leading.sh: Ensure $PWD is quoted. Reported by `make dist-check`.
2016-01-16tests: show mount list on failure for df testsPádraig Brady
* init.cfg (dump_mount_list_): A new function to output the system mount list. * tests/df/df-symlink.sh: Call dump_mount_list_ upon failure. * tests/df/over-mount-device.sh: Likewise. * tests/df/problematic-chars.sh: Likewise. * tests/df/skip-rootfs.sh: Likewise. * tests/df/total-verify.sh: Likewise. * tests/df/unreadable.sh: Likewise.
2016-01-16tests: avoid false failure with BTRFS subvolumesPádraig Brady
* tests/df/df-symlink.sh: Only check the symmetry of the source <-> target lookup, when the source is only mounted once, which isn't the case if '.' is a BTRFS subvolume for example. Reported by Assaf Gordon on a default OpenSUSE 42.1 install.
2016-01-15tests: remove a non portable localtime testPádraig Brady
* tests/misc/date.pl: This test was dependent on perl unconditionally calling the system localtime() as date(1) does. However perl has its own configure checks in place to avoid buggy localtime implementations. Therefore comment out this test as a FIXME for now. This test was seen to fail on FreeBSD 10 where localtime() returns nonsense values instead of failing for arguments >= 2^56.
2016-01-15tests: adjust memory limits in head-c.shPádraig Brady
* tests/misc/head-c.sh: Further increase the limit, to account for the fact that head(1) needs at least 1.576MB over the base test command on FreeBSD 10. 4MB should be enough headroom while still providing over allocation protection. Reported by Assaf Gordon.
2016-01-15tests: simplify invalid signal determination for kill -lPádraig Brady
* src/operand2sig.c (operand2sig): Add a detailed comment explaining why we validate even very large shell exit status values. * tests/misc/kill.sh: Add a test case for the ksh scheme. Simplify the INVALID signal number determination which also avoids a false failure on systems like FreeBSD 10 with incomplete signal list (caused by inaccurate NSIG).
2016-01-15tests: support older fallocate number formatsPádraig Brady
* tests/cp/fiemap-extents.sh: Support RHEL6 fallocate which doesn't support IEC suffixes like "MiB" on numbers. Also add some extra framework_failure_ protections. Reported by Assaf Gordon.
2016-01-13mv: fix data loss with repeated source dir and same destinationPádraig Brady
commit v8.23-31-g90aa291 failed to consider this case, where the previous rename has failed, thus causing the following to remove the specified directory: mv dir dir dir * src/copy.c (copy_internal): Assume this rename attempt has succeeded, as a previous failure will already have been handled, and we don't want to remove the source directory in this case. * tests/cp/duplicate-sources.sh: Consolidate this test file to... * tests/mv/dup-source.sh: ...here. Add test cases for same source and dest. * tests/local.mk: Remove the consolidated test. * NEWS: Mention the bug fix. Reported at https://bugzilla.redhat.com/1297464
2016-01-13tests: include part of wc-files0.sh skipped by mistakePádraig Brady
* tests/misc/wc-files0.sh: $fail is always set to 0, so correct the test to include that part of the test case.
2016-01-13wc: avoid ambiguous output with '\n' in file namesPádraig Brady
* src/wc.c (write_counts): Shell escape the file name if it contains '\n' so only a single line per file is output. * tests/misc/wc-files0.sh: Add a test case. * NEWS: Mention the improvement.
2016-01-13numfmt: add the -z,--zero-terminated optionAssaf Gordon
* doc/coreutils.texi (numfmt invocation): Reference the description. * src/numfmt.c: Parameterize '\n' references. * tests/misc/numfmt.pl: Add tests for character and field processing. * NEWS: Mention the new feature.
2016-01-13paste: add the -z,--zero-terminated optionPádraig Brady
* doc/coreutils.texi (paste invocation): Reference -z description. * src/paste.c (main): Parameterize the use of '\n'. * tests/misc/paste.pl: Add test cases. * NEWS: Mention the new feature.
2016-01-13comm: support NUL --output-delimiter for consistencyPádraig Brady
* src/comm.c (main): Track the output delimiter length, so that it can be adjusted to 1 for the NUL delimiter. Also rename the global variable from "delimiter" to "col_sep" so its use is more obvious, and to distinguish from the recently added "delim" global variable. * tests/misc/comm.pl: Adjust accordingly.
2016-01-13comm: add the -z,--zero-terminated optionPádraig Brady
* doc/coreutils.texi (comm invocation): Reference option description. * src/comm.c (main): Use readlinebuffer_delim() to support a parameterized delimiter. * tests/misc/comm.pl: Add test cases. * NEWS: Mention the new feature.
2016-01-13tac: support an empty (NUL) --separatorPádraig Brady
* doc/coreutils.texi (tac invocation): Mention the NUL delineation with an empty --separator. * src/tac.c (main): Allow an empty separator when -r not specified. * tests/misc/tac.pl: Add test cases. * NEWS: Mention the new feature. Fixes http://bugs.gnu.org/8103
2016-01-13cut: add the -z,--zero-terminated optionPádraig Brady
* doc/coreutils.texi (cut invocation): Reference the description. * src/cut.c: Parameterize '\n' references. * tests/misc/cut.pl: Add tests for character and field processing. * NEWS: Mention the new feature.
2016-01-13head,tail: add the -z,--zero-terminated optionRichard Russon
* doc/coreutils.texi: Reference the option description. * src/head.c: Parameterize the delimiter character. * src/tail.c: Likewise. * tests/misc/head.pl: Add test case. * tests/misc/tail.pl: Likewise. * NEWS: Mention the new feature.
2016-01-13join,sort,uniq: with -z, treat '\n' as a field separatorPádraig Brady
* NEWS: Mention the change in behavior. * doc/coreutils.texi (newlineFieldSeparator): A new description, referenced from ({join,sort,uniq} invocation). * src/system.h (field_sep): A new inline function to determine if a character is a field separator. * src/join.c (usage): s/whitespace/blank/ to be more accurate wrt which characters are field separators. (xfields): s/isblank/field_sep/. * src/sort.c (inittables): Likewise. * src/uniq.c (find_field): Likewise. * tests/misc/join.pl: Adjust -z test, and add a test/example for processing the whole record with field processing. * tests/misc/sort.pl: Add -z test cases, including case with '\n'. * tests/misc/uniq.pl: Add -z -f test case with \n.
2016-01-10tests: fix races wrt output files of background processesBernhard Voelker
At least the false positive in tail-2/follow-stdin.sh could be seen on a 4-core i5 system with -j8. Fix similar cases. too. * tests/tail-2/follow-stdin.sh: Empty the 'out' file in each iteration. Otherwise, under heavy system load, 'check_tail_output' would see the expected output from the previous round before tail would have the chance to come up in the background. While at it, move the creation of the 'exp' file out of the loop. * tests/dd/stats.sh: Empty the output file of the background process here, too. * tests/misc/cat-buf.sh: Likewise. * tests/misc/stdbuf.sh: Likewise. * tests/tail-2/wait.sh: Likewise.
2016-01-06stty: support [-]drain setting to control waiting for pending TxPádraig Brady
Instead of commit v8.24-132-g5171bef which only provides control to disable this behavior (with -I), provide the symmetrical "[-]drain" special setting. * src/stty.c (main): Parse the [-]drain setting instead of -I, and treat like a global option. (usage): Adjust accordingly. * tests/misc/stty.sh: Test "drain" with and without options. * NEWS: Mention the new feature.
2016-01-04stty: support -I, --immediate to not wait for pending transmissionPádraig Brady
In some cases an initial drain may block indefinitely as discussed at: http://lists.gnu.org/archive/html/coreutils/2016-01/msg00007.html * src/stty.c (main): Use TCSANOW rather than TCSADRAIN if -I specified. (usage): Document the new option. * doc/coreutils.texi (stty invocation): Likewise. * tests/misc/stty.sh: Ensure -I is supported. * NEWS: Mention the new feature.
2016-01-03install: fix relative copies to absolute directory with -DPádraig Brady
* src/install.c (mkancesdirs_safe_wd): Unconditionally restore the current working directory when possibly called multiple times (from install_file_in_dir()). * tests/install/create-leading.sh: Add a test case. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/21497
2016-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2015-12-31dd: summarize in --human-readable format tooPaul Eggert
Problem reported by Linda Walsh in: http://bugs.gnu.org/17505 * NEWS: Document this. * doc/coreutils.texi (dd invocation): Use a simpler script. Adjust output example to match new behavior. * src/dd.c (human_size): Remove. All uses changed to use human_readable and ... (human_opts): ... this new constant. (abbreviation_lacks_prefix): New function. (print_xfer_stats): Use it. Output both --si and --human-readable summaries, but only if they have prefixes. * tests/dd/reblock.sh, tests/dd/stats.sh: Test new behavior.
2015-12-17tests: avoid root test false failure without libxattrPádraig Brady
* tests/cp/cp-mv-enotsup-xattr.sh: Exclude xattr copy verification when libxattr is not available.
2015-12-17tests: avoid intermittent ulimit -v failuresPádraig Brady
* init.cfg (get_min_ulimit_v_): Increase the determined virtual memory limit for the command by a page size to avoid alignment issues causing false failures for subsequent runs. * tests/misc/cut-huge-range.sh: Be defensive and match the cut invocations under test, more closely with the form used to determine the VM memory limit. This was noticed on i686 linux at: http://hydra.nixos.org/build/28990456
2015-12-15maint: include 'env' commands in returns_ syntax checkPádraig Brady
* cfg.mk (sc_prohibit_and_fail_1): Remove 'env' from the exclusion list. * tests/misc/env.sh: Adjust accordingly. * tests/misc/help-version.sh: Likewise.
2015-12-15tests: improve kill testsPádraig Brady
* tests/misc/kill.sh: - verify kill -[lt] support multiple parameters. - verify kill -[lt] fail with (some) invalid parameters. - Use returns_1 ... || fail=1, rather than ... && fail=1.
2015-12-14sort: fix --debug marking for -b -k1.xPádraig Brady
We were erroneously skipping blanks in the marked comparison _after_ the key start offset was applied. * src/sort.c (debug_keys): Don't skip starting blanks if already handled by begfield(). * tests/misc/sort-debug-keys.sh: Add a test case. * NEWS: Mention the bug fix. Fixes http://bugs.gnu.org/22155
2015-12-14kill: add undocumented -L for compatibilityPádraig Brady
procps, bash >= 4.4, and util-linux >= 2.23 all have the -L option to output a table. * src/kill.c (main): Have -L synonymous with -t. Luckily there is no signal that begins with 'L'. * tests/misc/kill.sh: Update the test.
2015-12-14tests: add tests for the kill commandPádraig Brady
* tests/misc/kill.sh: Add first tests for kill. * tests/local.mk: Reference the new test.
2015-12-14maint: fix incorrect spellings etcPádraig Brady
* NEWS: Use a standard version specification. * doc/coreutils.texi: Fix incorrect grammar. * src/df.c: Update a stale comment. * src/copy.c: Fix incorrect spellings. * src/factor.c: Likewise. * src/ls.c: Likewise. * src/pr.c: Likewise. * src/relpath.c: Likewise. * src/shred.c: Likewise. * src/sort.c: Likewise. * src/split.c: Likewise. * src/stdbuf.c: Likewise. * tests/misc/seq-precision.sh: Likewise.
2015-11-25tests: for compare_(), use cmp -s where availablePádraig Brady
* tests/init.sh (compare_): Only fall back to cmp without the POSIX defined -s option, where this is not available.
2015-11-24copy: fix copying of extents beyond the apparent file sizeDmitry Monakhov
fallocate can allocate extents beyond EOF via FALLOC_FL_KEEP_SIZE. Where there is a gap (hole) between the extents, and EOF is within that gap, the final hole wasn't reproduced, resulting in silent data corruption in the copied file (size too small). * src/copy.c (extent_copy): Ensure we don't process extents beyond the apparent file size, since processing and allocating those is not currently supported. * tests/cp/fiemap-extents.sh: Renamed from tests/cp/fiemap-empty.sh and re-enable parts checking the extents at and beyond EOF. * tests/local.mk: Reference the renamed test. * NEWS: Mention the bug fix. Fixes http://bugs.gnu.org/21790
2015-11-23md5sum,sha*sum: ensure --ignore-missing fails when no file verifiedPádraig Brady
* src/md5sum.c (digest_check): Update a matched_checksums bool upon matched checksum, and fail (loudly unless --status is specified) if there were no matches. Also change properly_formatted_lines to a bool while at it since we don't need to track the plurality. * tests/misc/md5sum.pl: Add a test case. Suggested by Jim Meyering.
2015-11-23md5sum,sha*sum: add --ignore-missing for checking a subset of filesLuther Thompson
* doc/coreutils.texi (md5sum invocation): Document the new option. * src/md5sum.c (digest_file): Return an empty digest to indicate a missing file. (digest_check): Don't fail or output status given an empty checksum. (usage): Document the new option. (main): Process and validate the new option. * tests/misc/md5sum.pl: Add new test cases. * NEWS: Mention the new feature. Fixes http://bugs.gnu.org/15604
2015-11-21tests: avoid false failure on older NFS implementationsPádraig Brady
* tests/ls/stat-failed.sh: Skip the test if 'd' is returned as the type, and document where this was seen. Also flag failure to write small temp files during the test as an error rather than a failure. Fixes http://bugs.gnu.org/21130
2015-11-12csplit: check and report fwrite errors with errnoAssaf Gordon
discussed in: http://lists.gnu.org/archive/html/coreutils/2015-10/msg00091.html * src/csplit.c: (save_line_to_file): check fwrite failures, report and exit immediately instead of deferring to 'close_output'. * tests/misc/csplit-io-err.sh: test fwrite failure using LD_PRELOAD. * tests/local.mk: add new test.