xfstests-dev.git
8 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>
8 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>
8 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
--

9 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>
9 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>
9 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>
9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 years agoxfstests: fix common source file path
Eryu Guan [Fri, 29 Mar 2013 04:49:55 +0000 (04:49 +0000)]
xfstests: fix common source file path

After the re-factor, common.* have been renamed to common/* but there
are several files still look for the old path, fix it.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: use BTRFS_UTIL_PROG instead of btrfs
David Sterba [Thu, 28 Mar 2013 16:13:43 +0000 (16:13 +0000)]
xfstests: use BTRFS_UTIL_PROG instead of btrfs

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: check: set up config variables before using them
David Sterba [Thu, 28 Mar 2013 17:00:18 +0000 (17:00 +0000)]
xfstests: check: set up config variables before using them

HOSTOS was used in a test before being initialized and this led to
failed filesystem type detection.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: use _notrun for tape checks
Dave Chinner [Fri, 15 Mar 2013 12:28:09 +0000 (12:28 +0000)]
xfstests: use _notrun for tape checks

_require_tape is failing tests when no TAPE_DEV is specified. It
should be using _notrun for these cases rather than trying to open
code the $seqres.notrun magic file manipulations.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: clean up test 262 output file use.
Dave Chinner [Fri, 15 Mar 2013 12:28:08 +0000 (12:28 +0000)]
xfstests: clean up test 262 output file use.

Test 262 uses ${} notation for some variables, and so is resistant
to grep and sed matches. Change it to use the same notation as the
rest of xfstests and fix up the output file redirections made in
previous patches.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: Decomplicate quota setup in 050
Dave Chinner [Fri, 15 Mar 2013 12:28:07 +0000 (12:28 +0000)]
xfstests: Decomplicate quota setup in 050

Only test 050 uses the _qsetup function, and it only uses the ID
part of it in the test. The attempts to link output files is useless
as there are no different output files used by the test.

Hence kill the _qsetup function, and move the code into test 050,
simplifying it down to the minimum needed.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: RESULTS_DIR needs to be an absolute path
Dave Chinner [Fri, 15 Mar 2013 12:28:06 +0000 (12:28 +0000)]
xfstests: RESULTS_DIR needs to be an absolute path

Some tests 'cd <somedir>' and then direct output to $RESULT_DIR,
which fails if the current working directory is not $here.
Regardless, if an external results directory is to be used it needs
to have a full path specified and the use of $here as the base of
the results files is completely incorrect.

Hence change all the $here/$seqres* references to simply be
$seqres*, and instead encode the full path to the results in
$RESULT_DIR.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: Reintroduce configurable test expunging.
Dave Chinner [Fri, 15 Mar 2013 12:28:05 +0000 (12:28 +0000)]
xfstests: Reintroduce configurable test expunging.

It is definitely handy to be able to disabdle certain tests (e.g. tests that are
known to hang or crash the test machine on certain kernels), so re-introducing
the capability of avoiding certain tests just by placing them in a file is
useful.

Introduce a command line option to specify the expunged file name. The file will
exist in each tests/* sub-directory so that only the testname is required, and
can be managed independently. The use of a command line parameter allows
multiple expunge files to exist simultaneously in the one xfstests tree which
simplifies management of a source repository used for multiple versions of a
distro.

Typical usage:

$ cat tests/generic/3.0-stable-avoid
280
$ sudo ./check -X 3.0-stable-avoid generic/280
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 test-1 3.0.39-dgc+
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

generic/280     [expunged]
Passed all 0 tests
$

Eventually we should be able to automate setting up expunged files based on
distro release or kernel version through this infrastructure.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: introduce a common directory
Dave Chinner [Fri, 15 Mar 2013 12:28:04 +0000 (12:28 +0000)]
xfstests: introduce a common directory

Introduce a top level common directory and move all the common.*
files into it.  Because there is now a directory named common, the
prefix can be dropped from all the files. Convert all the tests to
use this new directory for including common files.

for f in common.*; do \
git mv `echo -n "$f " ; echo $f | sed -e 's;n\.;n/;'` \
done

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: fix _link_out_file callers
Dave Chinner [Fri, 15 Mar 2013 12:28:03 +0000 (12:28 +0000)]
xfstests: fix _link_out_file callers

Currently the callers pass $seq, rather than the full path to the
test. As a result, it creates the link in the top level directory
and it points nowhere.  Fix it to create the link in the correct
place.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: convert tests to use new results directory
Dave Chinner [Fri, 15 Mar 2013 12:28:02 +0000 (12:28 +0000)]
xfstests: convert tests to use new results directory

Essentially the change is simply this. Converting:

... >> $seq.????

to:

.... >> $RESULT_DIR/$seq.????

so that output files are directed to the defined output directory.

sed to the rescue:

$ sed -i -e '/^seq=.*$/a seqres=$RESULT_DIR/$seq' -e 's/seq.full/seqres.full/' tests/*/*

will do most of the work automatically.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: Introduce a results directory
Dave Chinner [Fri, 15 Mar 2013 12:28:01 +0000 (12:28 +0000)]
xfstests: Introduce a results directory

Currently each test gets it's sequence number from it's name. It
separates this from the path via basename, and uses it for
outputting full, notrun and other status/log files. Hence these end
up in the top level directory.

All these output files need to go somewhere other than the top level
directory. Right now the check script is looking for them in the new
test directories (e.g. for the notrun files), but it would be good
to be able to separate the test source form the test output.

Hence create an output directory which has a similar heirarchy to
the test source directory. Create it on demand when we build the
list of tests to run if it doesn't already exist.

Change the high level check script to set up this variable
appropriately for each test that is being run, and to use this new
output directory for it's result files as well. The next commit will
change all the tests themselves to use the new output directory.

This is the first (small) step in being able to store test results
in an external location for archival/data mining purposes.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com rm whitespace and fix typos in commit message]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: make exclude groups aware of multiple subdirectories
Dave Chinner [Fri, 15 Mar 2013 12:28:00 +0000 (12:28 +0000)]
xfstests: make exclude groups aware of multiple subdirectories

Now that there are no tests in the top level directory, the exlude
group functionality no longer works (-x group) as it cannot find
tests to build an initial list of tests. Rework the the exclude
group implementation to operate correctly on the new test locations.

Also, switch from sed to grep for exclusion because sed has problems
distnguishing the '/' in path names from regex control...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: rework CLI individual test specification
Dave Chinner [Fri, 15 Mar 2013 12:27:59 +0000 (12:27 +0000)]
xfstests: rework CLI individual test specification

Now that tests are in separate subdirectories, they cannot be selected purely by
test number on the command line. We need to specify the test by subdir and test
name, so effectively we move to specifying them by regexes on the command line
rather than by expanding a range internally. This is needed to support
non-numeric test names as well, so the change may as well be made here.

This means the command line parsing needs to change from trying to detect tests
by a regex match to a processing loop that simply parses the tests and checks
for there existence. Hence the moment we find an argument that is not a switch
(i.e no preceeding "-"), we move from the arg processing loop to the test name
processing loop. IOWs, tests must be specified last on the command line.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: move remaining tests out of top level directory
Dave Chinner [Fri, 15 Mar 2013 12:27:58 +0000 (12:27 +0000)]
xfstests: move remaining tests out of top level directory

These are tests that are shared between multiple filesystems (moved
to shared), and udf/btrfs/ext4 specific tests, moved to appropriate
directories.

I created the "shared" directory to indicate tests that are not
truly generic, but also not filesystem specific. They might rely on
a feature that is only implmented in a few filesystems and so can't
be truly generic.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: move xfs specific tests out of top directory
Dave Chinner [Fri, 15 Mar 2013 12:27:57 +0000 (12:27 +0000)]
xfstests: move xfs specific tests out of top directory

And into tests/xfs. Tests found and moved via:

$ grep "supported_fs xfs$" [0-2]* | cut -d : -f 1 > xfs.tests
$ for i in `cat xfs.tests`; do
> git mv $i* tests/xfs/
> grep ^$i group >> tests/xfs/group
> sed -i -e "/^$i/d" group
> done

Output now looks like:

 sudo ./check -g quick -r
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 test-1 3.5.0-rc5-dgc+
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

xfs/170  4s
generic/120      16s
generic/248      0s
generic/213      0s
generic/256      39s
xfs/121  6s
xfs/026  11s
generic/131      1s
xfs/187  1s
generic/135      0s
....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com did not move test 032, belongs in shared]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: move generic tests out of top level dir
Dave Chinner [Fri, 15 Mar 2013 12:27:56 +0000 (12:27 +0000)]
xfstests: move generic tests out of top level dir

And into tests/generic.  Tests were found simply by grepping for the
__supported_fs field in the tests.

Output starts to look like:

$ sudo ./check -g quick -r
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 test-1 3.5.0-rc5-dgc+
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

./242    1s
./183    2s
generic/236      1s
generic/014      1s
generic/258      0s
./096    1s
generic/245      0s
^C
Ran: ./242 ./183 generic/236 generic/014 generic/258 ./096 generic/245
Passed all 7 tests

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com added TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: remove 285.full and 286.full
Dave Chinner [Fri, 15 Mar 2013 12:27:55 +0000 (12:27 +0000)]
xfstests: remove 285.full and 286.full

These files are generated by the tests, they don't belong in
the repository.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: include test subdirectory support
Dave Chinner [Fri, 15 Mar 2013 12:27:54 +0000 (12:27 +0000)]
xfstests: include test subdirectory support

Create a specific tests/ subdirectory to hold all the tests so they
are no longer need to be in the top level directory. This patch does
not move any tests there, however, and that will be done in
subsequent commits.

The tests/ subdir will have it's own subdirectories for different
classes of tests. Initially, there will be a per-FSTYP subdirectory
for filesytsem specific tests, and a generic directory for tests
that span multiple filesystems.

Each class will have it's own group file to indicate what groups the
tests belong to, and these will be parsed appropriately by the high
level check script to build the test list.

The change in parsing results in the test output also emitting the
path to the test as well as the name of the test, instead of just a
raw number. This allows duplicate test names in the sudirecotries to
be unambiguous when the summary is written out.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: remove undocumented TESTS_REMAINING_LOG
Dave Chinner [Fri, 15 Mar 2013 12:27:53 +0000 (12:27 +0000)]
xfstests: remove undocumented TESTS_REMAINING_LOG

Undocumented and unused, AFAICT. Kill it.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: remove test expunge file support
Dave Chinner [Fri, 15 Mar 2013 12:27:52 +0000 (12:27 +0000)]
xfstests: remove test expunge file support

Check supports an expunge file for tests - a way of marking tests
not to run even if you specify it to run. Use is like this:

$ echo 002 > expunged
test-2:~/src/xfstests-dev$ sudo ./check 001-003
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 test-2 3.5.0-rc1-dgc+
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdb
MOUNT_OPTIONS -- /dev/vdb /mnt/scratch

001 4s ... 4s
002 - expunged
003 0s ... 0s
Ran: 001 002 003
Not run:1
Passed all 2 tests

This is arguably useful(*), but gets in the way of splitting up the
tests into multiple directories. Remove it for now, but such
functionality should be considered for re-implementation at a later
date.

(*) e.g. having a different "expunged" file for each distro release
you have to test to avoid the tests known to fail due to fixes or
features that will never be back ported to older releases....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: kill hangcheck stuff from check
Dave Chinner [Fri, 15 Mar 2013 12:27:51 +0000 (12:27 +0000)]
xfstests: kill hangcheck stuff from check

This is an old script from the auto-qa days back at SGI. It no
longer is in use or, AFAIK, ever been used for xfstests. If anyone
needs it, they can pull it back out of git, so lets remove it to
simplify check.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: clean up and simply check CLI option parsing
Dave Chinner [Fri, 15 Mar 2013 12:27:50 +0000 (12:27 +0000)]
xfstests: clean up and simply check CLI option parsing

The options are parsed in a messy loop of option parsing and
actions on secondary arguments. Turn it into something much neater
and easy to understand rather than a mess of temporary variables
and tortured logic...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com fixed typos in commit message]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: fold common into check
Dave Chinner [Fri, 15 Mar 2013 12:27:49 +0000 (12:27 +0000)]
xfstests: fold common into check

There is only one user of the common file now - check. Fold the two
into one file as the split of functionality is not necessary
anymore.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: remove stale machine configs
Dave Chinner [Fri, 15 Mar 2013 12:27:48 +0000 (12:27 +0000)]
xfstests: remove stale machine configs

Left over from the days of ASG, all stale. Remove them, leaving just
an simple example that defines all the variables that can be
configured. Also, add a localhost defined config set up for simple
KVM based guest test configs using virtio for their block devices to
simplify test setup in such scenarios..

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: kill useless test owner fields
Dave Chinner [Fri, 15 Mar 2013 12:27:47 +0000 (12:27 +0000)]
xfstests: kill useless test owner fields

Back many years ago, the owner field was used to email the test
owner when auto-qa failed that test. It is not needed anymore - if
you want to know who wrote the test, look it up in git....

Script used was:

$ sed -i -e "/^# creator/d" -e "/^owner/d" [0-3][0-9][0-9]

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com added TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: remove bench infrastructure
Dave Chinner [Fri, 15 Mar 2013 12:27:46 +0000 (12:27 +0000)]
xfstests: remove bench infrastructure

The benchmark framework inside xfstests is basically unused,
bitrotted and not very useful. If we need benchmarks, lets use a
real benchmark framework, not xfstests. Kill it to remove
dependencies on common and common.rc.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: remove remake script
Dave Chinner [Fri, 15 Mar 2013 12:27:45 +0000 (12:27 +0000)]
xfstests: remove remake script

We don't ever do wholesale rebuilds of the output files anymore, so
kill the script that does it to reduce the dependency on common and
common.rc.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: fix the seq number in README
Zhi Yong Wu [Sat, 23 Mar 2013 13:29:51 +0000 (13:29 +0000)]
xfstests: fix the seq number in README

Although it is one very trivial bug, one patch is worth to
make it perfect.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests 276: use _require_no_large_scratch_dev instead of the removed _require_nobig...
Wang Sheng-Hui [Thu, 21 Mar 2013 06:13:23 +0000 (06:13 +0000)]
xfstests 276: use _require_no_large_scratch_dev instead of the removed _require_nobigloopfs

_require_nobigloopfs has been removed.
We should use _require_no_large_scratch_dev in the test script.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: count journal size in test 289
Jan Kara [Wed, 20 Mar 2013 10:50:48 +0000 (10:50 +0000)]
xfstests: count journal size in test 289

Test 289 ignored the fact that historically journal is not accounted as
fs overhead in ext3. For larger filesystems it is hidden in 1% tolerance
but for filesystems smaller than 12G the test fails. So make the
counting precise to work everywhere.

CC: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[rjohnston@sgi.com: add lower case units to filter]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: add background noise to test 276 (btrfs backref resolving)
Jan Schmidt [Tue, 19 Mar 2013 16:24:20 +0000 (16:24 +0000)]
xfstests: add background noise to test 276 (btrfs backref resolving)

The backref resolver test for btrfs was run on a static file system so far.
Resolving backrefs on a busy file system is what happens in reality and that
is what should be checked by this test.

I added a parameter such that the script can easily be changed to the former
behavior for development purposes.

Furthermore, this increases two constants which make the test simply cycle a
few seconds longer, increasing the chance to hit on something suspicious in
case we broke something.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: correct quota file count for --large-fs
Dave Chinner [Fri, 15 Mar 2013 11:53:31 +0000 (11:53 +0000)]
xfstests: correct quota file count for --large-fs

The files used to fill space when using --large-fs contribute
towards the quota of uid 0. Modify the quota output filter in test
050 to "hide" these files from the test output.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: filter files in 019 for --large-fs
Dave Chinner [Fri, 15 Mar 2013 11:53:30 +0000 (11:53 +0000)]
xfstests: filter files in 019 for --large-fs

Make sure that the .use_space files don't appear in the files dumped
to the output files.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: exclude largefs fill files from dump tests
Dave Chinner [Fri, 15 Mar 2013 11:53:29 +0000 (11:53 +0000)]
xfstests: exclude largefs fill files from dump tests

The xfsdump/restore tests will see the space filling files and may
try to back them up and restore them, consuming huge amounts of time
to do (especially when diffing the results). Exclude the space
filling files by setting the no dump attributes on them and ensure
that xfsdump runs with the -e flag to exclude such files.

This also needs a dump filter addition to remove the output that
files were skipped, and to decrement the count of files processed by
xfsrestore because the inventory still includes excluded files.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: disable tests that typically fail on large filesystems
Dave Chinner [Fri, 15 Mar 2013 11:53:28 +0000 (11:53 +0000)]
xfstests: disable tests that typically fail on large filesystems

Test 017 typically fails due to the OOM killer kicking in and
killing everything but xfs_db so panics the machine.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: enable large fs testing on ext4
Dave Chinner [Fri, 15 Mar 2013 11:53:27 +0000 (11:53 +0000)]
xfstests: enable large fs testing on ext4

Now that setting up large filesystem testing on sparse loopback
devices uses a generic method for filling the filesystem, extent
support to ext4 filesystems.

ext4 is slightly more complex to fill as it does not support files
larger than 16TB. Hence a slightly more complex method of using
multiple smaller files to fill the space is necessary.

WARNING: be prepared for ext4 to take forever to prepare large
filesystems as allocation of large amounts of space (especially as
it approaches ENOSPC) is can take minutes rather than milliseconds

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: always use test option when checking large scratch device
Dave Chinner [Fri, 15 Mar 2013 11:53:26 +0000 (11:53 +0000)]
xfstests: always use test option when checking large scratch device

Some tests call _check_scratch_device directly and when using a
large filesystem this needs to run with a -t option to avoid
consuming large amounts of memory. Make this happen in all cases
that the scratch device is checked.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstest: enable xfs_repair for large filesystem testing
Dave Chinner [Fri, 15 Mar 2013 11:53:25 +0000 (11:53 +0000)]
xfstest: enable xfs_repair for large filesystem testing

Now that large filesystem testing does not play free space games to
fill the space without IO, we can enable xfs_repair when running in
this mode. xfs_repair has had it's scalability problems solved, too,
so this is a safe thing to do.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: use command line option for setting extra space
Dave Chinner [Fri, 15 Mar 2013 11:53:24 +0000 (11:53 +0000)]
xfstests: use command line option for setting extra space

Allow the extra free space to leave in large scratch filesystems to
be specified by a command line option rather than just via an
environment variable.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: use preallocation for ag-wiper
Dave Chinner [Fri, 15 Mar 2013 11:53:23 +0000 (11:53 +0000)]
xfstests: use preallocation for ag-wiper

To enable sane testing of large scale filesystems, the --large-fs
test option uses xfs_db magic to mark AGs full without doing any IO.
This leaves only a small amount of free space left in the filesystem
to stress the high AGs of the filesystem rather than the low AGs.

This method requires us to have special filesystem check options to
avoid free space checking in xfs_check, and we cannot current run
xfs_repair on such a filesystem at all. As it is, free space
checking on xfs_check does not scale, so we still need to avoid this
checking regardless of how we fill the filesystem.

We can achieve exactly the same fill behavior by preallocating a
single large file in the filesystem immediately after creating it.
This is a filesystem independent manner of filling the filesystem,
and allows us to do large filesystem testing on more than just XFS.

Further, this preallocation method effectively adds a new "very
large file" test. It also enables us to run an unmodified xfs_repair
or filesystem specific fsck program to check the filesystem for
sanity, so we can now do full sanity checking of such large
filesystems.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: rename RETAIN_AG_BYTES
Dave Chinner [Fri, 15 Mar 2013 11:53:22 +0000 (11:53 +0000)]
xfstests: rename RETAIN_AG_BYTES

Rename the $RETAIN_AG_BYTES variable to be more generic so that it
reflects the fact that it is designed to retain a certain amount of
extra free space above the default amount in the filesystem when
doing large scratch device testing.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: rename USE_BIG_LOOPFS to be more generic
Dave Chinner [Fri, 15 Mar 2013 11:53:21 +0000 (11:53 +0000)]
xfstests: rename USE_BIG_LOOPFS to be more generic

USE_BIG_LOOPFS is really misnamed - it can be used on real devices just as
easily as loop devices. It really means we are testing a large scratch device
and that we should enable the special filesystem filling and checking options
that enable xfstests to be run sanely on large XFS filesystems.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: add --largefs check option
Dave Chinner [Fri, 15 Mar 2013 11:53:20 +0000 (11:53 +0000)]
xfstests: add --largefs check option

Make it easier to check large filesystems quickly by adding a
--large-fs option to check to turn on shortcuts for large scratch
device filesystem testing.

Also, reject invalid command line options with a usage message.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: filter new repair/mkfs output for CRCs
Dave Chinner [Fri, 15 Mar 2013 11:53:19 +0000 (11:53 +0000)]
xfstests: filter new repair/mkfs output for CRCs

This patch it to ensure that xfstests passes on non-crc filesystems
with a CRC enabled userspace.

Filter out the mkfs/xfs_info CRC line from tests that capture the
output of these commands.

Filter out new error noise from xfs_repair that occurs for
xfs_repair as a result of the CRC changes.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: btrfs tests for basic informational commands
Eric Sandeen [Wed, 13 Mar 2013 19:01:58 +0000 (19:01 +0000)]
xfstests: btrfs tests for basic informational commands

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoRevert "xfstests: btrfs tests for basic informational commands"
Rich Johnston [Tue, 19 Mar 2013 13:13:12 +0000 (08:13 -0500)]
Revert "xfstests: btrfs tests for basic informational commands"

This reverts commit 2730c49a3e80426167e6f9984b070883dc51d4b6.

Test number was not sequential.

Conflicts:

group

9 years agoxfstests: enable test 032 (mkfs overwrite) for btrfs
Eric Sandeen [Wed, 13 Mar 2013 16:01:00 +0000 (16:01 +0000)]
xfstests: enable test 032 (mkfs overwrite) for btrfs

Now that btrfs has an "-f" arg, we can test that it doesn't
improperly overwrite other filesystems in 032 like we do
for xfs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: test writing to device node on an RO filesystem
Eric Sandeen [Fri, 15 Mar 2013 02:37:34 +0000 (02:37 +0000)]
xfstests: test writing to device node on an RO filesystem

We should be able to open device nodes for writing even
if they live on a readonly filesytem.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: btrfs tests for basic informational commands
Eric Sandeen [Wed, 13 Mar 2013 19:01:58 +0000 (19:01 +0000)]
xfstests: btrfs tests for basic informational commands

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: <rjohnston@sgi.com>
9 years agoxfstests: keep newlines out of SCRATCH_DEV_POOL
Eric Sandeen [Wed, 13 Mar 2013 14:57:02 +0000 (14:57 +0000)]
xfstests: keep newlines out of SCRATCH_DEV_POOL

SCRATCH_DEV_POOL processing actually takes the first
device out for SCRATCH_DEV and leaves the rest in
SCRATCH_DEV_POOL.

I'm not totally sold on that behavior, but for now,
at least don't populate SCRATCH_DEV_POOL with newlines.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: <rjohnston@sgi.com>
Signed-off-by: <rjohnston@sgi.com>
9 years agoxfstests: add 274 to the prealloc group
Eric Sandeen [Wed, 13 Mar 2013 14:57:01 +0000 (14:57 +0000)]
xfstests: add 274 to the prealloc group

test 274 does preallocation tests but is not in the prealloc group.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: <rjohnston@sgi.com>
Signed-off-by: <rjohnston@sgi.com>
9 years agoxfstests: determine path of logger
David Sterba [Mon, 11 Mar 2013 23:36:52 +0000 (23:36 +0000)]
xfstests: determine path of logger

The path of the syslog writer utility 'logger' is hardcoded and not
always correct, use set_prog_path.

Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests, aio-dio-extend-stat.c: fix error reporting
Jeff Moyer [Fri, 18 Jan 2013 22:01:57 +0000 (22:01 +0000)]
xfstests, aio-dio-extend-stat.c: fix error reporting

If we receive an unexpected result from an async write, the error
reporting does not tell the actual number of bytes written.  Fix that,
and also a couple of typos in printf's.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>