xfstests-dev.git
11 years agoxfstests: 275, Don't remove all the files in SCRATCH_MNT.
Tao Ma [Fri, 14 Sep 2012 11:03:12 +0000 (19:03 +0800)]
xfstests: 275, Don't remove all the files in SCRATCH_MNT.

After the volume is mkfsed, it should have no other files that
need to be rmed. And what's more, it makes ext4 complain since
lost+found is also removed.

So remove this useless "rm -rf $SCRATCH_MNT/*".

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfstests: fix TEST_MNT typos (should be TEST_DIR)
Brian Foster [Mon, 17 Sep 2012 15:15:35 +0000 (11:15 -0400)]
xfstests: fix TEST_MNT typos (should be TEST_DIR)

We mistakenly use TEST_MNT in tests 222 and 253, which is undefined.
Replace these two instances with TEST_DIR.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfstests: Make test 272 work for ext3
Jan Kara [Thu, 16 Aug 2012 09:14:35 +0000 (11:14 +0200)]
xfstests: Make test 272 work for ext3

ext3 does not support direct IO for files with data journalling. This
confuses test 272. Make the test check whether open succeeds and perform
the writing only if it does.

Thanks for Dave Chinner for suggesting a simpler way to fix the test.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev
Ben Myers [Thu, 13 Sep 2012 20:01:58 +0000 (15:01 -0500)]
Merge branch 'master' of git://git./fs/xfs/xfstests-dev

Conflicts:
285
285.out
group

Moved '285: Test xfs projid32bit functionality a bit more extensively' to 287.

11 years ago285: Test xfs projid32bit functionality a bit more extensively
Eric Sandeen [Wed, 12 Sep 2012 18:53:27 +0000 (13:53 -0500)]
285: Test xfs projid32bit functionality a bit more extensively

The test covers several areas including enabling projid32bit
functionality dynamically by xfs_admin, dumping, restoring, quota
reporting and xfs_db projid values reporting.

This test case hits a bug with xfsdump/xfsrestore process on a
projid32bit enabled filesystem.

Eric Sandeen: change {16,32}less filenames to {16,32}bit, add quick group

Signed-off-by: Boris Ranto <ranto.boris@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years ago275: Fix to test and pass properly
Eric Sandeen [Tue, 11 Sep 2012 01:46:10 +0000 (20:46 -0500)]
275: Fix to test and pass properly

This is a significant rework of 275, which made too many
assumptions about details of space usage and failed on several
filesystems (it passed on xfs, but only by accident).

This new version tries to leave about 256k free, then tries
a single 1M IO, and fails only if 0 bytes are written.

It also sends a lot more to $seq.full for debugging on failure,
doesn't rm -rf $SCRATC_MNT, and fixes a few other stylistic things.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
11 years agoxfstests: Use installed libraries only
Rich Johnston [Tue, 28 Aug 2012 17:26:08 +0000 (17:26 +0000)]
xfstests: Use installed libraries only

The xfstests autotools currently searches locally in
   ../{acl,attr,dmapi,xfsprogs}
for libraries that xfstests depends upon, in addition to searching for them in
their regular installed locations on a system, e.g. /usr/lib.  It appears this
feature was added (but not documented) so that xfs developers can build and run
xfstests without having to install the libraries.  This can lead to trouble if
you expect that xfstests is using the versions of the libraries installed on
the system.

If a local library was found and not installed, libtool will create a wrapper
script to call the binary from the .libs directory.  This patch will remove
searching for local libraries so that the installed libraries are always used.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myer <bpm@sgi.com>
11 years agoxfstests: Use libtool to install applications
Rich Johnston [Tue, 28 Aug 2012 17:26:07 +0000 (17:26 +0000)]
xfstests: Use libtool to install applications

This patch replaces the INSTALL macro with LTINSTALL so that libtool is used
to install the applications.  Libtool will install the binary from the proper
location and display a warning if any shared library dependancies are not
properly installed.  This ensures that a libtool wrapper shell script is not
installed in place of application when libtool wrappers are being used.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myer <bpm@sgi.com>
11 years agoxfstests: speed up 227 by using preallocation
Dave Chinner [Thu, 26 Jul 2012 08:35:06 +0000 (08:35 +0000)]
xfstests: speed up 227 by using preallocation

Test 227 (fsr test) creates fragmented fre space by doing lots of
small writes to sparse offsets ni a file. This seeks the disk heads
around a lot writing data. We don't need to write data - just
trigger allocation. Hence use preallocation instead of data writes
and run at allocation speed rather than data write speed.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: _check_quota_usage needs to unmount to get XFS quotacheck
Dave Chinner [Thu, 26 Jul 2012 08:35:05 +0000 (08:35 +0000)]
xfstests: _check_quota_usage needs to unmount to get XFS quotacheck

Remount won't run a quota check - it's only done during mount. Hence
all quota tests using this check function are not actually
validating XFS filesystems right now.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: loop devices vs umount stupidity
Dave Chinner [Thu, 26 Jul 2012 08:35:04 +0000 (08:35 +0000)]
xfstests: loop devices vs umount stupidity

Unmounting a fileystem mounted on a loop device doesn't always tear
down the loop device. Its racy, and it causes tests to randomly
fail.

To avoid that, we have to use umount -d to ensure that we destroy
loop devices under filesystems in case the kernel doesn't tear it
down automatically to prevent the test from failing.  However, if
the kernel does tear it down automatically, umount now issues a
warning that it couldn't tear down the loop device because it
couldn't find it, and that causes the test to fail. *facepalm*

So, convert all the loop device unmounts to use -d, and direct the
output of all of them to /dev/null.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: test 110 sometimes fails to unmount scratch dev
Dave Chinner [Thu, 26 Jul 2012 08:35:03 +0000 (08:35 +0000)]
xfstests: test 110 sometimes fails to unmount scratch dev

It runs a bunch of rm processes in the background, then immediately
calls _check_scratch_fs without waiting for them to complete, hence
the unmount can fail with a busy filesystem error.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev
Ben Myers [Wed, 8 Aug 2012 18:42:46 +0000 (13:42 -0500)]
Merge branch 'master' of git://git./fs/xfs/xfstests-dev

11 years agocommon.attr: get block size of test fs not root fs
Eryu Guan [Wed, 4 Jul 2012 03:11:10 +0000 (22:11 -0500)]
common.attr: get block size of test fs not root fs

stat -f $TEST_DEV shows block size of the fs where $TEST_DEV
resides, usually it is the root fs. This will fail 020 on non-4096 block
size ext2/3/4, also 4096 block size ext2/3/4 on ppc64.

Instead, stat -f $TEST_DIR will show block size of the fs to be tested.

Tested and passed on ext2/3/4, xfs, btrfs with all supported block size.

Cc: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years agocommon.dump: filter out latest xfsdump version messages
Brian Foster [Mon, 18 Jun 2012 16:48:00 +0000 (11:48 -0500)]
common.dump: filter out latest xfsdump version messages

The latest version of xfsdump/restore (3.1.0) causes dump tests
to complain. Fix up the filter to include a wider selection of
version numbers.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years ago016: Do not discard blocks at mkfs time
Boris Ranto [Wed, 30 May 2012 22:39:29 +0000 (17:39 -0500)]
016: Do not discard blocks at mkfs time

The test 016 fills scratch device with some data and then creates xfs fs
on the scratch device. Later, the test assumes that the previously
written data are still written there and checks for them at specific
locations. On ssd drive this will lead to a failure since the blocks are
discarded by default when the mkfs command is run.
This is a more verbose version of the previous patch.
This simple patch that adds -K to stop the discarding (if the mkfs
command supports it) fixed the issue for me:

Signed-off-by: Boris Ranto <branto@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years ago030: fix for new xfs_repair versions
Mark Tinguely [Wed, 23 May 2012 17:21:28 +0000 (12:21 -0500)]
030: fix for new xfs_repair versions

Given that we now drop invalid unlinked inode lists there is no message
to capture.  Also add a sed expression to avoid failures on old repair
versions.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years ago273: fix failure due to lack of inodes
Jan Kara [Thu, 17 May 2012 21:33:23 +0000 (16:33 -0500)]
273: fix failure due to lack of inodes

Test 273 fails for me due to lack of inodes (ext? filesystem is not configured
to have enough inodes for being filled up by 4k files). So change the test
to create larger files so that we don't hit this limit.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years ago274: Many fixups
Eric Sandeen [Tue, 15 May 2012 20:20:05 +0000 (15:20 -0500)]
274: Many fixups

This changes quite a few things about 274 to make it more robust
and useful.

* More comments
* Use xfs_io for falloc (not all systems have /usr/bin/fallocate)
* use _require_xfs_io_falloc to be sure system & fs support preallocation
* Do not remove all of the files in $SCRATCH_MNT/ post-mkfs
* Do not remove all of the files in $SCRATCH_MNT/ on completion
  (this breaks e2fsck when lost+found/ goes missing)
* Don't cd into $SCRATCH_MNT
* Try harder to completely fill the fs
* Use a larger preallocated space, and write into all of it (hopefully
  avoid just accidentally succeeding by writing into fs reserved
  space that may be there)
* Save more output in $seq.full instead of /dev/null
* Fill preallocated space diabolically

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Jan Kara <jack@suse.cz>
11 years ago273: fix of reading scratch size and removing lost+found
Tom Marek [Tue, 15 May 2012 15:48:47 +0000 (10:48 -0500)]
273: fix of reading scratch size and removing lost+found

There were two reasons why test 273 was failing. Firstrly, when running on
ext4 fs it was removing everything from SCRATCH_MNT directory at the beginning
of tests including the lost+found directory. This caused error while checking
scratch fs after finishing test. Secondly, obtaining of the partition size was
not counting with with behaviour of df utility which may split the line containg
informations about one partition when it is too long thus it may have returned
nothing.

First problem was solved with removing all unnecessary rm -rf commands and the
second one was fixed with alternative awk script which is able to deal with
any line splitting possible. Also 'umount $SCRATCH_DEV' was substituted for
'_scratch_unmount'.

Cc: sandeen@sandeen.net
Signed-off-by: Tom Marek <tmarek@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years agoREADME: add 'make install' to building steps
Tom Marek [Tue, 15 May 2012 15:48:43 +0000 (10:48 -0500)]
README: add 'make install' to building steps

There was no mention of 'make install' step in the README file.
Run make install added to section 'Building Linux'.

Signed-off-by: Tom Marek <tmarek@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
11 years agoxfstests: introduce 286 for SEEK_DATA/SEEK_HOLE copy test
Jeff Liu [Sun, 19 Feb 2012 14:51:43 +0000 (22:51 +0800)]
xfstests: introduce 286 for SEEK_DATA/SEEK_HOLE copy test

Introduce 286 for SEEK_DATA/SEEK_HOLE copy tests.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfstests: introduce 285 for SEEK_DATA/SEEK_HOLE sanity test
Jeff Liu [Sun, 19 Feb 2012 14:44:15 +0000 (22:44 +0800)]
xfstests: introduce 285 for SEEK_DATA/SEEK_HOLE sanity test

Introduce 285 for SEEK_DATA/SEEK_HOLE sanity tests.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
12 years agoadd btrfs online defragment test
Liu Bo [Tue, 14 Feb 2012 10:50:24 +0000 (18:50 +0800)]
add btrfs online defragment test

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add tests 281-283 for old xfsdump format
Bill Kendall [Wed, 28 Mar 2012 20:09:40 +0000 (15:09 -0500)]
xfstests: add tests 281-283 for old xfsdump format

Add three tests for verifying compatibility with xfsdump format 2.

Test 281 generates a format 2 dump and restores it.

Test 282 does a restore of a level 0 dump in the old dump format
followed by a restore of a level 1 dump in the current dump format.

Test 283 does a restore of a level 0 dump in the current dump format
followed by a restore of a level 1 dump in the old dump format.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago071: make this test work as expected on Linux
Peng Haitao [Thu, 15 Mar 2012 02:25:46 +0000 (10:25 +0800)]
071: make this test work as expected on Linux

When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
the error message should be "Invalid argument".

In 32_bit, offset + length should cause pread and pwrite to error, So the
out should be OK.

The patch fix as following:
  - "pwrite64: Invalid argument" will be replaced with "pwrite64: File too large"
  - "pread64: Invalid argument" will be replaced with "read 0/xxx bytes at offset <OFFSET>"
  - delete _filter_xfs_io
  - add auto group
  - add 071.out.32

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago020: make this xattr test generic
Eric Sandeen [Fri, 27 Jan 2012 18:34:31 +0000 (12:34 -0600)]
020: make this xattr test generic

020 can be made generic by limiting the total attribute space
used in the tests as appropriate.  Unless we know we have a
large-xattr-capable fs, limit total space to a bit under one
fs block.

Now passes for me on ext3, ext4, btrfs, as well as xfs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoadd freeze and dangerous groups
Eric Sandeen [Fri, 2 Mar 2012 16:56:17 +0000 (10:56 -0600)]
add freeze and dangerous groups

Add 2 new test groups:

freeze: tests which test filesystem freeze
dangerous: tests which may hang or oops

The 2nd may be useful for automated testing to do i.e.

./check -g auto -x dangerous
./check -g auto,dangerous

to try to get fuller coverage before running into tests
which may panic or hang the box and stop the test cycle.

I doubt I have all the potential dangerous tests, but
they can be added later when found.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago251: make fstrim call a bit more random
Lukas Czerner [Thu, 1 Mar 2012 08:15:16 +0000 (09:15 +0100)]
251: make fstrim call a bit more random

To cover cases when fstrim arguments are not block/block group/file
system size aligned, we can be a bit more random. This commit changes
fstrim argument computing to use $RANDOM bash variable in order to have
different minlen, start, len argument settings and change the full fs
fstrim to be called randomly as well.

Also make kill and wait not complain about non existent process, since
it may have already finished before we attempt to kill it and wait for
it. No reason to fail the test.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago050: update inode softlimit output
Ben Myers [Wed, 22 Feb 2012 18:27:14 +0000 (12:27 -0600)]
050: update inode softlimit output

With Mitsuo Hayasaka's kernel patch "xfs: change available ranges of softlimit
and hardlimit in quota check", xfs quota behavior is slightly different.

This needs to be reflected in test 050.  The new behavior is that we only start
the timer when we're above soft inode quota, and we don't start the timer when
we're at or below.

Signed-off-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago218: support btrfs
Liu Bo [Mon, 6 Feb 2012 08:27:48 +0000 (16:27 +0800)]
218: support btrfs

Btrfs progs has a defragment tool, so we can test 218 on btrfs now.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago251: fix cp -axT problem
Liu Bo [Mon, 6 Feb 2012 08:27:47 +0000 (16:27 +0800)]
251: fix cp -axT problem

When I ran xfstests, 251 got failed cause I use a symlink and
"cp -axT" did not work as wish:
cp: cannot overwrite directory `/mnt/scratch/1' with non-directory

With this patch, 251 has passed.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agofsx: fix msync parameters
Curt Wohlgemuth [Tue, 7 Feb 2012 19:16:06 +0000 (11:16 -0800)]
fsx: fix msync parameters

This explicitly sends MS_SYNC as the flag to msync() in
fsx.c, in domapwrite().  Without this flag, the memory
written to the mmap'ed region will not be flushed to disk;
in fact, on Linux, calling msync() with a '0' or MS_ASYNC
flag is a no-op.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago235: do smaller test IO
Eric Sandeen [Thu, 29 Mar 2012 03:26:29 +0000 (22:26 -0500)]
235: do smaller test IO

Test 235 fails on ext2/ext3 with 1024 fs block size because a
16k write uses an extra metadata block.  If we do a smaller write
this won't happen.

Reported by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
12 years agoclean up scsi_debug module handling
Eric Sandeen [Fri, 9 Mar 2012 17:36:54 +0000 (11:36 -0600)]
clean up scsi_debug module handling

2 little fixes to common scsi_debug handling.

* don't consider the scsi_debug module in use in
  _require, unless it can't be rmmod'd
* don't try to rmmod it in _put unless it is currently
  loaded

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
12 years ago280: test freeze deadlock w/ quotas
Eric Sandeen [Thu, 8 Mar 2012 23:33:16 +0000 (17:33 -0600)]
280: test freeze deadlock w/ quotas

This tests the quota+freeze hang scenario described & fixed in
dcdbed85 quota: Fix deadlock with suspend and quotas

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
12 years ago279: test mkfs with various sector sizes & alignments
Eric Sandeen [Thu, 8 Mar 2012 23:29:40 +0000 (17:29 -0600)]
279: test mkfs with various sector sizes & alignments

This test uses the scsi_debug module to test mkfs against
various physical & logical sector sizes, and with aligned
and unaligned devices.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
12 years agobefore test execution, print test number to syslog
Stefan Behrens [Thu, 8 Mar 2012 22:27:16 +0000 (16:27 -0600)]
before test execution, print test number to syslog

When the xfstests are executed in a batch (like "check 001-299")
and produce syslog output, it is helpful to know which test was
causing the output. Therefore each time a test is started, a
syslog message is generated that contains the number of the
xfstest.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
12 years ago113: add testing for O_DIRECT + O_SYNC
Jeff Moyer [Fri, 2 Mar 2012 20:17:07 +0000 (14:17 -0600)]
113: add testing for O_DIRECT + O_SYNC

This patch adds a couple more aio-stress runs to test 113.  The first
simply adds -S, to test out AIO+DIO+O_SYNC.  The second adds -S and -o
2, which directs aio-stress to only perform the random write test.
These two tests helped identify several bugs in ext4.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
12 years ago256: use more specific grep for file size
Eric Sandeen [Fri, 17 Feb 2012 20:43:12 +0000 (14:43 -0600)]
256: use more specific grep for file size

Removing the "-F" flag in xfs_io changed stat output.

Before the change when -F was used, whether or not the file
was on xfs, it skipped the extra FSGEOM call.  Now that -F is
removed, it calls FSGEOM if the file is on an xfs fs.  The "size"
grep in test 256 was a bit too loose and matched 2 lines if the
FSGEOM output was present, breaking the test.

A more specific grep for stat.size fixes this.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
12 years ago068: run fsstress in read/write mode
Eric Sandeen [Wed, 8 Feb 2012 18:30:07 +0000 (12:30 -0600)]
068: run fsstress in read/write mode

Jan Kara was testing filesystem freeze, and was consistently locking
up, although my tests of 068 were passing.  He pointed out that
he was running in read/write mode, and it was atime updates causing
the trouble.  Sure enough, dropping "-w" from fsstress locked me up
too.  Change this so we get better (and more realistic) coverage.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
cc: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
12 years agofsstress: make sync a write op
Eric Sandeen [Mon, 6 Feb 2012 06:00:52 +0000 (00:00 -0600)]
fsstress: make sync a write op

I was running 068 to test freeze changes, and realized that
"sync" is not in the op list when "-w" (write ops) is specified,
although fsync & fdatasync are.  It seems to me that sync should
be a default write op as well.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
12 years ago271: use xfs_io to truncate file instead of truncate(1)
Eryu Guan [Fri, 27 Jan 2012 19:15:30 +0000 (13:15 -0600)]
271: use xfs_io to truncate file instead of truncate(1)

Distros(eg. RHEL5) with older version of coreutils have no truncate(1)
command. Use xfs_io instead to avoid "command not found" failures.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
12 years ago278: Ensure lost+found is not created with wrong link count
Eric Sandeen [Fri, 27 Jan 2012 19:05:07 +0000 (13:05 -0600)]
278: Ensure lost+found is not created with wrong link count

xfs_repair was leaving lost+found directory with a wrong link count when a
cleaned inode was re-used to create lost+found. This test case confirm that,
after xfs_repair is executed, the lost+found inode is left in a consistent
state.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
12 years ago062: Sort recursive getfattr output
Eric Sandeen [Fri, 27 Jan 2012 18:28:20 +0000 (12:28 -0600)]
062: Sort recursive getfattr output

Test 062 was made "generic" a while back, but it fails on any filesystem
which returns getfattr -R results (aka readdir results) in something
other than inode-order.

With a little awk-fu we can sort the records from getfattr -R so that
the output is the same for xfs as well as ext4, etc.

Also filter out lost+found which extN creates at mkfs time, but
some other filesystems do not.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: mount all filesystem typess with selinux context when needed
Eric Sandeen [Fri, 27 Jan 2012 18:26:26 +0000 (12:26 -0600)]
xfstests: mount all filesystem typess with selinux context when needed

For some reason, non-xfs filesystems weren't getting mounted with
the selinux context; perhaps because none of the xattr tests used
to work on anything but xfs?

Anyway, 062 fails for extN unless we mount with the fs-wide
context.

So export SELINUX_MOUNT_OPTIONS for all filesystems.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
12 years ago277: new test to verify on disk ctime update for chattr
Li Zefan [Thu, 22 Dec 2011 03:55:03 +0000 (11:55 +0800)]
277: new test to verify on disk ctime update for chattr

We had a bug in btrfs which can be triggered by this test.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agouse btrfsck to check btrfs filesystems
Miao Xie [Wed, 14 Dec 2011 07:35:20 +0000 (15:35 +0800)]
use btrfsck to check btrfs filesystems

We failed to get fsck program to check the btrfs file system, it is
because btrfs uses its independent check tool which is named btrfsck
to check the file system, so the common checker -- fsck -- could not
find it, and reported there is no checker.

This patch fix it by using btrfsck directly.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago068: run on more filesystems
Masayoshi MIZUMA [Wed, 14 Dec 2011 02:22:10 +0000 (11:22 +0900)]
068: run on more filesystems

update 068 to run other filesystems, ext3, ext4 and btrfs because
xfs_freeze works on the filesystems.

Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago276: fix up various issues
Jan Schmidt [Wed, 4 Jan 2012 17:54:46 +0000 (18:54 +0100)]
276: fix up various issues

This commit fixes bd8ee45c. Changes:
- added a _require_btrfs helper function
- check for filefrag with _require_command
- always use _fail in case of errors
- added some comments
- removed $fresh code
- don't set FSTYP

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: 276: new test to ensure btrfs backref integrity
Jan Schmidt [Wed, 7 Dec 2011 13:33:53 +0000 (14:33 +0100)]
xfstests: 276: new test to ensure btrfs backref integrity

This is a btrfs specific scratch test checking the backref walker. It
creates a file system with compressed and uncompressed data extents, picks
files randomly and uses filefrag to get their extents. It then asks the
btrfs utility (inspect-internal) to do the backref resolving from fs-logical
address (the one filefrag calls "physical") back to the inode number and
file-logical offset, verifying the result.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: ln failure output has changed again
Dave Chinner [Tue, 6 Dec 2011 11:16:59 +0000 (22:16 +1100)]
xfstests: ln failure output has changed again

Recent coreutils packages have changed the failure output of ln(1)
(again!) to be more verbose, breaking the filter in test 103:

-ln: creating symbolic link `SCRATCH_MNT/nosymlink/target' to `SCRATCH_MNT/nosymlink/source': Operation not permitted
+ln: failed to create symbolic link `SCRATCH_MNT/nosymlink/target' to `SCRATCH_MNT/nosymlink/source': Operation not permitted

Fix it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: test 110 sometimes fails to unmount scratch dev
Dave Chinner [Tue, 6 Dec 2011 11:16:58 +0000 (22:16 +1100)]
xfstests: test 110 sometimes fails to unmount scratch dev

It runs a bunch of rm processes inteh background, tehn immediately
calls _check_scratch_fs without waiting for them to complete, hence
the unmount can fail with abusy filesystem error.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: check if qa user can execute commands
Jan Schmidt [Tue, 6 Dec 2011 09:56:29 +0000 (10:56 +0100)]
xfstests: check if qa user can execute commands

_require_user only checks if the qa user exists in /etc/passwd. It may exist
though still not be able to execute anything (e.g. with a /bin/false shell).

_user_do cannot determine failure to execute the given command, as it uses
_user_do_filter for post-processing which succeeds even if the command
fails. Thus, the check should be performed by _require_user.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstest: change test output to specify 4TB not 2TB
Alain Renaud [Sat, 26 Nov 2011 14:15:25 +0000 (09:15 -0500)]
xfstest: change test output to specify 4TB not 2TB

 This is a simple modification to the test 259. The script test 4TB
 Filesystem but state that it is testing 2TB filesystem. This
 modification simply change the the output message.

Signed-off-by: Alain Renaud <arenaud@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add aiodio helper functions
Hidetoshi Seto [Wed, 23 Nov 2011 02:39:08 +0000 (11:39 +0900)]
xfstests: add aiodio helper functions

For 198, 239 and 240, use _require_aiodio to fail gracefully if
required program was not built.

For 207-212, use _run_aiodio that includes _require_aiodio and
kicks specified aio-dio program, to make code expressly simple.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago254: avoid output mismatch due to space cache
Li Zefan [Tue, 22 Nov 2011 05:19:39 +0000 (13:19 +0800)]
254: avoid output mismatch due to space cache

This reverts commit a0c92a5871082c0aa6a7caae496e67a6e57bb0b6 (disable
space cache), as option nospace_cache was newly introduced in linux-3.2,
so we'll fail to mount btrfs in older kernels.

As an alternative fix, we just list subvolme names, don't assume
what ID numbers those subvolumes will have.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago254: disable space cache
Li Zefan [Fri, 18 Nov 2011 08:43:47 +0000 (16:43 +0800)]
254: disable space cache

I can't pass 254, and below is the output:

254 3s ... - output mismatch (see 254.out.bad)
...
 ID 256 top level 5 path snap
-ID 257 top level 5 path subvol
+ID 258 top level 5 path subvol

When space cache is enabled (and now mkfs.btrfs always enables it),
there will be some space cache inodes in the root tree, and they
consume some IDs, and that's why "subvol" has the ID 258 but not 257.

Just disable space cache for this test case.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago254: fix to pass subvolid=0 to set default btrfs subvolme
Li Zefan [Fri, 18 Nov 2011 03:26:18 +0000 (11:26 +0800)]
254: fix to pass subvolid=0 to set default btrfs subvolme

The usage is 'btrfs subvolume set-default <id> <path>', not
'<path> <path>'.

The code happens to work because strotoull(path) returns 0, but it
will fail if in the future we check the argument more strict in
btrfs-progs.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: detect gdbm library correctly
Dave Chinner [Tue, 15 Nov 2011 20:56:37 +0000 (07:56 +1100)]
xfstests: detect gdbm library correctly

Debian unstable has move the location of the gdbm libraries as part
of it's multi-arch conversion. The libraries are now only found by
the configured library search path in /etc/ld.conf.d, so change the
autoconf macros to test and find the libraries by link tests rather
than hard coding library paths when a header is found.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago275: add a write and reserve test
WuBo [Tue, 8 Nov 2011 03:41:45 +0000 (11:41 +0800)]
275: add a write and reserve test

This test is for write-posix test. If writing a file when the disk is almost
full, the posix wants the call to write as much as possible but not none.

quote the POSIX:
If a write() requests that more bytes be written than there is room for
(for example, [XSI] [Option Start] the process' file size limit or
[Option End] the physical end of a medium), only as many bytes as there
is room for shall be written. For example, suppose there is space for 20
bytes more in a file before reaching a limit. A write of 512 bytes will
return 20. The next write of a non-zero number of bytes would give a
failure return (except as noted below).

Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago274: add a prealloc and reserve test
WuBo [Tue, 8 Nov 2011 03:41:08 +0000 (11:41 +0800)]
274: add a prealloc and reserve test

This test is for preallocation test. If the disk is full, just with a prealloc
file has some free space that prealloc early. We need to check whether the write
to the free space is success or not.

Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago083 make variable filesize as size in bytes
Eryu Guan [Fri, 4 Nov 2011 02:38:03 +0000 (10:38 +0800)]
083 make variable filesize as size in bytes

The first argument of _scratch_mkfs_sized() should be file system size
in bytes, so '100m' is not a valid number, and the 'expr' expression in
_scratch_mkfs_sized() complains 'non-numeric argument' about it.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago205: fix logging
Dave Chinner [Thu, 10 Nov 2011 00:08:18 +0000 (11:08 +1100)]
205: fix logging

Make the logging of operations in test 205 to the 205.full file work
correctly. This prevents the overwrite of mkfs status, and leaves
the 205.full file around for later analysis even on successful test
runs.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago273: add a copy and reserve test
WuBo [Tue, 8 Nov 2011 03:40:38 +0000 (11:40 +0800)]
273: add a copy and reserve test

This test is a stress test. It creates a set of threads for coping small files
into disk. I use a 2G disk for test, the ENOSPC arises usually but the disk is
not full under kenerl 3.0 with intel64.

Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago022: ignore fsstress file count
Bill Kendall [Mon, 7 Nov 2011 21:03:52 +0000 (15:03 -0600)]
022: ignore fsstress file count

The recently added fsstress operations result in a different
number of directories and files being created for xfsdump test
022, which causes the test to fail since the expected xfsrestore
output records these numbers. Filter out the numbers to prevent
this from breaking in the future.

Also increase the number of fsstress operations used to populate
the filesystem so that we get roughly the same number of
directories and files as we used to for this test.

Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoadd 059 and 060 to test multi-stream xfsdump
Bill Kendall [Mon, 7 Nov 2011 17:22:16 +0000 (11:22 -0600)]
add 059 and 060 to test multi-stream xfsdump

Implement the multi-stream placeholder tests 059 and 060. The comments
imply that these tests existed on IRIX, but I was unable to find them.

Test 059 does a simple 4-way dump and restore. Test 060 does a 4-way
dump, then restores each dump file individually (in a cumulative
fashion).

The tests are skipped if the installed xfsdump does not support
multi-stream output.

Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agofix permissions on non-executable tests
Bill Kendall [Mon, 7 Nov 2011 17:50:53 +0000 (11:50 -0600)]
fix permissions on non-executable tests

Tests that are not executable are made executable when they are
run, causing git to report them as modified. Fix this by
changing non-executable tests to have permissions of 0755.

Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoremove duplicate umount $scratch_dev in various tests
Dmitry Monakhov [Tue, 8 Nov 2011 08:41:55 +0000 (12:41 +0400)]
remove duplicate umount $scratch_dev in various tests

_require_scratch unmounts the SCRATCH_DEV. So it is not necessery
to do it explicitly at the first time.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago260: fix dd arguments
Dmitry Monakhov [Tue, 8 Nov 2011 08:41:54 +0000 (12:41 +0400)]
260: fix dd arguments

dd should not have count argument because it suposed to work untill ENOSPC.
Also it is reasonable to log dd's output, do that for both 269'th and 270'th
tests

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agofsstress: fix argument typo
Dmitry Monakhov [Tue, 8 Nov 2011 08:41:53 +0000 (12:41 +0400)]
fsstress: fix argument typo

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago270: check for setcap availability
Dmitry Monakhov [Thu, 10 Nov 2011 11:15:06 +0000 (11:15 +0000)]
270: check for setcap availability

It wants to grant CAP_CHOWN to fsstress, without this capability
chown(2) will fail due to EPERM. Since chown(2) is one of the most
error prone places of quota accounting this makes 270'th
test almost useless, so it is better to simply skip it.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstress: Test data journaling flag switch for a single file
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:53 +0000 (21:55 +0400)]
xfstress: Test data journaling flag switch for a single file

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstress: add regression testcase for d583fb87a3ff0
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:52 +0000 (21:55 +0400)]
xfstress: add regression testcase for d583fb87a3ff0

Should be fixed by following patch http://patchwork.ozlabs.org/patch/120883/

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add a new quota test that runs fsstress under ENOSPC conditions
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:51 +0000 (21:55 +0400)]
xfstests: add a new quota test that runs fsstress under ENOSPC conditions

- Same as 264 but with quota enabled.
- IO performed from $qa_user user
- fsstress granted with CAP_CHOWN capability.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add a new test that runs fsstress under ENOSPC conditions
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:50 +0000 (21:55 +0400)]
xfstests: add a new test that runs fsstress under ENOSPC conditions

During stress testing we want to cover as much code paths as possible
fsstress is very good for this purpose. But it has expandable nature
(disk usage almost continually grow). So once it goes in no ENOSPC
condition it will be where till the end. But by running 'dd' writers
in parallel we can regularly trigger ENOSPC but only for a limited
periods of time because each time it opens the same file with O_TRUNC.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add fiemap operation to fsstress
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:49 +0000 (21:55 +0400)]
xfstests: add fiemap operation to fsstress

Related bug: http://patchwork.ozlabs.org/patch/118863

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:48 +0000 (21:55 +0400)]
xfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2

Add two new operations:
- getattr: ioctl(fd, FS_IOC_GETFLAGS, &fl)
- setattr: ioctl(fd, FS_IOC_SETFLAGS, &random_flags)
Attribute mask may be passed via -M opt, by default is (~0).
By default FS_IOC_SETFLAGS has zero probability because
it may produce inodes with APPEND or IMMUTABLE flags which
are not deletable by default. Let's assumes that one who
enable it knows how to delete such inodes.
For example like follows:
find $TEST_PATH -exec chattr -i -a {} \;
rm -rf $TEST_PATH

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add fallocate support to fsstress
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:47 +0000 (21:55 +0400)]
xfstests: add fallocate support to fsstress

Add tests for fallocate(2) syscall
- fallocate: reserve the disk space
- punch: de-allocates the disk space
Since FALLOC_FL_PUNCH_HOLE is relatively new it's value defined
explicitly if not yet defined. Later we may clear that define.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: freeze fsstress options for 117'th
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:46 +0000 (21:55 +0400)]
xfstests: freeze fsstress options for 117'th

This is regression tescase for explicit combination of seed+fs_opts.
Let's hardcode all options to prevent interactions with fsstress
changes in future.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: fsstress add command line style output for show_opts
Dmitry Monakhov [Thu, 3 Nov 2011 17:55:45 +0000 (21:55 +0400)]
xfstests: fsstress add command line style output for show_opts

Once some combination of seed+fs_ops result in regression it is
reasonable to document that combination. It is usefull to dump
that configuration in command line style. Later this line may be
simply hardcoded in to regression test.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: refactor dump test argument parsing
Bill Kendall [Tue, 1 Nov 2011 19:53:07 +0000 (14:53 -0500)]
xfstests: refactor dump test argument parsing

The dump and restore helper functions all call the same _parse_args()
function. xfsdump and xfsrestore have some common options, but others
have different meanings/syntaxes or only exist in one program or the
other. Split _parse_args() into dump and restore variants.

Further, a test cannot pass most options to xfsrestore because many of
the parsed args are not used by the restore helper functions.  Change
the helpers so that the parsed options are available (to be used in
future tests).

Also add a check for a missing --multi argument, and change a couple of
callers to be consistent and use $* instead of "$@".

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: allow dump file name to be passed as arg
Bill Kendall [Tue, 1 Nov 2011 19:53:06 +0000 (14:53 -0500)]
xfstests: allow dump file name to be passed as arg

xfsdump tests using tapes (rather than files) can pass the tape pathname
to the dump/restore helper functions using the -f option. Change
_parse_args() so that this can be done for file-based tests as well, so
that they don't have to set the global 'dump_file' variable before doing
the dump or restore.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: refactor xfsdump quota checking
Bill Kendall [Tue, 1 Nov 2011 19:53:05 +0000 (14:53 -0500)]
xfstests: refactor xfsdump quota checking

Tests can enable/disable quota checking by passing -q or -Q to the
various dump and restore helper routines. But -q and -Q are valid
xfsdump/xfsrestore options, so in addition to being confusing, tests
cannot use these options. Use --check-quota and --no-check-quota
instead.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: refactor cumulative restore tests
Bill Kendall [Tue, 1 Nov 2011 19:53:04 +0000 (14:53 -0500)]
xfstests: refactor cumulative restore tests

The cumulative restore tests call _do_restore_file_cum(),
which requires a dump level to be passed in the -l option
in order to determine whether the restore directory needs
to be prepared or not. -l is not a valid xfsrestore option,
so doing things this way prevents tests from passing options
to xfsrestore. It's more straightforward to have the test
call _prepare_restore_dir itself prior to starting a series
of cumulative restores.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add 267 and 268 for multiple media files
Bill Kendall [Thu, 3 Nov 2011 10:10:21 +0000 (10:10 +0000)]
xfstests: add 267 and 268 for multiple media files

This patch adds a couple of tests for xfsdump when multiple media files
are used. 267 tests the case where a file is split across multiple media
files, and 268 tests the case where a file ends on one media file and
the next media file starts on another file. These tests use a small
media file size (xfsdump -d) so that they don't rely on having to hit
end-of-tape.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: delay before dumps for incremental tests
Bill Kendall [Mon, 31 Oct 2011 15:02:57 +0000 (10:02 -0500)]
xfstests: delay before dumps for incremental tests

To get reproducible results when testing incremental backups, files
contained in a backup should not have the same timestamp (at second
resolution) as the backup itself. If they do, those files will also
be included in the incremental backup, and this will likely cause
issues in the expected output of the test. This patch adds a sleep
to test 024 prior to doing the level 0 backup. The other incremental
tests already include similar delays.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add test 266 for testing xfsdump -D
Bill Kendall [Thu, 3 Nov 2011 10:10:20 +0000 (10:10 +0000)]
xfstests: add test 266 for testing xfsdump -D

Add a test for xfsdump -D, which skips unchanged directories during
an incremental backup. After doing an initial backup, a new file is
added to one directory (to verify that changed directories are
backed up) and several files are appended to. Then an incremental
backup is done with -D set. The test verifies the original and
restored filesystems match after applying the base and incremental
backups, and that the incremental restore output indicates that only
the one changed directory was backed up.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: fsstress should kill children tasks before exit
Dmitry Monakhov [Sat, 29 Oct 2011 00:48:12 +0000 (04:48 +0400)]
xfstests: fsstress should kill children tasks before exit

It is very hard to predict runtime for fsstress. In many cases it
is useful to give test to run a reasonable time, and then kill it.
But currently there is no reliable way to kill test without leaving
running children.
This patch add sanity cleanup logic which looks follow:
 - On sigterm received by parent, it resend signal to it's children
 - Wait for each child to terminates
 - EXTRA_SANITY: Even if parent was killed by other signal, children
   will be terminated with SIGKILL to preven staled children.

So now one can simply run fsstress like this:
./fsstress -p 1000 -n999999999 -d $TEST_DIR &
PID=$!
sleep 300
kill $PID
wait $PID

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add different logging option to fsstress
Dmitry Monakhov [Sat, 29 Oct 2011 00:48:11 +0000 (04:48 +0400)]
xfstests: add different logging option to fsstress

Currently the only way to log fsstress's output is to redirect it's shared
stdout to pipe which is very painfull because:

1) Pipe writers are serialized via i_mutex so we waste cpu-cores power on stupid
   sinchronization for loging purpose, instead of hunting real race conditions,
   and bugs inside file system.
2) Usually output is corrupted due to luck of sychronization on shared stdout.

Since fsstress's children operate on independend paths, let's just open didicated
log file for each child and simply avoid useless sycnhronization.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: fsstress dump inode info when possible
Dmitry Monakhov [Sat, 29 Oct 2011 00:48:10 +0000 (04:48 +0400)]
xfstests: fsstress dump inode info when possible

Fsstress exec behaviour is not completely determinated in case of
low resources mode due to ENOMEM, ENOSPC, etc. In some places we
call stat(2). This information may be halpfull for future
investigations purposes. Let's dump stat info where possible.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago_populate_fs should use OPTIND when getopts is used
Anand Jain [Thu, 20 Oct 2011 15:41:22 +0000 (23:41 +0800)]
_populate_fs should use OPTIND when getopts is used

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago265: Functional test case for the btrfs raid operations
Anand Jain [Thu, 20 Oct 2011 15:41:21 +0000 (23:41 +0800)]
265: Functional test case for the btrfs raid operations

This will verify the various raid features in btrfs and device
replacement functionality.

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago264: Functional test case for the btrfs snapshot
Anand Jain [Thu, 20 Oct 2011 15:41:20 +0000 (23:41 +0800)]
264: Functional test case for the btrfs snapshot

Create snapshots in various ways, modify the data around the block and
file boundaries and verify the data integrity.

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoAdded SCRATCH_DEV_POOL to specify multiple disks for the btrfs RAID
Anand Jain [Thu, 20 Oct 2011 15:41:19 +0000 (23:41 +0800)]
Added SCRATCH_DEV_POOL to specify multiple disks for the btrfs RAID

SCRATCH_DEV takes single disk as the scratch place for testing. New
SCRATCH_DEV_POOL can used to specify multiple disks for the scratch
btrfs filesystem.

Using SCRATCH_DEV and or SCRATCH_DEV_POOL will follow the following logic.
  btrfs FS OR any FS
    SCRATCH_DEV_POOL is unset and SCRATCH_DEV is set
     . test-case with _require_scratch_dev_pool will not run
     . test-case without _require_scratch_dev_pool will run

    SCRATCH_DEV_POOL is set and SCRATCH_DEV is unset
     . test-case with _require_scratch_dev_pool
         - runs only if FSTYP=btrfs
     . test-case without _require_scratch_dev_pool will run using first
       dev in the SCRATCH_DEV_POOL as a SCRATCH_DEV
         - if FSTYP=btrfs it includes SCRATCH_DEV_POOL disks to the FS
         - if FSTYP=non-btrfs SCRATCH_DEV_POOL is ignored

    SCRATCH_DEV_POOL is set and SCRATCH_DEV is set
     . reports error in the config

    SCRATCH_DEV_POOL is unset and SCRATCH_DEV is unset
     . no change

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agofill files with random data
Anand Jain [Thu, 20 Oct 2011 15:41:18 +0000 (23:41 +0800)]
fill files with random data

snapshot data integrity test-case needs filesystem with random data.

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: add missing binaries to .gitignore
Bill Kendall [Fri, 28 Oct 2011 14:53:25 +0000 (09:53 -0500)]
xfstests: add missing binaries to .gitignore

A clean checkout of xfstests followed by a build resulted in a long list
of untracked files. The current .gitignore ignores most binaries, but
the "dmapi" subdir was missed as were some binaries from the "src"
subdir.

Also ".libs" and ".ltdep" appear under a "dmapi" subdir, not just under
the top-level "libs" directory, so ignore those regardless of the
directory they are in.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years agoxfstests: 075 112 redirect stderr of fsx to /dev/null too
Eryu Guan [Sun, 30 Oct 2011 02:25:55 +0000 (10:25 +0800)]
xfstests: 075 112 redirect stderr of fsx to /dev/null too

In commit c18bf42de9d5d5fa05025754df1ff63f2147bd12 a warning message
will be printed to stderr if filesystem doesn't support fallocate(2).
The warning message will fail these tests though fsx returns SUCCESS.

FSTYP         -- ext3
PLATFORM      -- Linux/i686 debian-dev 3.1.0+
MKFS_OPTIONS  -- /dev/sda3
MOUNT_OPTIONS -- -o acl,user_xattr /dev/sda3 /mnt/sda3

075 12s ... - output mismatch (see 075.out.bad)
--- 075.out     2011-10-28 21:35:41.872573530 +0800
+++ 075.out.bad 2011-10-30 10:31:02.607058029 +0800
@@ -4,6 +4,9 @@
 -----------------------------------------------
 fsx.0 : -d -N numops -S 0
 -----------------------------------------------
+fsx: main: filesystem does not support fallocate, disabling
+: Operation not supported

So redirect stderr of fsx to /dev/null too.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
12 years ago1.1.0 release v1.1.0
Alex Elder [Fri, 14 Oct 2011 13:42:00 +0000 (08:42 -0500)]
1.1.0 release

Signed-off-by: Alex Elder <aelder@sgi.com>
12 years agoxfstests: prepare for marking an initial versioned release
Alex Elder [Thu, 13 Oct 2011 16:31:04 +0000 (16:31 +0000)]
xfstests: prepare for marking an initial versioned release

Add the release script used in the other XFS user space packages.
The version is set to 1.1.0, to differentiate it from the 1.0.0
version that was recorded in the VERSION file.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>