From 7a804b9af4084990a4116964eefb43b2ace4e44a Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Sat, 19 Mar 2011 23:58:49 +0000 Subject: tests: fix the sparse-fiemap test * 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. --- tests/cp/sparse-fiemap | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests/cp/sparse-fiemap') diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap index a2460a086..73448ecfa 100755 --- a/tests/cp/sparse-fiemap +++ b/tests/cp/sparse-fiemap @@ -69,15 +69,14 @@ for i in $(seq 1 2 21); do -e 'for (1..'$j') { sysseek (*F, $n, 1)' \ -e '&& syswrite (*F, chr($_)x$n) or die "$!"}' > j1 || fail=1 - # 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 + # Note there is an implicit sync performed by cp to + # work around bugs in EXT4 and BTRFS before Linux 2.6.38 + # Note also the -s parameter to the filefrag commands below + # for the same reasons. cp --sparse=always j1 j2 || fail=1 - dd if=/dev/null of=j2 conv=notrunc,fdatasync cmp j1 j2 || fail=1 - if ! filefrag -v j1 | grep -F extent >/dev/null; then + if ! filefrag -vs j1 | grep -F extent >/dev/null; then test $skip != 1 && warn_ 'skipping part; you lack filefrag' skip=1 else @@ -98,7 +97,7 @@ for i in $(seq 1 2 21); do # exclude the physical block numbers; they always differ filefrag -v j1 > ff1 || framework_failure - filefrag -v j2 > ff2 || framework_failure + filefrag -vs j2 > ff2 || framework_failure { f ff1; f ff2; } | $PERL $abs_top_srcdir/tests/filefrag-extent-compare || fail=1 fi -- cgit v1.2.3-70-g09d2