summaryrefslogtreecommitdiff
path: root/tests/cp/sparse-fiemap
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-02-04 22:05:20 +0000
committerPádraig Brady <P@draigBrady.com>2011-02-08 22:46:25 +0000
commit5c3fd50a751a93acf5ad7bb69d01261267a53a1e (patch)
tree4bfb77b4702a9068f774a9cb9fa9b64e4deec4a3 /tests/cp/sparse-fiemap
parent480c0dc9e7c1890b11797c0e7704bd0e2e9821b7 (diff)
downloadcoreutils-5c3fd50a751a93acf5ad7bb69d01261267a53a1e.tar.xz
test: improve the cp fiemap tests
* 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.
Diffstat (limited to 'tests/cp/sparse-fiemap')
-rwxr-xr-xtests/cp/sparse-fiemap12
1 files changed, 8 insertions, 4 deletions
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 \