defrag: loosen input file requirements

We don't have perfect control of file allocation for these tests;
in some cases we may fail to adequately fragment a file prior to
defragmentation testing, and today that will fail the test.

Attack this on 2 fronts:

1) Explicitly allow fewer extents on one of the input files in
   generic/018 where the allocator has discretion.
2) _notrun rather than _fail if we don't create enough extents;
   this is a defrag test, not an allocator/fragmentation test,
   so just skip the test if we can't create an acceptable file
   for defrag testing.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Eric Sandeen
2015-12-21 18:01:47 +11:00
committed by Dave Chinner
parent a3d2994caa
commit 84f48144dd
3 changed files with 18 additions and 5 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ for i in `seq 9 -1 0`; do
$XFS_IO_PROG -fs -c "pwrite -b $bsize $((i * bsize)) $bsize" $fragfile \
> /dev/null
done
_defrag --before 10 --after 1 $fragfile
# Accept fewer fragments than we might expect; we don't have perfect control.
_defrag --max_before 10 --min_before 5 --after 1 $fragfile
echo "Write backwards sync leaving holes - defrag should do nothing" | tee -a $seqres.full
for i in `seq 31 -2 0`; do
+1 -1
View File
@@ -9,7 +9,7 @@ Contiguous file:
Before: 1
After: 1
Write backwards sync, but contiguous - should defrag to 1 extent
Before: 10
Before: in_range(5, 10)
After: 1
Write backwards sync leaving holes - defrag should do nothing
Before: 16