Commit Graph

9 Commits

Author SHA1 Message Date
Allison Henderson ced9681ea4 xfstests: Correct extent flag parsing for punch hole tests
The fiemap filters used in the punch hole tests parse the extent
flags in the fiemap to determine the extent type.  They are
currently parsing them as decimal values, but they should be parsing
hex values.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2011-07-20 18:22:05 -05:00
Allison Henderson 75d2f82138 add generic hole punch test 255
This patch adds a new test 255 that tests fallocate punch hole,
but is for use by generic filesystems.  It is similar to 252,
but uses a weaker fiemap filter that only displays the location
of the hole, and not the extent types.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-07-13 14:31:45 +02:00
Allison Henderson ec0d982bdc make 252 xfs only, add md5 checksums to hole punch tests
This patch modifies test 252 to run for only xfs, and also
adds an md5 checksum to each of the punch hole tests

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-07-13 14:31:43 +02:00
Allison Henderson 0c95fadc35 expand 252 with more corner case tests
This patch adds additional punch hole tests to 252
that were used to test ext4 punch hole. The _test_generic_punch
routine has been modified to accept two new flags:

-k To keep the test file between tests.
   This will test the handling of existing holes

-d To not sync the file between tests.
   This will test the handling of delayed extents

Four new corner cases have also been added to the routine:
14. data -> hole @ EOF
15. data -> hole @ 0
16. data -> cache cold ->hole
17. data -> hole in single block file

Signed-off-by: Allison Henderson <achender@us.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-06-17 14:14:57 +02:00
Alex Elder 9935bd9855 xfstests: coalesce contiguous extents in extent map output
The specific set of extent sizes allocated to a file is not always
deterministic.  In particular, sometimes a range of unwritten blocks
is covered by a single extent, while in other cases it might be
represented by multiple consecutive unwritten extents.  This can
result in spurious errors being reported in tests that check file
extent maps.

Add a filter that finds adjacent extents in what gets produced for
fiemap and bmap output and coalesces them as if all consective
extents of the same time were really just one extent.  (Note that
as implemented here this applies to all extent types, not just
unwritten extents.)

Update the golden output for test 242 to reflect the change.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2011-04-29 16:20:22 -05:00
Josef Bacik b16ef33889 xfstests 252: add test for fallocate with hole punching
Move the major test meat of 242 into common.punch, and reuse it for
a new testcase the exercises the new fallocate implementation

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-04-20 17:34:36 +02:00
Dave Chinner 771e69de67 xfstests: Convert all tests to use /bin/bash
While most tests use /bin/sh, they are dependent on /bin/sh being a
bash shell.  Convert all the tests to execute via /bin/bash as it is
much, much simpler than trying to debug and remove all the bashisms
throughout the test code.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
2010-01-20 10:27:08 +11:00
Felix Blyakher 491d467f3c Add GPL license plate to SGI's files.
Signed-off-by: Felix Blyakher <felixb@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
2009-06-05 15:41:14 -05:00
David Disseldorp 2ef519a6fb new common.punch file for exercising various hole punch functions,
_test_punch the main test function follows the procedure:
	- mkfs & mount scratch
	- optionally set files extent size hint
	- truncate and optionally resvsp
	- write or punch to file in specified order at given offsets & lengths
	- display the file state (bmap) after each operation

All sizes, offsets and lengths are specified in FS blocks.
Problems may arise on non bash shells due to array usage.
Merge of master-melb:xfs-cmds:29434a by kenmcd.
2007-08-17 16:09:29 +00:00