summaryrefslogtreecommitdiff
path: root/tests/cp
AgeCommit message (Collapse)Author
2011-06-17tests: remove skip_test_ function; use new skip_ insteadJim Meyering
* tests/init.cfg (skip_test_): Remove function. Use skip_ in place of skip_test_ everywhere else. * cfg.mk (sc_prohibit_skip_): Remove rule. * tests/**: Use skip_, not skip_test_, everywhere.
2011-05-14tests: refactor more tests to use mkfifo_or_skip_Pádraig Brady
* tests/cp/existing-perm-race: s/mkfifo/mkfifo_or_skip_/ * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/special-f: Likewise. * tests/dd/reblock: Likewise. * tests/ls/file-type: Likewise. * tests/misc/cat-buf: Likewise. * tests/misc/mknod: Likewise. * tests/misc/printf-surprise: Likewise. * tests/misc/selinux: Likewise. * tests/misc/sort-spinlock-abuse: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/tac-continue: Likewise. * tests/init.cfg: Improve the error message when skipping.
2011-05-13tests: use skip_test_, not skip_Jim Meyering
skip_test_ emits its diagnostic both to FD 9 (tty), and to FD 2 (usually the log file), whereas init.sh's skip_ emits only to FD 9. Without that, the log is slightly less useful. * tests/cp/fiemap-2: Use skip_test_, not skip_. * tests/cp/fiemap-perf: Likewise. * tests/du/bigtime: Likewise. * tests/du/files0-from-dir: Likewise. * tests/du/move-dir-while-traversing: Likewise. * tests/init.sh: Likewise. * tests/misc/sort-stale-thread-mem: Likewise. * tests/misc/stat-nanoseconds: Likewise. * tests/mv/i-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/split/filter: Likewise. Prompted by a report from Pádraig Brady.
2011-04-22tests: sparse-fiemap: adjust syntax to accommodate older awkAlan Curry
* tests/cp/sparse-fiemap: Parenthesize ternary expression used as an argument to awk's printf. Otherwise, gawk 3.0.1 and the one from debian stable's original-awk would get a syntax error. Reported by Dennis Clarke. Copyright note: tiny change
2011-04-21tests: sparse-fiemap: with root/ext3, do not create an ext4 FSJim Meyering
* tests/cp/sparse-fiemap: When this test was run as root on an ext3 file system, (ext3 had known problems), it would trickily create and mount a loopback ext4 file system and use that instead. However, due to a bug in 2.6.39-rc1..rc3, this loopback test (when run in another loopback FS) exposed a bug with 1k-blocksize ext4 whereby non-NUL data would be read from a hole. For details, see this: http://thread.gmane.org/gmane.comp.file-systems.ext4/24495
2011-04-21tests: sparse-fiemap: report more detail upon failure; ignore an FPJim Meyering
* tests/cp/sparse-fiemap: Fail right away with details, when cmp fails. When extent maps are found to differ, display them and merely warn.
2011-04-20copy: do not treat unwritten extents specially: avoid XFS/ext4 data lossJim Meyering
* src/copy.c (extent_copy): Do not treat "unwritten extents" specially. Otherwise, with a release-candidate 2.6.39-rc3 kernel, XFS or ext4, when using gold as your linker, and if you forget to run "make check", you could end up installing files full of zeros instead of the expected binaries. For a lot of discussion, see http://thread.gmane.org/gmane.comp.file-systems.xfs.general/37895 * tests/cp/fiemap-empty: Disable this test.
2011-04-20tests: remove spurious syntax from a perl snippetJim Meyering
* tests/cp/sparse-fiemap: Remove spurious BEGIN {...} block.
2011-04-13tests: fix a false positive fiemap test on some file systemsPádraig Brady
* tests/filefrag-extent-compare: Don't check the length of the last extent, as this was seen to vary on XFS, where it leaves trailing blocks allocated for performance reasons. * tests/cp/fiemap-empty: Though not seen as an issue in practise, try to avoid possible issues with the allocator in file systems, by requesting to allocate a power of 2.
2011-04-12maint: correct kernel version in test commentPádraig Brady
2011-04-04tests: avoid spurious parallel failure due to temporary disk fullJim Meyering
Running the new fiemap-empty test uses 600MB of disk space via fallocate, and in so doing caused failure in unrelated tests that were running in parallel on a small file system. Rather than simply running fallocate (which allocates the space, inducing disk full when it fails), skip the test if there is less than 800MB of free space, as computed via stat and awk. * tests/init.cfg (require_file_system_bytes_free_): New function. * tests/cp/fiemap-empty: Use it.
2011-04-04tests: preserve-gid: don't chown temporary PATH dir to a nameless UIDJim Meyering
* tests/cp/preserve-gid: Simply chmod a+rx instead. That is safer, in case the nameless UID actually has an account, and might take advantage of root running a program in a directory under its control
2011-04-04tests: preserve-gid: remove useless use of "env"Jim Meyering
* tests/cp/preserve-gid: Remove useless use of "env".
2011-04-02maint: fix a comment typoJim Meyering
* tests/cp/fiemap-empty: Correct typo in comment. Add "FIXME".
2011-04-01copy: process empty extents more efficientlyPádraig Brady
* src/copy.c (extent_copy): Treat an allocated but empty extent much like a hole. I.E. don't read data we know is going to be NUL. Also we convert the empty extent to a hole only when SPARSE_ALWAYS so that the source and dest have the same allocation. This will be improved soon, when we use fallocate() to do the allocation. * tests/cp/fiemap-empty: A new test for efficiency and correctness of copying empty extents. * tests/Makefile.am: Reference the new test. * NEWS: Mention the change in behavior.
2011-04-01copy: link rather than copy symlinks, when --link usedPádraig Brady
This bug was introduced in commit ca9e212c, 2009-09-24, "cp, mv: use linkat to guarantee semantics", which inadvertently disabled the creation of hardlinks to symlinks. However rather than implementing the intention of that commit and relying on gnulib linkat emulation, we'll revert to the previous emulation as that maintains ownership and timestamps. * src/copy.c (copy_internal): Use our existing hardlink to symlink emulation when link() might dereference the symlink. Also ensure that we copy the timestamps of the original symlink when we use the emulation. * tests/cp/link-symlink: Add a test to ensure timestamps copied. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix. Reported by Ruediger Meier
2011-03-31copy: with fiemap copy, only sync when neededPádraig Brady
* src/extent-scan.h (struct extent_scan): Add the fm_flags member to pass to the fiemap scan. * src/extent-scan.c (extent_need_sync): A new function used to detect Linux kernels before 2.6.38. (extent_scan_init): Add FIEMAP_FLAG_SYNC when needed. * tests/cp/sparse-fiemap: Adjust comment. * NEWS: Mention the change in behavior. Indirectly suggested by Mike Frysinger
2011-03-21tests: fix a bug in the cp/preserve-gid testJim Meyering
* tests/cp/preserve-gid: Ensure that every process under test uses the cp binary we've just built. Before this fix, with a restrictive umask or build-dir permissions, the UID-changing tests would end up using whatever cp happened to be available through $PATH Analysis by arbogast.cedric@gmail.com in http://debbugs.gnu.org/8292.
2011-03-19tests: fix the sparse-fiemap testPádraig Brady
* tests/filefrag-extent-compare: Merge adjacent extents in each list before processing, so we correctly account for split extents in either list. * tests/cp/sparse-fiemap: Remove the explicit syncing, which was only changing the way extents were arranged, and thus working around the extent comparison issue that was seen on ext4 loop back.
2011-02-25tests: without filefrag, only skip part of sparse-fiemapPádraig Brady
* tests/cp/sparse-fiemap: Move the PERL check to the top, since we don't test anything without it. In the loop, don't use skip_test_ as it exits the test completely.
2011-02-18tests: correct racy sparse-to-pipe testGilles Espinasse
* tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete before comparing the results.
2011-02-15tests: support more file systems in the cp fiemap testsPádraig Brady
* tests/cp/sparse-fiemap: Check for fiemap support against a file rather than a directory to enable tests on BTRFS for example. Explicity disable the test on ext3 or file systems where we can't determine the type. * tests/cp/fiemap-perf: Likewise. Also disable the test on older BTRFS (like in Fedora 14), where extents are returned for holes. * tests/init.cfg: Comment that BTRFS only supports fiemap for regular files.
2011-02-08test: improve the cp fiemap testsPádraig Brady
* tests/cp/fiemap-2: Enable the fiemap check for files, which will enable the test for files on ext3. * tests/cp/fiemap-perf: Comment why we're not enabling for ext3. * tests/cp/sparse-fiemap: Ditto. Also sync the files before doing a fiemap which was needed for ext4 loop back at least. Add a comment that FIEMAP_FLAG_SYNC is ineffective, thus requiring the explicit syncs. * tests/fiemap-capable: A new python script to determine if a specified path supports fiemap. * tests/init.cfg (fiemap_capable_): Use the new python script. * tests/Makefile.am (EXTRA_DIST): Include the new python script.
2011-02-02tests: correct part of fiemap-perfJim Meyering
* tests/cp/fiemap-perf: Correct erroneous added test. Since nonexistent names were used, the final test ended up being "test =", which would always "succeed".
2011-01-31tests: exercise a rarely-used corner of copy.cJim Meyering
* tests/cp/sparse-to-pipe: New test. * tests/Makefile.am (TESTS): Add it.
2011-01-31tests: factor fiemap-related predicate into init.cfgJim Meyering
* tests/init.cfg (fiemap_capable_): New function. * tests/cp/fiemap-perf: Use it. * tests/cp/sparse-fiemap: Likewise. * tests/cp/fiemap-2: Likewise.
2011-01-31maint: update copyright year lists in new filesJim Meyering
* src/extent-scan.h: Update copyright year list. * src/extent-scan.c: Likewise. * tests/cp/sparse-fiemap: Likewise.
2011-01-31tests: modernize sparse-fiemap testJim Meyering
* tests/cp/sparse-fiemap: Use print_ver_, not open-coded VERBOSE test.
2011-01-31tests: remove duplicate fiemap-perf testJim Meyering
* tests/cp/fiemap-perf: Copy block-comparing code from sparse-fiemap. * tests/cp/sparse-fiemap: The same test was here, alongside a much more involved test. Remove it, now that it is in its own file.
2011-01-30tests: cp/fiemap: exercise previously-failing partsJim Meyering
* tests/cp/fiemap-2: New test. * tests/Makefile.am (TESTS): Add it.
2011-01-30tests: ensure that FIEMAP-enabled cp copies a sparse file efficientlyJim Meyering
* tests/cp/fiemap-perf: New file. * tests/Makefile.am (TESTS): Add it.
2011-01-30tests: accommodate varying filefrag -v "flags" outputJim Meyering
* tests/cp/sparse-fiemap: Accommodate values other than "eof" in the "flags" column of filefrag -v output
2011-01-30tests: exercise more of the new FIEMAP copying codeJim Meyering
* tests/cp/sparse-fiemap: Ensure that a file with many extents (more than fit in copy.c's internal buffer) is copied properly. Don't require root access if current partition is btrfs or xfs. Use init.sh, not test-lib.sh. * tests/filefrag-extent-compare: New file.
2011-01-30tests: add a new test for FIEMAP-copyJie Liu
* tests/cp/sparse-fiemap: Add a new test for FIEMAP-copy against a loopbacked ext4 partition. * tests/Makefile.am (sparse-fiemap): Reference the new test.
2011-01-28tests: remove obsolete uses of "$$" in temporary file namesJim Meyering
Those were useful when tests might have been run in the same directory and in parallel. Now, each test is run in a newly- created empty directory. * tests/cp/backup-1: Remove obsolete uses of "$$". * tests/cp/same-file: Likewise. * tests/dd/misc: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/to-symlink: Likewise. * tests/touch/fail-diag: Likewise.
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-12-28coreutils: keep lines within 80-column limitsPaul Eggert
* cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros. (sc_long_lines): New rule. * HACKING: Use shorter URLs to the same material. * doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4: * man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c: * src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c: * src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c: * src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c: * src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm: * tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid: * tests/du/2g, tests/du/long-from-unreadable, tests/init.sh: * tests/install/basic-1, tests/ls/nameless-uid: * tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials: * tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum: * tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort: * tests/misc/sort-continue, tests/misc/sort-files0-from: * tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr: * tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail: * tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests: * tests/rm/fail-2eperm, tests/rm/interactive-always: Reformat to fit within 80 columns. * doc/Makefile.am (BAD_POSIX_PERL): New macro. * doc/coreutils.texi: Reword slightly, to make menus and index lines shorter. * src/md5sum.c: Redo --help output so that it fits within 79 columns, since that's a bit more portable and all the other --help strings fit in 79 columns.
2010-12-19cp: ensure backups are created when -T specifiedPádraig Brady
* src/cp.c (do_copy): When -T is specified, initialize the NEW_DST and SB variables, which are checked when running: cp -T --force --backup file file * tests/cp/backup-1: Add the -T case
2010-12-03tests: cleanup rm -rf fails under NFSPaul Eggert
This problem was observed on RHEL 5.5 x86-64 when running as a client of a NetApp FAS2050. * tests/cp/cp-mv-backup: Don't leave a file descriptor open to a file in a directory that will be cleaned up with "rm -rf". Under NFS, when the rm unlinks that file, it is instead renamed to .nfsXXXX and then rm cannot remove the parent directory, and the test fails. * tests/cp/same-file: Likewise.
2010-11-17tests: convert the multi-prog $VERBOSE/--version usesJim Meyering
E.g., -test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; } +print_ver_ pwd readlink -test "$VERBOSE" = yes && { stdbuf --version; mv --version; } +print_ver_ stdbuf mv Use this command: git grep -l 'VERBOSE.*--version'|xargs perl -ni \ -e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \ -e 's/env -- //g;' \ -e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \ -e ' s/(\w+) --version;/$1/g; s/ *}$//; print'
2010-11-17tests: substitute the single-program $VERBOSE/--version usesJim Meyering
Automatically make all of the changes like this: -test "$VERBOSE" = yes && chgrp --version +print_ver_ chgrp git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/'
2010-11-17tests: convert remaining uses of test-lib.sh to init.shJim Meyering
RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src' git grep -l test-lib.sh \ | xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS",
2010-11-17tests: convert 'if test "$VERBOSE" = yes; then' to test ... &&Jim Meyering
2010-11-17tests: convert first batch of tests from test-lib.sh to init.shJim Meyering
Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
2010-10-27cp: make --attributes-only override --reflink completelyPádraig Brady
* doc/coreutils.texi (cp invocation): Change the description slightly so as users might not immediately discount using this option. Mention that --reflink is overridden by the other linking options and --attributes-only, and give an example where this might be useful. * src/copy.c (copy_internal): Bypass the reflink if --attributes-only is specifed. * tests/cp/reflink-perm: Ensure both --reflink modes are overridden by --attributes-only. * NEWS: Mention the change in behavior. Reported by Jim Meyering.
2010-09-07tests: exclude some tests when running on NFSPádraig Brady
All tests currently pass on NFS on Linux kernel 2.6.22 at least, but some fail on 2.6.9, so we exclude those here. * tests/init.cfg (is_local_dir_): A new function returning if the specified directory is on a local file system. (require_local_dir_): A new function to skip tests if the current directory is not on a local file system. * tests/cp/existing-perm-race: Skip if non local. * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/preserve-2: Likewise. * tests/mv/part-symlink: Likewise. * tests/du/basic: Use refactored function. * tests/install/basic-1: Likewise. * tests/mkdir/p-3: Likewise. * tests/dd/skip-seek-past-dev: Likewise. * tests/du/slink: Likewise. Remove redundant test for NFS file system. * tests/misc/join: s/local/locale/.
2010-07-01cp: add an option to only copy the file attributesPádraig Brady
* src/copy.c (copy_attr): A new function which merges copy_attr_by_fd and copy_attr_by_name. Also display all errors when --attributes-only * src/copy.c (copy_reg): Skip copying the file contents if specified. Refactor the SELinux error handling code a little and display all SELinux errors when only copying attributes. * src/copy.h (struct cp_options): Add a data_copy_required boolean * src/cp.c (main): Default to copying data but don't if specified * src/install.c: Default to copying data * src/mv.c: Likewise tests/cp/reflink-perm: Add a test to check that --attributes-only does not copy data * tests/cp/acl: Likewise. Also refactor to remove redundant acl manipulation * doc/coreutils.texi (cp invocation): Describe the new option * NEWS: Mention the new feature
2010-05-21tests: fix cp-a-selinux to skip cleanly upon mkfs failureJim Meyering
* tests/cp/cp-a-selinux: Initialize skip, to avoid a syntax error in subsequent "test". Remove redirect-to-/dev/null, now that output is always to a log file.
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-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.