xfstests-dev.git
10 years agoxfstests: fix fsstress usage() output
Eric Sandeen [Mon, 16 Sep 2013 22:00:37 +0000 (22:00 +0000)]
xfstests: fix fsstress usage() output

The show_ops() output should come as part of the -f option
help.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: btrfs/011 improvement for compressed filesystems
Stefan Behrens [Fri, 13 Sep 2013 10:27:21 +0000 (10:27 +0000)]
xfstests: btrfs/011 improvement for compressed filesystems

Josef noticed that using /dev/zero to generate most of the test
data doesn't work if someone overrides the mount options to
enable compression. The test that performs a cancellation failed
because the replace operation was already finished when the
cancel request was executed.

Since /dev/urandom is too slow to generate multiple GB, the
way how the filesystem data is generated is completely changed
with this patch. Now /dev/urandom is used to generate one 1MB
file and this file is copied up to 2048 times. /dev/zero is no
longer used.

The runtime of the test is about the same as before. Compression
works now, online duplication will again cause issues, but
we don't have online duplication today.

Reported-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Jan Schmidt <list.xfs@jan-o-sch.net>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Make 204 work with different block and inode sizes.
Dave Chinner [Tue, 3 Sep 2013 00:14:55 +0000 (00:14 +0000)]
xfstests: Make 204 work with different block and inode sizes.

Otherwise it fails with ENOSPC on CRC enabled filesystems because
of the larger inode size.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Obey mkfs options for sized filesystems on XFS
Dave Chinner [Tue, 3 Sep 2013 00:14:54 +0000 (00:14 +0000)]
xfstests: Obey mkfs options for sized filesystems on XFS

The XFS implementation of _scratch_mkfs_sized ignores MKFS_OPTIONS
when a custom block size is set and so isn't testing things like
CRCs on such sized filesytsems. Fix this by ensuring we don't try to
override the block size is it is set in MKFS_OPTIONS. xfs/204 shows
this problem.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: generic/204 should call _check_scratch_fs
Dave Chinner [Tue, 3 Sep 2013 00:14:53 +0000 (00:14 +0000)]
xfstests: generic/204 should call _check_scratch_fs

Because if it corrupts the filesystem it currently goes undetected.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests btrfs/012: test btrfs-convert
Eric Sandeen [Sun, 4 Aug 2013 20:12:31 +0000 (20:12 +0000)]
xfstests btrfs/012: test btrfs-convert

Turns out btrfs-convert broke on July 3, and lo! we
do not have a regression test, and now we have one,
and there was much rejoicing.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: _test_generic_punch: Obtain block size from $TEST_DIR
chandan [Wed, 28 Aug 2013 06:24:10 +0000 (06:24 +0000)]
xfstests: _test_generic_punch: Obtain block size from $TEST_DIR

The current code incorrectly gets block size information from $TEST_DEV
instead of from $TEST_DIR. This returns the block size of the filesystem
hosting the device file rather than that of the filesystem on $TEST_DEV.

Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: update _filter_size() for Btrfs
Stefan Behrens [Fri, 23 Aug 2013 13:07:12 +0000 (13:07 +0000)]
xfstests: update _filter_size() for Btrfs

The btrfs-progs tools changed the output:
- 100GiB instead of 100GB

xfstest btrfs/006 is one that failed due to this change.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: add a test for btrfs device replace operation
Stefan Behrens [Fri, 23 Aug 2013 13:07:11 +0000 (13:07 +0000)]
xfstests: add a test for btrfs device replace operation

This test performs btrfs device replace tests with all possible profiles
(single/dup/mixed/raid0/raid1/raid10), one round with the '-r' option
to 'btrfs replace start' and one round without this option. The
cancelation is tested only once and with the dup/single profile for
metadata/data.

This test takes 181 seconds on my SSD equiped test box and 237s on
spinning disks. Almost all the time is spent when the filesystem is
populated with test data. The replace operation itself takes less than
a second for all the tests, except for the test that is marked as
'thorough' which will run for about 8 seconds on my test box.

The amount of tests done depends on the number of devices in the
SCRATCH_DEV_POOL. For full test coverage, at least 5 devices should
be available (e.g. 5 partitions). With less than 2 entries in
SCRATCH_DEV_POOL, the test is not executed.

The source and target devices for the replace operation are arbitrarily
chosen out of SCRATCH_DEV_POOl. Since the target device mustn't be
smaller than the source device, the requirement for this test is that
all devices have _exactly_ the same size. If this is not the case, the
test terminates with _notrun.

To check the filesystems after replacing a device, a scrub run is
performed, a btrfsck run, and finally the filesystem is remounted.

This commit depends on my other commit:
"xfstest: don't remove the two first devices from SCRATCH_DEV_POOL"

[rjohnston: renumbered to btrfs/011]

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL
Stefan Behrens [Fri, 23 Aug 2013 13:07:13 +0000 (13:07 +0000)]
xfstests: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL

One problem was the output of "uniq -c" which added spaces depending
on the size of the count value (e.g. one space less for 10+ devices).

The second problem was that "btrfs fi show" was doing the same:
"devid %4llu size %s used %s path %s".

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: don't remove the two first devices from SCRATCH_DEV_POOL
Stefan Behrens [Fri, 23 Aug 2013 13:07:10 +0000 (13:07 +0000)]
xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

Since common/config is executed twice, if SCRATCH_DEV_POOL is configured
via the environment, the current code removes the first device entry twice
which means that you lose the second device for the test.

The fix is to not remove anything from SCRATCH_DEV_POOL anymore.
That used to be done (I can only guess) to allow to pass the
SCRATCH_DEV_POOL as an argument to _scratch_mkfs. Since _scratch_mkfs adds
the SCRATCH_DEV, the pool mustn't contain that device anymore.

A new function _scratch_pool_mkfs is introduced that does the expected
thing.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Test all 3 quotas simultaneously.
Chandra Seetharaman [Thu, 1 Aug 2013 19:52:26 +0000 (19:52 +0000)]
xfstests: Test all 3 quotas simultaneously.

Add a test for testing all 3 (user, group and project) quotas together.

This is a modified version of xfstest 050.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests/btrfs/010: add snapshot-aware defrag for partial extents testcases
Liu Bo [Thu, 25 Jul 2013 08:15:02 +0000 (08:15 +0000)]
xfstests/btrfs/010: add snapshot-aware defrag for partial extents testcases

This is to test whether snapshot-aware defrag can work well on partial extents.

Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: btrfs/009 never shrinked or removed $seqres.full
Stefan Behrens [Fri, 16 Aug 2013 17:44:54 +0000 (17:44 +0000)]
xfstests: btrfs/009 never shrinked or removed $seqres.full

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests generic/318: user namespace uid/gids in an ACL
Dwight Engen [Mon, 19 Aug 2013 17:34:42 +0000 (17:34 +0000)]
xfstests generic/318: user namespace uid/gids in an ACL

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests generic/317: user namespace uid/gids in an inode
Dwight Engen [Thu, 27 Jun 2013 16:03:34 +0000 (16:03 +0000)]
xfstests generic/317: user namespace uid/gids in an inode

[rjohnston: renumbered test to 317]

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: <rjohnston@sgi.com>
Signed-off-by: <rjohnston@sgi.com>
10 years agoxfstests: add nsexec user namespace helper
Dwight Engen [Thu, 27 Jun 2013 16:03:28 +0000 (16:03 +0000)]
xfstests: add nsexec user namespace helper

Add new program nsexec to facilitate creating/entering a user namespace. The
original source for the program is https://lwn.net/Articles/539940. I added
the -s option to become "root" in the user namespace.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: <rjohnston@sgi.com>
Signed-off-by: <rjohnston@sgi.com>
10 years agoxfstests: redirect output in btrfs/003
Stefan Behrens [Fri, 16 Aug 2013 15:18:43 +0000 (15:18 +0000)]
xfstests: redirect output in btrfs/003

This test failed for me with output from 'btrfs balance':
     QA output created by 003
    +Done, had to relocate 4 out of 4 chunks
    +Done, had to relocate 5 out of 5 chunks
     Silence is golden

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Allow to specify RESULT_BASE directory
Lukas Czerner [Thu, 11 Jul 2013 10:38:01 +0000 (10:38 +0000)]
xfstests: Allow to specify RESULT_BASE directory

This commit adds the possibility to specify RESULT_BASE directory from
the config file, or with environment variable. The default remains the
same "$here/results/".

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Allow to re-read configuration
Lukas Czerner [Thu, 11 Jul 2013 10:38:00 +0000 (10:38 +0000)]
xfstests: Allow to re-read configuration

Move configuration initialization into a function so we can re-read it
without the need to reinclude the common/config file which would be
ugly. This is in preparation for adding support for sections into config
files.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Allow to recheck options in common/rc
Lukas Czerner [Thu, 11 Jul 2013 10:37:59 +0000 (10:37 +0000)]
xfstests: Allow to recheck options in common/rc

Move configuration checks into separate function to allow us to recheck
the options without the need to reinclude the whole source file which is
ugly. We still run the check on include.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Export all important variables in common/config
Lukas Czerner [Thu, 11 Jul 2013 10:37:57 +0000 (10:37 +0000)]
xfstests: Export all important variables in common/config

Currently we do not export some of the important variables in
common/config. Fix this.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: add a new test case for ext4 indirect-based file
Zheng Liu [Fri, 16 Aug 2013 05:28:07 +0000 (05:28 +0000)]
xfstests: add a new test case for ext4 indirect-based file

After applied this commit (864688d3), xfstests #255 will not test a
file system that cannot support fallocate(2), such as a indirect-based
file in ext4.  So we need to add a new generic test case to test it.

The difference between #255 and this test case is only to use pwrite to
allocate blocks.  Other filesystems should survive in this test case.
In the mean time, a new argument '-u' is added into _test_generic_punch
not to run unwritten tests.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoContent-Type: text/plain; charset="utf-8"
Josef Bacik [Tue, 2 Jul 2013 19:17:18 +0000 (19:17 +0000)]
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: xfstests: make the scratch device for generic/256 slightly larger
Date: Tue, 02 Jul 2013 19:17:18 -0000
From: Josef Bacik <jbacik@fusionio.com>
X-Patchwork-Id: 5816
Message-Id: <1372792638-23957-1-git-send-email-jbacik@fusionio.com>
To: <linux-btrfs@vger.kernel.org>, <xfs@oss.sgi.com>

This is similar to a previous fix I sent.  1 gig makes us do mixed file block
groups for btrfs, so these enospc tests will usually fail because we don't have
space for metadata, which is the case for this test.  So jack the size up to
1.5gig so that btrfs can do its normal thing and pass the test.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o
Koen De Wit [Tue, 2 Jul 2013 21:44:57 +0000 (21:44 +0000)]
xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o

If multiple mount options are given with multiple -o parameters,
_mount_ops_filter concatenates them by replacing all -o's with a comma
(except for the first -o).

If $TEST_DIR contains "-o" (e.g. /mnt/test-os/) you get errors like this:

   # ./check generic/002
     mount: mount point /mnt/test,s/ does not exist
     common/rc: retrying test device mount with external set
     mount: mount point /mnt/test,s/ does not exist
     common/rc: could not mount /dev/sdc3 on /mnt/test-os/

Fix it by only replacing -o's that are preceded by at least one space.

Signed-off-by: Koen De Wit <koen.de.wit@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: btrfs/009: regression test for subvol delete
Josef Bacik [Wed, 14 Aug 2013 20:07:52 +0000 (20:07 +0000)]
xfstests: btrfs/009: regression test for subvol delete

We were allowing users to delete their default subvolume, which is problematic.
This test is a regression test to make sure we don't let that happen in the
future.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston: renumbered test from 003 to 009]

10 years agoxfstests: btrfs/008, another send regression test
Josef Bacik [Mon, 12 Aug 2013 19:13:22 +0000 (19:13 +0000)]
xfstests: btrfs/008, another send regression test

This is a regression test for a problem we had where we'd assume we had created
a directory if it only had subvols inside of it.  This was happening because
subvols would have lower inode numbers than our current send progress because
their inode numbers are based off of a different counter.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston: renumbered test from 002 to 008]

10 years agoxfstests btrfs/007: test send / receive
Jan Schmidt [Tue, 13 Aug 2013 17:24:18 +0000 (17:24 +0000)]
xfstests btrfs/007: test send / receive

Basic send / receive functionality test for btrfs. Requires current
version of fsstress built (-x support). Relies on fssum tool but can
skip the test if it failed to build.

Signed-off-by: Jan Schmidt <list.xfs@jan-o-sch.net>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston: renumbered test from 316 to 007]

10 years agoxfstests: add fssum tool
Jan Schmidt [Tue, 13 Aug 2013 17:24:17 +0000 (17:24 +0000)]
xfstests: add fssum tool

fssum is a tool to build a recursive checksum for a file system. The home
repository of fssum is

    git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git

Signed-off-by: Jan Schmidt <list.xfs@jan-o-sch.net>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: renumber existing btrfs tests to start with 1
David Sterba [Tue, 13 Aug 2013 21:16:27 +0000 (16:16 -0500)]
xfstests: renumber existing btrfs tests to start with 1

Current numbering is inheried from the single testsuite series. There
are only 6 btrfs-specific tests and it makes more sense to start adding
new ones at a more natural place than 300-something. There's no overlap
with the old and new numbers and I hope there' will be no confusion when
referencing them.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: generic/315: allow a little tolerance for our used check
Josef Bacik [Mon, 29 Jul 2013 18:55:56 +0000 (14:55 -0400)]
xfstests: generic/315: allow a little tolerance for our used check

So df in btrfs is tricky at best, and relying on it for accurate information is
not great, but it's the best way to verify this test.  To get around btrfs being
inconsistent sometimes just use _within_tolerance to check our new df value to
make sure that our truncate did something.  With this patch I no longer see
transient failures of this test.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: generic/314 filter out total from ls -l output
Josef Bacik [Fri, 26 Jul 2013 15:45:32 +0000 (11:45 -0400)]
xfstests: generic/314 filter out total from ls -l output

ls -l will show the nblocks for the directory, and this made it into the golden
output for 314.  The problem is nblocks is 0 for btrfs directories because we're
awesome, which makes us fail this test.  So filter out the "total blah" line of
ls -l so btrfs can pass this test too.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoRevert "xfstests: exit out if _scratch_mount fails"
Ben Myers [Fri, 26 Jul 2013 16:07:33 +0000 (11:07 -0500)]
Revert "xfstests: exit out if _scratch_mount fails"

This reverts commit 74bcf51c066e498a147ab5902e377efa59224dd3.

Unfortunately this commit causes dmapi tests to be run on systems which
don't have dmapi installed, so they fail.

Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: generic/315, verify preallocated disk space is released per truncate
Jie Liu [Mon, 1 Jul 2013 10:29:19 +0000 (18:29 +0800)]
xfstests: generic/315, verify preallocated disk space is released per truncate

Introduce generic test 315 to verify if the disk space is
released after truncating a preallocated file back to the
old smaller size.  Before Linux-3.10, Btrfs/OCFS2 test
failed in this case.

The test file is fallocated with FALLOC_FL_KEEP_SIZE option.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: clean up remake related matters from README
Jie Liu [Mon, 1 Jul 2013 10:37:19 +0000 (18:37 +0800)]
xfstests: clean up remake related matters from README

Cleanup 'remake' related matters from the README file as the
remake utility has already been removed by:

commit 609d17c4eb911891fae3c0081c2cd1caa613c0de

xfstests: remove remake script

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: skip generic/192 if noatime is set
David Sterba [Wed, 3 Jul 2013 14:00:05 +0000 (16:00 +0200)]
xfstests: skip generic/192 if noatime is set

Test generic/192 fails if noatime is set

generic/192
    -delta1 - access time after sleep in-core: 40
    -delta2 - access time after sleep on-disk: 40
    +delta1 - access time after sleep in-core: 0
    +delta2 - access time after sleep on-disk: 0

but it's pointless to test atime effects with noatime.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: exit out if _scratch_mount fails
Josef Bacik [Tue, 9 Jul 2013 19:07:27 +0000 (15:07 -0400)]
xfstests: exit out if _scratch_mount fails

I test some of the different mkfs options for btrfs, one set doesn't work
properly with small file systems, so the fs won't mount.  This is fine from a
btrfs point of view, but tests that fail to mount the scratch fs will run
anyway, so if it's a "fill the fs" sort of test this will wreak havoc.  To fix
this just error out of _scratch_mount fails.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: generic/314, test sgid inheritance on subdirs
Carlos Maiolino [Fri, 12 Jul 2013 19:46:13 +0000 (16:46 -0300)]
xfstests: generic/314, test sgid inheritance on subdirs

Tests if subdirectories created on the filesystem will properly inherit sgid bit
when this is set on the parent directory, once the process has the properly
permissions to create a subdirectory, this, should inherit parent's sgid bit if
this is set and irix_sgid_inherit sysctl is disabled.

V2: add missing source of "attr" file for _require_acls

V3: use _ls_l to filter out the selinux "."
    renumber to 314 to make the merge easier

V4: fix 314.out to the correct output

Thanks to Sandeen who have written this patch

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstest: ensure small symlink is removed
Mark Tinguely [Tue, 18 Jun 2013 01:35:05 +0000 (20:35 -0500)]
xfstest: ensure small symlink is removed

Tests the XFS symlinks that are small enough to be in the
inode, but were move to a remote symlink due to an extended
attribute were correctly removed.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: fix README, FSTYP options
Dwight Engen [Thu, 27 Jun 2013 15:57:36 +0000 (11:57 -0400)]
xfstests: fix README, FSTYP options

commit cbcc88fb changed test selection to use shell globs, so fixup the
examples given in the README file.

remove options for FSTYP other than NFS since the FSTYP will be automatically
detected (on Linux) from $TEST_DEV.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests generic/313: test ctime and mtime are updated on truncate and ftruncate
Eryu Guan [Thu, 27 Jun 2013 15:32:10 +0000 (23:32 +0800)]
xfstests generic/313: test ctime and mtime are updated on truncate and ftruncate

Regression test for commit:
3972f26 btrfs: update timestamps on truncate()

Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: use xfs_io fiemap instead of filefrag V2
Josef Bacik [Mon, 24 Jun 2013 14:21:36 +0000 (10:21 -0400)]
xfstests: use xfs_io fiemap instead of filefrag V2

Btrfs has always failed shared/218 because of the way we allocate extents on
disk.  The last part of 218 writes contiguously holey from the start of the file
forward, which for btrfs means we get 16 extents but they are physically
contigous.  filefrag -v shows all 16 extents, but prints out that there is 1
extent, because they are physically contiguous.  This isn't quite right and
makes the test fail.  So instead of using filefrag use xfs_io -c fiemap which
will print the whole map and then get the count from there.  With this patch
btrfs now passes the test, I also verified that ext4 and xfs still pass this
test.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: .gitignore: add fsync-tester
Dwight Engen [Tue, 25 Jun 2013 19:34:35 +0000 (15:34 -0400)]
xfstests: .gitignore: add fsync-tester

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
[bpm: fixed alphabetization]

10 years agoxfstests: aio-stress is calling pthread_join incorrectly
Dave Kleikamp [Tue, 18 Jun 2013 22:57:00 +0000 (17:57 -0500)]
xfstests: aio-stress is calling pthread_join incorrectly

The retval parameter to pthread_join() is a pointer to a pointer.
aio-stress is passing in a pointer to an int. This can result in a bus
error on sparc64 when the pointer is not aligned on a 64-bit boundary.
Since the return value is not used, it is simplest to pass a NULL
pointer instead.

This has been fixed in the LTP source:
https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: fsync-tester: fix pwrite() return check and disable direct for test 19
Josef Bacik [Wed, 12 Jun 2013 01:13:03 +0000 (21:13 -0400)]
xfstests: fsync-tester: fix pwrite() return check and disable direct for test 19

Test 19 in direct mode was failing on xfs because it was not actually doing the
write because the writes were not sectorsize aligned.  This test is to test
btrfs's inline extent fsync()ing so the writes won't be sectorsize aligned, and
inline extents will fall back to buffered anyway so direct mode is meaningless
for this test.  So just check if we are test 19 and disable direct mode so we
don't have to change the golden output.  Also change test_five() to compare
against a ssize_t instead of a size_t since apparently comparing against size_t
makes it cast the return value of pwrite() to size_t which screws up the error
case, so instead of seeing the pwrite() error on xfs which would have explained
this all it appeared as if it was succeeding and screwing up the fsync(), which
unfortunately wasted a bit of Daves time.  This patch should fix all this up.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: xfs/253 doesn't use seqres correctly
Dave Chinner [Fri, 7 Jun 2013 13:06:35 +0000 (23:06 +1000)]
xfstests: xfs/253 doesn't use seqres correctly

It was missed when converting all the tests as it was using
${seq}.full and none of the regexes matched it. Fix it up to direct
the output to the correct place.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests: generic/193 runs tests in wrong location
Dave Chinner [Fri, 7 Jun 2013 13:06:33 +0000 (23:06 +1000)]
xfstests: generic/193 runs tests in wrong location

generic/193 runs the test in $here - the root of the xfstests source
tree/installation. IOWs, it doesn't test the filesystem on either
the TEST_DIR or SCRATCH_MNT, and so it not testing the filesystem
we think it is testing. Bad. Fixing this is the majority of the
change - introducing $test_root and $test_user for the files with
different owners, and then redirecting error output and filtering
the output appropriately.

And then add checks that truncate clears the suid/sgid bits
appropriately, something that has never been tested on XFS (and
likely other filesystems) so will cause kernels between 3.1 and 3.9
to assert fail as Dave Jones has recently reported.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfstests 285: Test offsets over 4GB
Jan Kara [Mon, 3 Jun 2013 18:53:49 +0000 (13:53 -0500)]
xfstests 285: Test offsets over 4GB

Test whether SEEK_HOLE and SEEK_DATA works correctly with offsets over
4GB, 8TB, and 16TB.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests 285: Fix test for ext4 in some configurations
Jan Kara [Mon, 3 Jun 2013 18:40:36 +0000 (13:40 -0500)]
xfstests 285: Fix test for ext4 in some configurations

In some configurations (e.g. 1 KB block size), ext4 can decide it is
better to zero out several blocks rather than splitting unwritten
extent. This changes results SEEK_HOLE / SEEK_DATA returns and thus the
test fails. Fix the problem by disabling the feature for this test.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix seek_sanity_test for fs w/o fallocate
Eric Sandeen [Mon, 3 Jun 2013 12:28:17 +0000 (07:28 -0500)]
xfstests: fix seek_sanity_test for fs w/o fallocate

currently the seek_sanity_test (generic/285) fails on ext3
or ext2 due to fallocate() failures.  Just ignore that test
if the fs doesn't support fallocate.

Note: this patch was originally submitted by Zheng Liu.
http://oss.sgi.com/archives/xfs/2013-05/msg00534.html

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Zheng Liu <gnehzuil.liu@gmail.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests 285: Fix indentation of do_pwrite
Jan Kara [Fri, 31 May 2013 12:19:47 +0000 (07:19 -0500)]
xfstests 285: Fix indentation of do_pwrite

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Fix test wildcard expansion.
Rich Johnston [Fri, 31 May 2013 12:02:48 +0000 (07:02 -0500)]
xfstests: Fix test wildcard expansion.

Before commit 38d58591 "xfstests: fix typo in check",
check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:

'if grep "^$testname" $group_file >/dev/null'
returns the contents of $group_file because $testname="".

Therefore xfs/[0-9]?? was echoed to $tmp.list

Change to use egrep to fix the parsing.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
10 years agoxfstests: add missing colon in _filter_ln
Eryu Guan [Wed, 29 May 2013 19:42:09 +0000 (14:42 -0500)]
xfstests: add missing colon in _filter_ln

On distros with older coreutils(eg. RHEL5) generic/294 fails like

    -ln: creating symbolic link `SCRATCH_MNT/294.test/testlink': File exists
    +ln: creating symbolic link `SCRATCH_MNT/294.test/testlink'File exists

_filter_ln ate the ": ". xfs/103 has similar issue. Add ": " back.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix typo in check
Eryu Guan [Wed, 29 May 2013 13:12:44 +0000 (08:12 -0500)]
xfstests: fix typo in check

There is no $testname, should be $test_name

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: add generic/286 to the auto and quick groups
Theodore Ts'o [Tue, 28 May 2013 16:01:01 +0000 (11:01 -0500)]
xfstests: add generic/286 to the auto and quick groups

The generic/286 test tests SEEK_HOLE and SEEK_DATA, and is reasonably
fast.  We should just run the test by default.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix src/seek_sanity_test -t option
Eric Sandeen [Tue, 28 May 2013 15:37:39 +0000 (10:37 -0500)]
xfstests: fix src/seek_sanity_test -t option

_require_seek_data_hole() does not work because
the -t (test) option of seek_sanity_test is broken,
because of an early check for (argc != 2):

# src/seek_sanity_test -t foo
Usage: src/seek_sanity_test base_file_path

So _require_seek_data_hole() doesn't see the
"Kernel does not support" string it's looking for,
and passes the check.

So rather than _notrun-ing the test, it proceeds to
fail with noisy errors.

Fix that, make a common usage() function, and check for
too many args as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: cleanup the codes related to h_chksum
Zhi Yong Wu [Tue, 28 May 2013 13:31:52 +0000 (08:31 -0500)]
xfstests: cleanup the codes related to h_chksum

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

  Since h_chksum field has gone away, we should cleanup the related codes

    [CC]    loggen
loggen.c: In function 'loggen_unmount':
loggen.c:137:9: error: 'xlog_rec_header_t' has no member named 'h_chksum'
loggen.c: In function 'loggen_empty':
loggen.c:205:9: error: 'xlog_rec_header_t' has no member named 'h_chksum'

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: Change mount method for generic/258
Michael L. Semon [Wed, 22 May 2013 18:50:59 +0000 (13:50 -0500)]
xfstests: Change mount method for generic/258

Use the built-in _test_mount function from xfstests so it will use
the correct mount options for xfstests.  The script used a simple
umount-and-mount sequence, which caused a test failure on an XFS
filesystem that used both realtime and external log devices.

Signed-off-by: Michael L. Semon <mlsemon35@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@rehat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: 311: fsck the dmflakey device instead of the real device
Josef Bacik [Thu, 16 May 2013 13:48:03 +0000 (08:48 -0500)]
xfstests: 311: fsck the dmflakey device instead of the real device

xfs was having issues with generic/311 because of caching issues. Make
_check_scratch_fs take an optional argument to use as the device to fsck.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: generic/235 breaks /etc/mtab symlinks breaks xfs/189
Dave Chinner [Thu, 16 May 2013 11:53:05 +0000 (06:53 -0500)]
xfstests: generic/235 breaks /etc/mtab symlinks breaks xfs/189

Serenity lost.
Insanity looms darkly.
/etc/mtab

Random behaviour.
xfs/189 fails
After a week passing.

-SCRATCH_DEV on SCRATCH_MNT type xfs (ro,filestreams)
+SCRATCH_DEV on SCRATCH_MNT type xfs (ro,relatime,attr2,filestreams,inode64,noquota)

Confusion prevails.
/proc/mounts can never give success.
Anything but golden.

ls -l
/etc/mtab shows:
lrwxrwxrwx 1 root root 12 May  8 16:05 /etc/mtab -> /proc/mounts

symlink modified.
Stealth. Deception. WTF?
Ninjas go unseen.

"git grep mtab". Yay!
generic/235: sad
SElinux hack.

Remount context grot.
Mount uses all options from
/etc/mtab

Kernel rejects mount.
sed hacks /etc/mtab
Symlink becomes file.

Test frobulation.
xfs/189 passes
Randomness tamed.

Double face-palm. Tears.
Crack-inspired insanity.
mount(8) needs fixing.

Schizophrenia.
/etc/mtab. Same thing.
Test psychiatry.

Hack, slash, glue, polish.
xfs/189 fixed.
Made shiny again.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: quota not supported on realtime filesystems
Dave Chinner [Thu, 16 May 2013 11:52:05 +0000 (06:52 -0500)]
xfstests: quota not supported on realtime filesystems

Realtime XFS filesystems do not support quotas, so quota tests
always fail on such filesystems. Add a check to _require_quota to
detect this situation and notrun the quota tests...

Also, fix _require_xfs_quota and _require_prjquota to have the same
checks.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: change test case file mode to 0755
Zheng Liu [Wed, 15 May 2013 13:17:51 +0000 (08:17 -0500)]
xfstests: change test case file mode to 0755

Now in tests/ there are some test cases whose mode is 0644.  But they
should be 0755.  So fix it.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Dave Chinner <david@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoENOSPC in fallocate(2) could corrupt ext4 when file size > 4G
Eryu Guan [Wed, 15 May 2013 12:48:41 +0000 (07:48 -0500)]
ENOSPC in fallocate(2) could corrupt ext4 when file size > 4G

Regression test for commit
29ae07b ext4: Fix overflow caused by missing cast in ext4_fallocate()

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests btrfs/284: shorten duration, fix output
Eric Sandeen [Wed, 15 May 2013 12:18:07 +0000 (07:18 -0500)]
xfstests btrfs/284: shorten duration, fix output

test 284 had... some issues.

First, it took so long nobody ran it; so shorten the extent
count by a factor of about 100.

Having fixed that, we see failures in 2 cases; when start or
len is -1, but the golden output file didn't have error
output, as if they should pass.

I'm going to argue that these *should* both fail; start = -1
has no real meaning.  length = -1 might mean "the rest
of the file" but if that's what you really want, just
don't specify -l.

So add failure output for those cases.

Send all command output to $seq.full, in case that changes
in the future; just capture the return value.

Then remove the return value echo on failure (50?) because
who knows when that might change to some other magic value.

Ok, then when defrag actually works, old defrag returned
"20" (because?) but a recent commit changed it to 0.
So accommodate that too.

And remove a stray "HAVE_DEFRAG=1" while we're at it.
That variable is never used.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoIn xfstest 285/286 we don't check whether the target file system
Zheng Liu [Tue, 14 May 2013 18:25:44 +0000 (13:25 -0500)]
In xfstest 285/286 we don't check whether the target file system
supports seek data/hole operation or not.  Here _require_seek_data_hole
is defined to do this work.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests shared/298: various fixes
Eric Sandeen [Tue, 14 May 2013 18:08:45 +0000 (13:08 -0500)]
xfstests shared/298: various fixes

fix shared/298:

* don't include common/config, not needed and breaks
  stuff when $SCRATCH_DEV_POOL is defined:
    Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again, for use on
  old xfsprogs on non-xfs filesystems
* ignore ENOSPC errors from "garbage" loop; the only goal
  is to fill it, ENOSPC doesn't matter.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: remove fio config files after finished test
Zheng Liu [Tue, 14 May 2013 13:35:44 +0000 (08:35 -0500)]
xfstests: remove fio config files after finished test

After finished test, temporarily fio config file should be removed.
This commit tries to fix this problem in the following test cases:
  - generic/299-300
  - ext4/301-304
  - shared/305

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix incorrect redirect in generic/233
Dave Chinner [Tue, 14 May 2013 13:34:44 +0000 (08:34 -0500)]
xfstests: fix incorrect redirect in generic/233

generic/233 attempts to direct output to tee, but instead of using a
pipe it uses an append operator. Hence it leaves a file named "tee"
in the root directory of the xfstests execution path. Just direct
the output to the $seqres.full file rather than trying to tee it
into the test output as well.

Reported-by: "Michael L. Semon" <mlsemon35@gmail.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: automatically add -F to xfs_io on non-xfs
Eric Sandeen [Tue, 14 May 2013 13:33:44 +0000 (08:33 -0500)]
xfstests: automatically add -F to xfs_io on non-xfs

The -F flag to xfs_io originally enabled it to operate on non-xfs
filesystems.  This restriction was removed upstream in favor of
gracefully failing on the handful of operations that actually
required xfs, and the option was deprecated.

However, xfstests is still used on distros with older xfsprogs, and
so "xfs_io -F" was necessary throughout xfstests.

Simplify this by appending -F to XFS_IO_PROG when it's needed -
i.e. if we're using old xfsprogs on a non-xfs filesystem.

This will eliminate errors when new tests leave out the -F, and
if and when -F is finally removed, there will be one central
location in xfstests to update.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoMake test 306 use null and zero device nodes on SCRATCH_MNT
Jan Kara [Tue, 14 May 2013 12:02:50 +0000 (07:02 -0500)]
Make test 306 use null and zero device nodes on SCRATCH_MNT

In one place of test 306, we mistakenly used /dev/null and /dev/zero
instead of equivalent devices created on tested filesystem. So we were
not really testing the functionality we intended.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
--

10 years agoxfstests: update method to set TESTS_SUBDIRS in tests/Makefile.
Wang Sheng-Hui [Mon, 13 May 2013 20:41:21 +0000 (15:41 -0500)]
xfstests: update method to set TESTS_SUBDIRS in tests/Makefile.

  make install support common/ and tests/ dirs (V4)
  * reposted for current top of tree changes. [rjohnston@sgi.com]
  * use the neater way by Dave to get the TESTS_SUBDIRS in tests/Makefile.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
[rjohnston@sgi.com Reposted for current top of tree changes]
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: add execution of a custom command to fsstress (-x and -X options)
Jan Schmidt [Thu, 9 May 2013 19:40:00 +0000 (14:40 -0500)]
xfstests: add execution of a custom command to fsstress (-x and -X options)

This patch adds execution of a custom command in the middle of all fsstress
operations. Its intended use is the creation of snapshots in the middle of a
test run.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests 311: test fsync with dm flakey V4
Josef Bacik [Fri, 26 Apr 2013 19:13:59 +0000 (19:13 +0000)]
xfstests 311: test fsync with dm flakey V4

This test sets up a dm flakey target and then runs my fsync tester I've been
using to verify btrfs's fsync() is working properly.  It will create a dm flakey
device, mount it, run my test, make the flakey device start dropping writes, and
then unmount the fs.  Then we mount it back up and make sure the md5sums match
and then run fsck on the device to make sure we got a consistent fs.  I used the
output from a run on BTRFS since it's the only one that passes this test
properly.  I verified each test manually to make sure they were in fact valid
files.  XFS and Ext4 both fail this test in one way or another.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com changed syncfs() to sync() for older kernels]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoRevert "xfstests 311: test fsync with dm flakey V3"
Rich Johnston [Fri, 3 May 2013 19:07:59 +0000 (14:07 -0500)]
Revert "xfstests 311: test fsync with dm flakey V3"

This reverts commit 2ca254dfddbbab8def35472b6ca39140400aff76.
Patch will be resubmitted

10 years agoxfstests 311: test fsync with dm flakey V3
Josef Bacik [Fri, 26 Apr 2013 19:13:59 +0000 (19:13 +0000)]
xfstests 311: test fsync with dm flakey V3

This test sets up a dm flakey target and then runs my fsync tester I've been
using to verify btrfs's fsync() is working properly.  It will create a dm flakey
device, mount it, run my test, make the flakey device start dropping writes, and
then unmount the fs.  Then we mount it back up and make sure the md5sums match
and then run fsck on the device to make sure we got a consistent fs.  I used the
output from a run on BTRFS since it's the only one that passes this test
properly.  I verified each test manually to make sure they were in fact valid
files.  XFS and Ext4 both fail this test in one way or another.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com changed syncfs() to sync() for older kernels]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix internal _xfs_check to handle logdev etc
Eric Sandeen [Thu, 2 May 2013 14:53:19 +0000 (14:53 +0000)]
xfstests: fix internal _xfs_check to handle logdev etc

Pull all of the old xfs_check script into common/rc:_xfs_check()
so that it properly handles all options, including external log
devices.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: generic/241 requires dbench
Dave Chinner [Wed, 1 May 2013 08:47:51 +0000 (08:47 +0000)]
xfstests: generic/241 requires dbench

common/config doesn't configure DBENCH_PROG so it doesn't run.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: btrfs/276 - stop all fsstress before exiting
Eric Sandeen [Fri, 26 Apr 2013 05:29:21 +0000 (05:29 +0000)]
xfstests: btrfs/276 - stop all fsstress before exiting

Tests after 276 were failing because the background fsstress
hadn't quit prior to exit, devices couldn't be unmounted, etc.

Just use the same trick as generic/068 does, and use
a tmpfile to control whether the background loop keeps
running.

Also, no need to umount scratch at cleanup time, the scripts
do that for us.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Schmidt list.xfs@jan-o-sch.net
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests generic/306 fixes and updates
Eric Sandeen [Mon, 29 Apr 2013 16:09:54 +0000 (16:09 +0000)]
xfstests generic/306 fixes and updates

older xfs_io refused to write to /dev/null because it's
not a file on an xfs filesystem.  So add -F.

While we're at it, add more testcases:

* symlink on a RO fs pointing to a file on a RW fs.
* bind-mounted rw file on an RO fs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix broken redirects in generic/131
Dave Chinner [Wed, 1 May 2013 08:32:03 +0000 (08:32 +0000)]
xfstests: fix broken redirects in generic/131

generic/131 attempts to kill processes that may no longer exist when
the test finishes and has a broken redirect for the error messages
and they end up in a file named "1" in the xfstests root instead of
/dev/null.

Not only that, the attempts to redirect stderr to stdout in the
middle of the test use incorrect redirect syntax, so they create an
empty file named "1" in the xfstests root...

IOWs, all the redirects in the test are broken. Fix them and clean
up the failure case to use the exit trap to trigger the cleanup
function....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix incorrect redirect in generic/232
Dave Chinner [Wed, 1 May 2013 08:32:02 +0000 (08:32 +0000)]
xfstests: fix incorrect redirect in generic/232

generic/232 attempts to direct output to tee, but instead of using a
pipe it uses an append operator. Hence it leaves a file named "tee"
in the root directory of the xfstests execution path. Just direct
the output to the $seqres.full file rather than trying to tee it
into the test output as well.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: filter EA paths used by dump
Dave Chinner [Wed, 1 May 2013 08:32:01 +0000 (08:32 +0000)]
xfstests: filter EA paths used by dump

Test 063 fails because the diff output now has entire paths to the
files in the results directory in it rather than just the file name.
Add the results directory to the directory filter used by the dump
tests to remove the path from the diff output.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: 310 fails with existing directory error
Dave Chinner [Wed, 1 May 2013 08:32:00 +0000 (08:32 +0000)]
xfstests: 310 fails with existing directory error

Test 310 fails with:

mkdir: cannot create directory `/mnt/test/tmp': File exists

$TEST_DIR is persistent, so test directories need to be created with
"mkdir -p" so they don't fail if the directory already exists.

Many other things need fixing, too.
- Tests should define directories they use on $TEST_DIR by
  their sequence number, not generic names.

- Use a variable for the directory the test runs in
  ($SEQ_DIR, in this case) to avoid having to manually code
  it everywhere.

- New binaries need to be added to .gitignore.

- Return status for shell functions is 0 for success,
  non-zero for failure.

- Setting status=0 if there is no failure in the first test
  means that even if the second test fails, the test will
  still pass. Change the test to use "_fatal" when a kernel
  bug is detected, and only set status=0 when the entire
  test has finished.

- reduce the default runtime by to roughly a minute and
  scale it with the stress load factor variables. In most
  cases, this test is never going to hit problems (as
  they've already been fixed) so running it for ~4 minutes
  is mostly a waste of time...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix last test runtime output
Dave Chinner [Wed, 1 May 2013 08:31:59 +0000 (08:31 +0000)]
xfstests: fix last test runtime output

Prior to the test directory split-up, xfstests used to output the
time it previously took to run a specific test in it's output. This
was broken during the split up, as test identifiers changed and the
result output changed.

To fix this, the search for previous test results needs to look at
the sequence number rather than the absolute sequence for the test.
The new output looks the same as the old functionality:

generic/001 4s ... 5s
generic/002 1s ... 0s
generic/005 1s ... 1s
generic/006 1s ... 1s
generic/007 2s ... 1s

Where the first column is the time of the previous test run, and the
second column is the time that this run took.

Further, the check files used to generate this information are not
being output properly in the result directory, and so various log
files are not getting written to the correct location or file names.
For example, the calls to _check_test_fs would output failures to
".full", while other messages would be output to check.full, but
none would output to the corect location of RESULT_BASE/check.full.

Fix all this mess up so that all the check files for a specific run
end up in RESULT_BASE, and ensure the timing code checks the right
file and dumps output.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: use -F when making scratch ext4 fs
Josef Bacik [Fri, 26 Apr 2013 19:16:53 +0000 (19:16 +0000)]
xfstests: use -F when making scratch ext4 fs

mkfs.ext4 will ask you if you are sure if you try to mkfs an entire disk instead
of just a partition, so any xfstest that uses a scratch device and you specify a
full disk will appear to hang because it's waiting for you to say yes.  This
fixes the problem by just forcing it to do its thing.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: capture the failure result of 310
Zhao Hongjiang [Tue, 23 Apr 2013 03:13:32 +0000 (03:13 +0000)]
xfstests: capture the failure result of 310

Capture the failure by the way of counting dmesg errors and describe
how the test triggers problems.

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
[eguan@redhat.com fix common file path and other cleanups]
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com> Minor description changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix fio's arguments
Dmitry Monakhov [Mon, 15 Apr 2013 11:09:48 +0000 (11:09 +0000)]
xfstests: fix fio's arguments

Option 'group_reporting' semantics changed in recent fio versions.
In fact we do not need it here, let's just drop it.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: dump _require_fio output to log
Dmitry Monakhov [Mon, 15 Apr 2013 11:09:47 +0000 (11:09 +0000)]
xfstests: dump _require_fio output to log

This should help find incompatibility issues.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
10 years agoxfstests: fix common filter include in filter.btrfs
Eric Sandeen [Sun, 21 Apr 2013 22:51:54 +0000 (22:51 +0000)]
xfstests: fix common filter include in filter.btrfs

Not sure how this happened, but filter.btrfs including
itself leads to immense sadness for any file that includes it.
(I got a segfault when I tried to run 307)

It should be including ./common/filter not ./common/filter.btrfs

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: Remove dependence of xfs_check script
Chandra Seetharaman [Thu, 18 Apr 2013 17:44:02 +0000 (17:44 +0000)]
xfstests: Remove dependence of xfs_check script

Replace the usage of the script xfs_check and add the relevant code to
xfstests.

This is in preparation of the planned deprecation of xfs_check.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: make install support common/ and tests/ dirs
Wang Sheng-Hui [Fri, 12 Apr 2013 04:26:53 +0000 (04:26 +0000)]
xfstests: make install support common/ and tests/ dirs

xfstests have some change on the organization of the testcases
and common* files:
     * The common* scripts have been reorganized into the common/ dir.
     * The testcases have been reorganized into sub test dirs under tests/.
     * The run.* scripts have been removed.

This patch uses the simple way to make install support above changes:
     Make up one Makefile for each newly created subdirs, which can control
     'make install' separately.

v2 introduces the following changes compared with v1:
     * Ignore the file 'group' under the top dir, for it's useless in the new
       structures.
     * Remove the redundant comments in the Makefiles.
     * Use XXX_DIR instead of XXX_SUBDIR in the Makefiles under common/ and tests/.
     * Export TESTS_DIR in teh top level Makefile instead of tests/Makefile.
     * Obtain the names of dirs for testcases by iterating sub dirs under /tests,
       not by enumeration in tests/Makefile.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com Minor modification to Makefile]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: replace $seq.full with $seqres.full in ext4/305 and generic/308
Eryu Guan [Sun, 7 Apr 2013 10:39:06 +0000 (10:39 +0000)]
xfstests: replace $seq.full with $seqres.full in ext4/305 and generic/308

We use $seqres.full to record verbose output now, replace $seq.full with
$seqres.full in ext4/305 and generic/308.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: remove comments about creator in new
Eryu Guan [Sun, 7 Apr 2013 10:39:05 +0000 (10:39 +0000)]
xfstests: remove comments about creator in new

We have removed creator/owner info from each test case, remove the
'creator' comment in template too.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests generic 310: check concurrently of readdir and read on the same directory fd
Zhao Hongjiang [Wed, 3 Apr 2013 06:09:10 +0000 (06:09 +0000)]
xfstests generic 310: check concurrently of readdir and read on the same directory fd

Check if there are two threads,one keeps calling read() or lseek(), and
the other calling readdir(), both on the same directory fd.

Based on a testcase from Li Zefan <lizefan@huawei.com>.
http://marc.info/?l=linux-kernel&m=136123703211869&w=2

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com minor white space fixes and test renumbering]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests generic 309: test dir mtime and ctime are updated on rename
Eryu Guan [Mon, 1 Apr 2013 10:57:44 +0000 (10:57 +0000)]
xfstests generic 309: test dir mtime and ctime are updated on rename

Test directory mtime and ctime are updated when moving a file onto an
existing file in the directory

Regression test for commit:
0b23076 ext3: fix update of mtime and ctime on rename

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com renumbered test to next in group sequence]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests ext4 305: test read /proc/fs/ext4/<dev>/mb_groups while the fs is being...
Eryu Guan [Mon, 1 Apr 2013 10:57:43 +0000 (10:57 +0000)]
xfstests ext4 305: test read /proc/fs/ext4/<dev>/mb_groups while the fs is being unmounted

Regression test for commit:
9559996 ext4: remove mb_groups before tearing down the buddy_cache

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com renumbered test to next in group sequence]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests generic 308: test write to the last block of max file size on ext4
Eryu Guan [Mon, 1 Apr 2013 10:57:42 +0000 (10:57 +0000)]
xfstests generic 308: test write to the last block of max file size on ext4

On unpatched ext4 if an extent exists which includes the block right
before the maximum file offset, and the block for the maximum file
offset is written, the kernel panics.

On patched ext4, the write would get EFBIG since we lower s_maxbytes
by one fs block.

Regression test for commit:
f17722f ext4: Fix max file size and logical block counting of extent format file

Though it's an ext4 specific issue, it's no harm to run on all file
systems, so put it in generic.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com renumbered test to next in group sequence]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests generic 307: check ctime updates for setfacl
Eryu Guan [Mon, 1 Apr 2013 10:57:41 +0000 (10:57 +0000)]
xfstests generic 307: check ctime updates for setfacl

Check if ctime is updated and written to disk after setfacl

Regression test for the following extN commits
c6ac12a ext4: update ctime when changing the file's permission by setfacl
30e2bab ext3: update ctime when changing the file's permission by setfacl
523825b ext2: update ctime when changing the file's permission by setfacl

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
[rjohnston@sgi.com renumbered test to next in group sequence]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
11 years agoxfstests: cleanup duplicates in all tests
Rich Johnston [Wed, 3 Apr 2013 17:31:49 +0000 (17:31 +0000)]
xfstests: cleanup duplicates in all tests

There are duplicate blank lines, comment hash and lines
containing duplicate seqres= declarations, remove them.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
11 years agoxfstests: set correct seqres variable in new when creating test template
Eryu Guan [Mon, 1 Apr 2013 10:58:15 +0000 (10:58 +0000)]
xfstests: set correct seqres variable in new when creating test template

When setting seqres in the new script, '$' should be escaped,
otherwise seqres will be set to '/' not '$RESULT_DIR/$seq'

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>