Commit Graph

1255 Commits

Author SHA1 Message Date
Boris Ranto a9f5ef25fb xfstests 223: reinitialize MKFS_OPTIONS
Test case 223 constantly fails because the variable carrying mkfs
options is not being reinitialized.

Test calls function _scratch_mkfs_geom repeatedly in for loop without
cleaning the MKFS_OPTIONS variable. Since _scratch_mkfs_geom only
appends options to the variable, MKFS_OPTIONS looks like this in 5th
iteration:
MKFS_OPTIONS="-bsize=4096-b size=4096 -d su=8192,sw=4-b size=4096 -d
su=16384,sw=4-b size=4096 -d su=32768,sw=4-b size=4096 -d
su=65536,sw=4-b size=4096 -d su=131072,sw=4"

It is also easy to see that _scratch_mkfs_geom does not append leading
space when it appends the variable.

Following patch fixes the issue for me and based on my testing does not
break any other test case:

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
2010-11-17 20:44:57 -06:00
Christoph Hellwig 3766237495 xfstests: add test for renaming over non-empty directories
Per Posix renames over non-empty directories should fail, but hfsplus used to
allow this (and corrupt the filesystem while doing so).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-11-09 14:53:39 +01:00
Christoph Hellwig 77fe563a78 xfstests: add _require_sparse_files
Add a helper to check if the filesystem supports sparse files.  This is
used to guard tests that exercise sparse file functionality and would
take forever on filesystems that have to zero all blocks on extending
truncates.

Unfortunately there's no good way to autodetect this functionality, so
just implement it as a blacklist for now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2010-11-09 14:53:36 +01:00
Christoph Hellwig 3d3893eef9 xfstests: do not call attr/getfattr/setfattr direcly
always use the full path set up in common.attr.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-25 10:17:26 -05:00
Christoph Hellwig d0b69e2ee6 xfstests: remove dead code in test 062
The _linux_attr_calls function is never called, remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-25 10:17:14 -05:00
Alex Elder b88bd861f2 xfstests: use a common _filter_test_dir function
Christoph Hellwig suggested that a function similar to the common
"_filter_scratch" function ought to be created to handle filtering
of the TEST_DIR and TEST_DEV variables.  This patch implements that.

The name "_filter_test" seems like it might suggest it does
something different, so I'm calling this one "_filter_test_dir".
This unfortunately makes the "test" and "scratch" functions have
different naming conventions, but I guess we should be accustomed to
that by now (consider "TEST_DIR" and "SCRATCH_MNT").

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-10-25 10:15:58 -05:00
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