diff options
Diffstat (limited to 'tests/cp')
-rwxr-xr-x | tests/cp/fiemap-2 | 3 | ||||
-rwxr-xr-x | tests/cp/fiemap-perf | 2 | ||||
-rwxr-xr-x | tests/cp/sparse-fiemap | 12 |
3 files changed, 12 insertions, 5 deletions
diff --git a/tests/cp/fiemap-2 b/tests/cp/fiemap-2 index a17076cc2..691ead255 100755 --- a/tests/cp/fiemap-2 +++ b/tests/cp/fiemap-2 @@ -20,7 +20,8 @@ print_ver_ cp # Require a fiemap-enabled FS. -fiemap_capable_ . \ +touch fiemap_chk # check a file rather than current dir for best coverage +fiemap_capable_ fiemap_chk \ || skip_ "this file system lacks FIEMAP support" # Exercise the code that handles a file ending in a hole. diff --git a/tests/cp/fiemap-perf b/tests/cp/fiemap-perf index 7369a7d1b..dbb2a817a 100755 --- a/tests/cp/fiemap-perf +++ b/tests/cp/fiemap-perf @@ -20,6 +20,8 @@ print_ver_ cp # Require a fiemap-enabled FS. +# Note we don't check a file here as that could enable +# the test on ext3 where emulated extent scanning can be slow. fiemap_capable_ . \ || skip_ "this file system lacks FIEMAP support" diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap index f224b5be0..fc27869e8 100755 --- a/tests/cp/sparse-fiemap +++ b/tests/cp/sparse-fiemap @@ -19,6 +19,8 @@ . "${srcdir=.}/init.sh"; path_prepend_ ../src print_ver_ cp +# Note we don't check a file here as that could enable +# the test on ext3 where this test is seen to fail. if fiemap_capable_ . ; then : # Current dir is on a partition with working extents. Good! else @@ -66,11 +68,13 @@ for i in $(seq 1 2 21); do $PERL -e 'BEGIN { $n = '$i' * 1024; *F = *STDOUT }' \ -e 'for (1..'$j') { sysseek (*F, $n, 1)' \ -e '&& syswrite (*F, chr($_)x$n) or die "$!"}' > j1 || fail=1 - # sync + + # Note the explicit fdatasync is used here as + # it was seen that `filefrag -s` (FIEMAP_FLAG_SYNC) was + # ineffective on ext4 loopback on Linux 2.6.35.10-72.fc14.i686 + dd if=/dev/null of=j1 conv=notrunc,fdatasync cp --sparse=always j1 j2 || fail=1 - # sync - # Technically we may need the 'sync' uses above, but - # uncommenting them makes this test take much longer. + dd if=/dev/null of=j2 conv=notrunc,fdatasync cmp j1 j2 || fail=1 filefrag -v j1 | grep extent \ |