Commit Graph

1324 Commits

Author SHA1 Message Date
Alex Elder 580b0a9386 xfstests: use a common _filter_scratch function
There are a number of tests that use a shell function called
"filter_scratch" or "_filter_scratch" in order to have the actual
scratch device or mount point show up in test output with a symbolic
name.  There are two sets, each following a slightly different
convention.  Put a common _filter_scratch function definition in
"common.filter" and have all test scripts use that instead.
Choosing one of the two conventions meant that a few test output
files had to be changed.

In addition, add a call to _filter_scratch to test 185, and update
its output accordingly.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-10-22 09:13:06 -05:00
Christoph Hellwig bd77e7c5bf xfstests: handle filesystems without FIEMAP support
Do a _notrun in 225 if we get EOPNOSUPP back from FIEMAP instead
of failing the test.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-10-21 21:12:04 +02:00
Christoph Hellwig 5411ceb991 xfstests: add _require_attrs
Add a new helper to check if extended attributes are supported.  It
errors out if any of the attr tools are not found, or if a filesystem
does not support setting attributes.

Remove the opencoded checks for the attr tools from various tests
now that we do them in common code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-21 21:11:48 +02:00
Christoph Hellwig f1436346b4 xfstests: fix quota detection
Even if the kernel has quota support built in most filesystems still
don't support it.  As there's no good way to find out if a filesystem
supports quotas hardcode the list of filesystems that do support
quotas.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-21 05:55:58 +02:00
Christoph Hellwig 15e17c9bac xfstests: fix _require_acl
Skip ACL tests if we get EOPNOTUPP back from the acl calls.  This is
the error code we get on a kernel that does support the xattr system
calls, but does not support the attributes used to handle Posix ACLs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-21 05:55:11 +02:00
Alex Elder 506621696a xfstests: randholes: a few final cleanups
Minor bits to wrap up this series.
- Bumped up the number of blocks read at once from 10 to 256
- Shorten remaining long lines
- Re-factor findblock()
- Get rid of global variable "nvalid"
- Add a few more comments
- Give all global symbols static scope
- Update the copyright message
- Various other minor formatting changes.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:37 -05:00
Alex Elder 97d57710d2 xfstests: randholes: encapsulate argument parsing
Move the argument parsing code out of main() and into a separate
parseargs() routine.  The name of the target file for the test
is returned by parseargs() if no error occurs.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:32 -05:00
Alex Elder 61591161e4 xfstests: randholes: clean up readblks()
Make readblks() a bit more readable by computing a few things
into local variables, and pulling out a few of the comma-separated
expressions that were previously in the for loop headers.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:27 -05:00
Alex Elder d2c56a9fb9 xfstests: randholes: encapsulate realtime setup code
Encapsulate the code that sets up the use of files on the realtime
volume.  Using realtime implies direct I/O; move the code that makes
that so into the argument parsing code.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:22 -05:00
Alex Elder 4099869db4 xfstests: randholes: use posix_memalign()
Use posix_memalign() rather than memalign() regardless of whether
direct I/O is to be used.  Don't store the dioattr data in a global
variable.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:17 -05:00
Alex Elder cccbdd0d08 xfstests: randholes: encapsulate direct I/O setup code
Pull the code used to get alignment information for direct I/O into
a separate function.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:11 -05:00
Alex Elder f0d2c5ec91 xfstests: randholes: hide some Irix/Linux differences more tidily
Define a macro "xfscntl()" that effectively hides the differences
between the Linux xfsctl() and Irix fcntl() kernel interfaces.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:07 -05:00
Alex Elder 3bda8549fa xfstests: randholes: rearrange fns and drop their declarations
Rearrange the functions in the file so they no longer need to be
declared at the top.  (This change involves only wholesale moves
of these blocks of code.)

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:05:01 -05:00
Alex Elder 803750d475 xfstests: randholes: document options a bit more
Reformat the usage message and provide a little more
information about default values and units for options
for the "randholes" command.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:04:57 -05:00
Alex Elder b5b95753cc xfstests: randholes: only allocate write buffer when needed
If nothing is being written (i.e., in "test" mode), there's no need
for "randholes" to allocate a write buffer.  But to do this we make
this series of changes:
- When "very" verbose (> 1), there's no point in printing the values
  that have just been written to the file.  They are just the file
  offset, and the buffer will not have changed between initializing
  those values and writing it out.
- If we don't print the values at those offsets, then there's no
  need to fill them in at all when we're in test mode.
- Now we only use the write buffer if we're not in test mode,
  so we can skip the allocation.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:04:52 -05:00
Alex Elder 9cf1fef239 xfstests: randholes: Fix two bugs
This patch fixes two bugs in the "randholes" test program.

First, it is possible for findblock() to return -1 if the random
block number it picks is at or above the highest in-range block
that's already been selected.  But this case isn't checked and
the value is blindly used thereafter as if it were valid.  Just
exit if this ever occurs.

Second, when the "alloconly" option is is set, blocks are
preallocated in the target file rather than actually writing them.
But unlike when the blocks are written and subsequently read, the
preallocated blocks are *not* offset by the fileoffset parameter.

I'm pretty sure nobody every noticed this because the program itself
doesn't do any verification when blocks are only preallocated.  But
it's an inconsistency and I think it ought to be fixed.

Signed-off-by: Alex Elder <aelder@sgi.com>
Acked-by: Dave Chinner <david@fromorbit.com>
2010-10-19 10:04:46 -05:00
Alain Renaud fd612912d3 xfstests: Fix some file permission.
I notice that some of the test script do not have execute
permission. To be consistent I changed the permissions to be 755.
Can someone verify that this is valid.

Thanks.

Signed-off-by: Alain Renaud <arenaud@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-12 14:48:24 -05:00
Arkadiusz Miśkiewicz 06bd0b2f31 Don't depend on mkfs.xfs output in some tests
Tests 136 and 206 rely on mkfs.xfs output.

136 test was currently broken with hardcoded mkfs.xfs output (that
contained for example meta-data=/dev/sda8). Drop that part from
output.

Ignore projid32bit output existence for test 206.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-09 13:29:40 -05:00
Alain Renaud 82faf28da5 xfstests: make 223 use more compatible indirection operator
Hello all,

I notice while running xfstests on SLES machine that the test 223 fail
because of syntax error.

# bash 223
QA output created by 223
223: line 66: syntax error near unexpected token `>'
223: line 66: `    _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE&>>  $seq.full'

The error is due to the use of the '&>>' operator for redirection
that does not work  on older bash version(3.2.x).  Note that this
operator only seem to work with bash version 4.X+

This patch simply replace the operator with '>>  $seq.full 2>&1'
which does the same thing.

Signed-off-by: Alain Renaud <arenaud@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-01 15:58:27 -05:00
Arkadiusz Mi?kiewicz c05368d13e xfstests: test 244 to test quota project id setting overflow
Test 3 quota project setting id conditions:
- set 16bit project quota id -> should succeed
- set 32bit project quota id -> should succeed (with projid32bit
  patch applied; fail otherwise)
- over 32bit project quota id -> should always fail

Updated by <aelder@sgi.com>:
- Shortened some long lines, including failure output

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-10-01 15:57:58 -05:00
Christoph Hellwig 5c67a98f5d xfstests: fix 108 and enable it by default
Apply the prjquota check to the scratch device so that it doesn't fail,
and add the test to the auto and quick groups now that it works.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
2010-10-01 06:04:33 +02:00
Lukas Czerner 5715240aee xfstests: Use $MKFS_OPTIONS in _scratch_mkfs_*()
Pass MKFS_OPTIONS to mkfs.$FSTYP in _scratch_mkfs_sized().
Preserve user defined MKFS_OPTIONS in _scratch_mkfs_geom().

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redaht.com>
2010-09-29 11:23:04 -05:00
Lukas Czerner 095e690221 xfstests 224: Use $SCRATCH_MNT variable
Use $SCRATCH_MNT variable instead of hard-coded path (/mnt/scratch) in
test 224.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2010-09-29 11:21:21 -05:00
Arkadiusz Miśkiewicz 4c622795d0 Fix project quota checks
Project quota check in few tests should check SCRATCH_DEV and not
TEST_DEV. Fix that by making possible to pass device to be checked to
_require_prjquota().

Due to the problem tests didn't run with "Installed kernel does not
support project quotas" error.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-09-11 19:34:47 -03:00
Arkadiusz Miśkiewicz 903b50fad9 Don't hardcode paths to many binaries.
Stop hardcoding paths to getfattr, setfattr, attr, quota, xfs_quota,
killall, indent and xfs_copy binaries.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>

- new
Signed-off-by: Christoph Hellwig <hch@lst.de>
2010-09-11 19:34:47 -03:00