xfstests-dev.git
9 years agoxfstests: don't assume that falloc_punch implies falloc in test 255
Theodore Ts'o [Tue, 5 Mar 2013 17:59:42 +0000 (17:59 +0000)]
xfstests: don't assume that falloc_punch implies falloc in test 255

As of Linux 3.9-rc1, ext4 will support the punch operation on file
systems using indirect blocks, but it can not support the fallocate
operation (since there is no way to mark a block as uninitialized
using indirect block scheme).  This caused test 255 to fail, since it
only used _require_xfS_io_falloc_punch assuming that all file systems
which supported punch can also support fallocate.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests 276: fix error 'FIBMAP: Invalid argument'
Wang Sheng-Hui [Thu, 28 Feb 2013 02:05:56 +0000 (02:05 +0000)]
xfstests 276: fix error 'FIBMAP: Invalid argument'

Commit 05dadc0 ("Btrfs: add fiemap's flag check") added validity
checks to the fiemap flags and hence invalid flags are now being
rejected. Test 276 passes an invalid fiemap flag to btrfs, and so
that test fails since this commit was added.

Btrfs doesn't support FIEMAP_FLAG_XATTR, which is enabled by -x option
of filefrag, and will fail with
'FIBMAP: Invalid argument'
for 'filefrag -vx'. 'filefrag -vx' fails on btrfs with
     'FIEMAP failed with unsupported flags 2'
Remove the '-x' option.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests 273: fix a typo
Wang Sheng-Hui [Wed, 27 Feb 2013 06:47:54 +0000 (06:47 +0000)]
xfstests 273: fix a typo

Make the porter log cp failure into $seq.full by appending, not overwriting,
which can help debug.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: use right defrag program path
Zheng Liu [Fri, 1 Mar 2013 14:17:13 +0000 (14:17 +0000)]
xfstests: use right defrag program path

In _require_defrag defragmentation command path is fixed.  That will
cause that this test case is skipped in some distributions.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: add disk failure simulation test
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:15 +0000 (10:42 +0000)]
xfstests: add disk failure simulation test

There are many situations where disk may fail for example
1) brutal usb dongle unplug
2) iscsi (or any other netbdev) failure due to network issues
In this situation filesystem which use this blockdevice is
expected to fail(force RO remount, abort, etc) but whole system
should still be operational. In other words:
1) Kernel should not panic
2) Memory should not leak
3) Data integrity operations (sync,fsync,fdatasync, directio) should fail
   for affected filesystem
4) It should be possible to umount broken filesystem

Later when disk becomes available again we expect(only for journaled filesystems):
5) It will be possible to mount filesystem w/o explicit fsck (in order to catch
   issues like https://patchwork.kernel.org/patch/1983981/)
6) Filesystem should be operational
7) After mount/umount has being done all errors should be fixed so fsck should
   not spot any issues.

This test use fault injection (CONFIG_FAULT_INJECTION=y,
CONFIG_FAIL_MAKE_REQUEST=y and CONFIG_FAULT_INJECTION_DEBUG_FS=y config
options) to force all new IO requests to fail for a given device. Xfs
already has XFS_IOC_GOINGDOWN ioctl which provides similar behavior, but it
is fs specific and it does it in an easy way because it performs freeze_bdev()
before actual shutdown.

Test run fsstress in background and then force disk failure.
Once disk failed it check that (1)-(4) is true.
Then makes disk available again and check that (5)-(7) is also true

BE CAREFUL!! test known to cause memory corruption for XFS
see: https://gist.github.com/dmonakhov/4953045

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 agoxfstest: add defragmentation stress tests for ext4
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:14 +0000 (10:42 +0000)]
xfstest: add defragmentation stress tests for ext4

Perform various regression tests for ext4defrag subsystem

 301'th Test1: Defragment file while other task does direct AIO
 302'th Test2: Perform defragmentation on file under buffered AIO
  while third task does direct AIO to donor file
 303'th Test3: Two defrag tasks use common donor file.
 304'th Test4: Stress defragmentation. Several threads perform
  fragmentation at random position use inplace=1 will
allocate and free blocks inside defrag event improve
load pressure.

This tests are considered dangerous because 302'th and 303'th are known
to trigger OOPS on recent kernels see:https://gist.github.com/dmonakhov/4770294

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 agoxfstest: add fallocate/punch_hole vs AIO/DIO stress test
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:13 +0000 (10:42 +0000)]
xfstest: add fallocate/punch_hole vs AIO/DIO stress test

Run random AIO/DIO activity (fio's job:direct_aio_raicer)
random fallocate activity(fio's job:falloc_raicer)
and random punch_hole activity(punch_hole_raicer) on a common
file in parallel. If a race exists, old dio request may rewrite
punched block after it was allocated to another file, we will
catch that by verifier fio's job: "aio-dio-verifier".

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 agoxfstest: add fallocate/truncate vs AIO/DIO stress test
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:12 +0000 (10:42 +0000)]
xfstest: add fallocate/truncate vs AIO/DIO stress test

Run DIO, fallocate and truncate threads on a common file in parallel.
If a race exists, the old dio request may rewrite blocks after it was
allocated to another file, we will catch that by verifying blocks content.

this patch known to catch deadlock for ext4
http://lists.openwall.net/linux-ext4/2012/09/06/3

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 agoxfstest: move run_check to common.rc
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:11 +0000 (10:42 +0000)]
xfstest: move run_check to common.rc

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Move run_check to common.rc.

9 years agoxfstest: allow fsstress to use load factor where appropriate
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:10 +0000 (10:42 +0000)]
xfstest: allow fsstress to use load factor where appropriate

1) Add _scale_fsstress_args function which transform arguments according
   to load factors
2) Let all non deterministic fsstress tests to use scaled arguments

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: hardcode fops for determinable fsstests runs
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:08 +0000 (10:42 +0000)]
xfstests: hardcode fops for determinable fsstests runs

106,107 and 117 are frozen tests which use known seed, it is
reasonable to explicitly hardcode file operations in order to avoid
implicit changes caused by future changes in fsstress.

NOTE: options generated like follows: fsstress -S c $ORIG_ARGS

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 agoxfstest: add configurable load factors
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:07 +0000 (10:42 +0000)]
xfstest: add configurable load factors

Most stress test has probable behavior, the longer test run the
larger corner cases will be cover. It is reasonable to allow
user to provide some sort of system load factor.
This patch introduce two global variables
LOAD_FACTOR: Usually means factor number of running tasks
TIME_FACTOR: Usually means factor of run time, or number of operations
If not specified both variables defined to 1, so original behavior
preserved.

TODO: Change all stress tests to use this variables

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: add fio requirement V2
Dmitry Monakhov [Wed, 20 Feb 2013 10:42:06 +0000 (10:42 +0000)]
xfstests: add fio requirement V2

FIO is very flexible io generator, I would call it IO swiss knife.
Currently we have tons of hardcoded application which reproduces
some predefined scenario. This approach has obvious disadvantages
1) Lack of flexibility: one written it is hard to modify it in future
2) Code base is large, many routines written again and again

At the same time add new fio based test, just add simple INI file.
This greatly simplifies code review. I do believe that some day we will
replace most of hardcoded io binaries with fio.

One who is planning to run $FIO_PROG should first check that system
contains appropriate version which is able to handle jobfile
for example:  _require_fio 286-job.fio

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: 298: Test that FS sends discard requests only on free blocks
Tomas Racek [Sun, 3 Feb 2013 10:19:58 +0000 (10:19 +0000)]
xfstests: 298: Test that FS sends discard requests only on free blocks

V1->V2: Change way of testing suggested by Dave Chinner
1. Create image file with FS on it
2. Call fstrim to discard free blocks
3. Check that every punched hole in the image file is in the area
   that is marked as free

Signed-off-by: Tomas Racek <tracek@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: Add new standard loop handling functions
Tomas Racek [Tue, 12 Feb 2013 09:21:59 +0000 (09:21 +0000)]
xfstests: Add new standard loop handling functions

Add _create_loop_device and _destroy_loop_device to uniformly handle
loopback devices.

V1->V2: Fix possible race

Signed-off-by: Tomas Racek <tracek@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: Provide dumpe2fs via standard common.config interface
Tomas Racek [Sun, 3 Feb 2013 10:19:56 +0000 (10:19 +0000)]
xfstests: Provide dumpe2fs via standard common.config interface

dumpe2fs can be now accessed via $DUMPE2FS_PROG, tests that require it
can check for its availability by _require_dumpe2fs function.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests 297: test xfs direct IO nested transaction deadlock
Eryu Guan [Tue, 19 Feb 2013 04:15:28 +0000 (12:15 +0800)]
xfstests 297: test xfs direct IO nested transaction deadlock

Regression test case for commit:

437a255 xfs: fix direct IO nested transaction deadlock.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: Refactor release scripts to conform to using git archive
Andrew Dahl [Mon, 14 Jan 2013 18:17:09 +0000 (12:17 -0600)]
xfstests: Refactor release scripts to conform to using git archive

Refactored release scripts to conform to using git archive

When generating a release, there is a risk of some files being
stale, such as configure and the m4/autotools temp files. This
is fixed with a clean at the beginning of release generation.
In addition, there is no uniformity in the current method of
source tar generation between xfs utilities. Using git archive
solves this issue across all utilities.

Signed-off-by: Andrew Dahl <adahl@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: test dump/restore of file capabilities
Eric Sandeen [Fri, 4 Jan 2013 00:05:23 +0000 (18:05 -0600)]
xfstests: test dump/restore of file capabilities

xfsrestore isn't properly restoring file capabilities; it restores
them, but then chowns the file, which removes the caps:

Call Trace:
 [<ffffffffa028de68>] xfs_xattr_set+0x118/0x120 [xfs]
 [<ffffffff8119a8c0>] generic_removexattr+0x80/0x90
 [<ffffffff8120b408>] cap_inode_killpriv+0x28/0x30
 [<ffffffff8120c666>] security_inode_killpriv+0x16/0x20
 [<ffffffff81192edf>] notify_change+0x18f/0x330
 [<ffffffff81176b70>] chown_common+0x60/0xa0
 [<ffffffff81176c30>] sys_fchown+0x80/0xd0
 [<ffffffff81537c59>] system_call_fastpath+0x16/0x1b

This test demonstrates the problem.

Reported-by: fugazzi® <fugazzi99@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: SGI license update for looptest.c
Andrew Dahl [Tue, 8 Jan 2013 18:23:08 +0000 (12:23 -0600)]
xfstests: SGI license update for looptest.c

Updated SGI license in looptest.c

Signed-off-by: Andrew Dahl <adahl@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: test multiply-logged inodes & continued transactions
Eric Sandeen [Wed, 2 Jan 2013 22:28:32 +0000 (16:28 -0600)]
xfstests: test multiply-logged inodes & continued transactions

New test for 2 xfs_logprint error cases:

As xlog_print_trans_inode() stands today, it will error
out if more than one flag is set on f->ilf_fields:

xlog_print_trans_inode: illegal inode type

but this is a perfectly valid case, to have i.e. a data and
an attr flag set.

and:

xlog_print_trans_inode() has a special case for 2
specific op_head->oh_len lengths.  If it matches
sizeof(xfs_inode_log_format_32_t) or
sizeof(xfs_inode_log_format_64_t), it assumes that
it's got an inode, and attempts to convert it and
print it accordingly.

However, if we arrive here via an op header which
is continued, then the length is simply a continuation
of the previous op, and it might *randomly* match the
size of one of the inode log formats, and thus get parsed
incorrectly.

Test both of these cases.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: Change the interpreter of ltp/runtest.sh to bash
Satoru Takeuchi [Sun, 9 Dec 2012 23:37:41 +0000 (08:37 +0900)]
xfstests: Change the interpreter of ltp/runtest.sh to bash

In some environment, Running 080 fails with many errors.

It happens because ltp/rwtest.sh assumes /bin/sh is `bash' and it's not
always true (ex. /bin/sh is `dash' in Debian.) This script should
explicitly declare that its interpreter is `bash'.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: fix 284 ENOENT error
Liu Bo [Sun, 6 Jan 2013 14:30:38 +0000 (22:30 +0800)]
xfstests: fix 284 ENOENT error

284 misses a 'mkdir' operation.

Signed-off-by: Liu Bo <liub.liubo@gmail.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: test EROFS vs. EEXIST when creating on an RO filesystem
Eric Sandeen [Wed, 9 Jan 2013 16:17:59 +0000 (10:17 -0600)]
xfstests: test EROFS vs. EEXIST when creating on an RO filesystem

TBH, I don't know if this is posix-specified, but I found out the
hard way that when trying to re-create existing files on a readonly
filesystem, some apps expect/handle EEXIST, but fail on EROFS.

This will test mkdir, mknod, and symlinks for that behavior.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: move _filter_ln to common.filter
Eric Sandeen [Wed, 9 Jan 2013 16:13:26 +0000 (10:13 -0600)]
xfstests: move _filter_ln to common.filter

Move test 103's _filter_ln to common.filter and make
it more generic (not depending on 103's pathnames).

TBH I've lost my children's treasury of ln failure
messages, so I'm not sure this catches all variants;
it's hard to work backwards from the existing sed script
to what the various outputs were.  This works for me
but might need more tweaking on other systems.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: Change the diff output of failed tests
Lukas Czerner [Tue, 10 Apr 2012 08:38:33 +0000 (10:38 +0200)]
xfstests: Change the diff output of failed tests

Currently the entire diff is printed to the stdout in the case that the
test output template differs from the actual test run. However in some
cases the diff can be _very_ long. This commit changes it so that we
print only first 10 lines of the diff.

Also indent the diff output from the left by four spaces for better
output readability.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: ensure all xfs_io commands are documented in the manpage
Eric Sandeen [Sat, 8 Dec 2012 20:58:55 +0000 (20:58 +0000)]
xfstests: ensure all xfs_io commands are documented in the manpage

Ensure that all commands listed in "xfs_io -c help" are
documented in the xfs_io(8) manpage.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
9 years agoxfstests: Ensure cmdline geometry puts mkfs.xfs into multidisk mode
Eric Sandeen [Thu, 6 Dec 2012 22:02:16 +0000 (16:02 -0600)]
xfstests: Ensure cmdline geometry puts mkfs.xfs into multidisk mode

Ensure that when mkfs.xfs is invoked with commandline geometry, it
triggers multidisk mode and creates more AGs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: Use qa_user and qa_group for test 219
Jan Kara [Tue, 18 Dec 2012 10:35:50 +0000 (11:35 +0100)]
xfstests: Use qa_user and qa_group for test 219

Test 219 requires a special user. Use $qa_user and $qa_group (added in this
patch) for that purpose instead of hardcoded uid & gid. This also fixes
a false failure when repquota does not report quota for users not in passwd.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: _fail in _scratch_mkfs_sized if device is too small
Eric Sandeen [Thu, 29 Nov 2012 18:47:22 +0000 (12:47 -0600)]
xfstests: _fail in _scratch_mkfs_sized if device is too small

Without this, 273 was failing in cryptic ways for me
if the device size was < 2G.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: update version and changelog
Ben Myers [Wed, 12 Dec 2012 17:10:11 +0000 (11:10 -0600)]
xfstests: update version and changelog

Update the version and changelog for xfstests-1.1.1 release.

Signed-off-by: Ben Myers <bpm@sgi.com>
Reviewed-by: Nathan Scott <nathans@debian.org>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: update XFS_IOC_ZERO_RANGE byte range test output
Dave Chinner [Thu, 29 Nov 2012 04:27:23 +0000 (15:27 +1100)]
xfstests: update XFS_IOC_ZERO_RANGE byte range test output

Kernel code now does true byte range zeroing. Update the tests to
validate true byte range zeroing correctly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Andrew Dahl <adahl@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoRevert "xfstests: resolve symlinked devices to real paths"
Rich Johnston [Wed, 28 Nov 2012 15:02:10 +0000 (09:02 -0600)]
Revert "xfstests: resolve symlinked devices to real paths"

This reverts commit d5ea873fcbf00b841f0511a26fb341364a5c6425 which overrode
0a818862bb74932e15971ec8bedb55765ec3a3f6 xfstests: support post-udev device
mapper node.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
9 years agoRevert "xfstests: fix to build src/realpath and the correct the existence of target...
Rich Johnston [Wed, 28 Nov 2012 14:46:39 +0000 (08:46 -0600)]
Revert "xfstests: fix to build src/realpath and the correct the existence of target devices"

This reverts commit b03c662399956609934ff063e9064e15dc7459ac which overrode
the 0a818862bb74932e15971ec8bedb55765ec3a3f6 xfstests: support post-udev
device mapper node.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: resolve compiler warnings
Rich Johnston [Fri, 9 Nov 2012 13:24:01 +0000 (13:24 +0000)]
xfstests: resolve compiler warnings

This patch resolves the following compiler/configure warnings:

 configure: WARNING: unrecognized options: --enable-lib64
 warning: 'xxxx' may be used uninitialized in this function [-Wuninitialized]
 warning: variable 'xxx' set but not used [-Wunused-but-set-variable]
 warning: call to function 'foo' without a real prototype [-Wunprototyped-calls]

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
9 years agoxfstests: remove unused conditional NO_XFS
Rich Johnston [Fri, 9 Nov 2012 13:24:00 +0000 (13:24 +0000)]
xfstests: remove unused conditional NO_XFS

This patch removes the unused conditional NO_XFS which was added with
commit 332ee29d1ab7a8690ca8f6d06b0d116e3a4a4f0f:
  "xfstests updates - rework build to be like other xfs packages ..."

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
9 years agoxfstests: remove unsupported conditionals
Rich Johnston [Fri, 9 Nov 2012 13:23:59 +0000 (13:23 +0000)]
xfstests: remove unsupported conditionals

This patch removes the unsupported sgi and CRAY.

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
9 years agoxfstests: fix to build src/realpath and the correct the existence of target devices
sat [Mon, 19 Nov 2012 03:26:54 +0000 (03:26 +0000)]
xfstests: fix to build src/realpath and the correct the existence of target devices

Hi Rich, Eric

(2012/10/27 1:46), Rich Johnston wrote:
> On 06/08/2010 03:03 PM, Eric Sandeen wrote:
>> If you try running xfstests on lvm volumes which are symlinks,
>> it'll fail to run several tests because our _require_scratch
>> framework ultimately uses lstat not stat, and does not think
>> the lvm device (which is usually a symlink to a dm-X device)
>> is a block device.  Sigh.
>>
>> Last try at this - just resolve any symlinked devicenames
>> into their realpath(3) in common.config.
>>
>> This actually seems to work.
>>
>> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
>>
>> ---
>>
>>
>> diff --git a/common.config b/common.config
>> index 926846b..e5b2483 100644
>> --- a/common.config
>> +++ b/common.config
>
> Looks good
>
> Reviewed-by: Rich Johnston <rjohnston@sgi.com>
>
> Eric,
>
> This patch has been committed to git://oss.sgi.com/xfs/cmds/xfstests, master branch, commit ID d5ea873f.

From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Commit d5ea873f is not the same as the the following original Eric's patch.

http://oss.sgi.com/archives/xfs/2010-06/msg00080.html

It does not modify src/Makefile and realpath is never compiled.

In addition, `[ -L $TEST_DEV ]' and `[ -L $SCRATCH_DEV ]' always returns 0
if $TEST_DEV or $SCRATCH_DEV are not defined.

Cc: Eric Sandeen <sandeen@sandeen.net>
Cc: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstest 291: userspace vs. fragmented multiblock dir2
Eric Sandeen [Wed, 6 Jun 2012 02:29:49 +0000 (02:29 +0000)]
xfstest 291: userspace vs. fragmented multiblock dir2

Current xfs_repair is unhappy with fragmented multiblock
v2 directories.  This test shows it ... patches to fix
it soon to follow.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
9 years agoxfstests: xfs_tosspages() test addition
Andrew Dahl [Wed, 14 Nov 2012 18:57:35 +0000 (18:57 +0000)]
xfstests: xfs_tosspages() test addition

Tests the XFS_IOC_ZERO_RANGE ioctl by way of the "xfs_io zero" utility
to ensure it is tossing the expected ranges.

The ranges tested are [0,1] [0,4095] [0,4096] [0,4097] [4095,8191]
  [4095,8192] [4095,8193] [4096,8192] [1024,4096]

Signed-off-by: Andrew Dahl <adahl@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
9 years agoxfstests: get return value in seek_sanity_test
wenqing.lz [Sun, 21 Oct 2012 13:15:09 +0000 (13:15 +0000)]
xfstests: get return value in seek_sanity_test

In seek_sanity_test getting return value is missing. Thus we couldn't
get the result unless someone read the log file (e.g. # 285).

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
9 years agoRevert "xfstests: optionally run all tests under quota"
Rich Johnston [Tue, 6 Nov 2012 20:23:59 +0000 (14:23 -0600)]
Revert "xfstests: optionally run all tests under quota"

Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
This reverts commit edd6bcf9c478036df9056df05924f791a0d322dd which caused
the following tests to fail:

142.out.bad:Can't initialize the DMAPI
143.out.bad:Can't initialize the DMAPI
144.out.bad:Can't initialize the DMAPI
145.out.bad:Can't initialize the DMAPI
146.out.bad:Can't initialize the DMAPI
147.out.bad:Can't initialize the DMAPI
150.out.bad:Can't initialize the DMAPI
155.out.bad:Can't initialize the DMAPI
156.out.bad:Can't initialize the DMAPI
157.out.bad:Can't initialize the DMAPI
158.out.bad:Can't initialize the DMAPI
161.out.bad:Can't initialize the DMAPI
168.out.bad:Can't initialize the DMAPI
175.out.bad:Can't initialize the DMAPI
176.out.bad:Can't initialize the DMAPI
185.out.bad:Can't initialize the DMAPI

9 years agoxfstests: Update .gitignore
Ben Myers [Tue, 30 Oct 2012 22:12:52 +0000 (17:12 -0500)]
xfstests: Update .gitignore

Root entries to where they only can occur.

Add patches/ and .pc/ for quilt.

Add /src/seek_copy_test and /src/seek_sanity_test.

Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
9 years agoxfstests: build: use new autoconf constructs
Jan Engelhardt [Tue, 30 Oct 2012 22:12:51 +0000 (17:12 -0500)]
xfstests: build: use new autoconf constructs

Looks like AC_CONFIG_FILES existed since 2.14 already.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests 250: remove unwanted new line in 250.out
Eryu Guan [Fri, 19 Oct 2012 03:44:44 +0000 (03:44 +0000)]
xfstests 250: remove unwanted new line in 250.out

Additional new line at the end of 250.out will fail the test, remove it.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: test ext4 statfs
Eric Sandeen [Thu, 25 Oct 2012 17:19:24 +0000 (17:19 +0000)]
xfstests: test ext4 statfs

Calculating free blocks in ext[234] is surprisingly hard, since
by default we report "bsd" style df which doesn't count filesystem
"overhead" blocks as used.

With a lot of code dedicated to sorting out what to report as
free, things tend to go wrong surprisingly often.

Here's a test to actually try to stop the next regression.  ;)

NB: For bsddf, the kernel currently does not count journal blocks
as overhead; it probably should.  But the test below looks to have
the result within 1% of perfection, so it still passes even if
the kernel doesn't count the journal against free blocks.

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: more 214 updates
Eric Sandeen [Tue, 12 Jan 2010 23:16:53 +0000 (23:16 +0000)]
xfstests: more 214 updates

A few more updates for the 214 fallocate test, since
ext4 is having some fallocate trouble these days.

First off, updated 214.out was missing from the previous
commit to this file.

Second, run each test against a new filename and don't
remove it, so that the post-test fs check will have
more work to do.

Third, and a newly-found corruption case for ext4.

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: optionally run all tests under quota
Eric Sandeen [Tue, 9 Feb 2010 19:26:31 +0000 (19:26 +0000)]
xfstests: optionally run all tests under quota

This patch might be a little heavy handed, but it seems to
work; if you set USE_QUOTA=1 in your environment, all
tests should be run with quota on and enabled.

This will hopefully help shake out some of the ext4
quota problems, although one needs to keep an eye
on the console to see whether warnings scroll by.

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: resolve symlinked devices to real paths
Eric Sandeen [Tue, 8 Jun 2010 20:03:39 +0000 (20:03 +0000)]
xfstests: resolve symlinked devices to real paths

If you try running xfstests on lvm volumes which are symlinks,
it'll fail to run several tests because our _require_scratch
framework ultimately uses lstat not stat, and does not think
the lvm device (which is usually a symlink to a dm-X device)
is a block device.  Sigh.

Last try at this - just resolve any symlinked devicenames
into their realpath(3) in common.config.

This actually seems to work.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: add local.config example
Eric Sandeen [Thu, 16 Sep 2010 18:07:47 +0000 (18:07 +0000)]
xfstests: add local.config example

I think it'd be useful to have a local.config template in the
git repo, to avoid having to re-read the README each time
to remember the required environment variable names.

Thoughts?  Am I just lazy?  :)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
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: Assume yes when test device is not partitioned
Prasad Joshi [Sat, 3 Sep 2011 08:33:19 +0000 (08:33 +0000)]
xfstests: Assume yes when test device is not partitioned

If an entire device used for file system creation, the mkfs.ext2/3/4
asks for confirmation before proceeding. Since the device is
configured for testing it is safe to assume positive response
during mkfs.

The patch also replaces hard coded mkfs path with MKFS_PROG variable.

Signed-off-by: Chaitanya Kulkarni <chaitanyakulkarni15@gmail.com>
Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: rename configure.in to configure.ac
Ben Myers [Thu, 25 Oct 2012 18:08:07 +0000 (13:08 -0500)]
xfstests: rename configure.in to configure.ac

configure.in has been renamed to configure.ac.  Update the Makefile.

Signed-off-by: Ben Myers <bpm@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
9 years agoxfstests: install shared libs with +x bits
Mike Frysinger [Mon, 24 Sep 2012 23:39:38 +0000 (19:39 -0400)]
xfstests: install shared libs with +x bits

These are shared libs w/executable code, so make sure they have +x bits
set on them.  Some kernels will proactively disallow executable mmaps if
the files lack +x bits.  It's also the right thing to do.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: respect DESTDIR when installing
Mike Frysinger [Mon, 24 Sep 2012 23:39:37 +0000 (19:39 -0400)]
xfstests: respect DESTDIR when installing

This makes the `make install DESTDIR=...` form work.  It keeps support
for all previous forms too (like DIST_ROOT).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: rename configure.in to configure.ac
Mike Frysinger [Mon, 24 Sep 2012 23:39:36 +0000 (19:39 -0400)]
xfstests: rename configure.in to configure.ac

Newer autotools warn and start to error with the older name.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: Do not allow step to be zero
Lukas Czerner [Tue, 16 Oct 2012 09:41:34 +0000 (09:41 +0000)]
xfstests: Do not allow step to be zero

Currently 'step' variable which is used as length of the range to
discard can be zero. However it would result in error returned by the
fstrim.

Fix this by forcing 'step' to be at least 4KB.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests: Test FITRIM where length is smaller than FSB
Lukas Czerner [Tue, 16 Oct 2012 09:41:33 +0000 (09:41 +0000)]
xfstests: Test FITRIM where length is smaller than FSB

This tests corner case in FITRIM implementation where range size is
smaller than file system block or zero. In this case FITRIM should fail
with EINVAL.

The problem was spotted in xfs and ext4 where in case of length = 0 the
'end' variable underflowed. In case of length smaller than 1 FSB FITRIM
finished successfully, but we really should rather return EINVAL in both
cases.

(This patch has to be applied after 'Use upstream version of fstrim
instead of the local one')

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoUse upstream version of fstrim instead of the local one
Tomas Racek [Tue, 9 Oct 2012 13:24:10 +0000 (13:24 +0000)]
Use upstream version of fstrim instead of the local one

Local version of fstrim was dropped so that we depend on upstream
version which is now available via FSTRIM_PROG. _require_fstrim was
added to check if fstrim is available in the system and
_test_batched_discard to check if we can run fstrim on certain
mountpoint.

Also tests 251 and 260 were modified to reflect this change.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
9 years agoxfstests 068: Add mmap load
Eric Sandeen [Fri, 28 Sep 2012 03:33:45 +0000 (03:33 +0000)]
xfstests 068: Add mmap load

Test 068 is the go-to test for freeze deadlock coverage;
unfortunately it only uses fsstress, which doesn't do any
mmap IO.

Using the existing fstest binary gets us a cheap mmap
exerciser as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
9 years agoxfstests: fix a compile warning at seek_sanity_test.c
Jeff Liu [Sat, 2 Jun 2012 14:33:06 +0000 (14:33 +0000)]
xfstests: fix a compile warning at seek_sanity_test.c

Fix the compiler report warning at seek_sanity_test.c:
seek_sanity_test.c:46:3: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'int'

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
9 years agoxfstests: improve test 286 for repeated unwritten/hole extents.
Jeff Liu [Tue, 3 Jul 2012 15:41:10 +0000 (15:41 +0000)]
xfstests: improve test 286 for repeated unwritten/hole extents.

Enlarge the test coverage of 286 to includes file mapping with repeated
hole/unwritten/unwritten_without_data/data intersections.

Those two new sub-tests could help verifying the current seek_data/seek_hole
improvements.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
 286 |   87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 86 insertions(+), 1 deletion(-)

9 years agoxfstests: add _require_freeze and minor cleanups
Eric Sandeen [Wed, 19 Sep 2012 22:53:56 +0000 (17:53 -0500)]
xfstests: add _require_freeze and minor cleanups

More filesystems have grown freeze capability, so rather than
hardcoding several in _supported_fs, make tests 068 and 280
generic and then add a new _require_freeze() which checks whether
the fs under test can be frozen before beginning the test.

Minor other cleanups to 280:
- remove extra _supported_fs line
- clear $seq.full before beginning

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
9 years agoxfstests: 275, Don't remove all the files in SCRATCH_MNT.
Tao Ma [Fri, 14 Sep 2012 11:03:12 +0000 (19:03 +0800)]
xfstests: 275, Don't remove all the files in SCRATCH_MNT.

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

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

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

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

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

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

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

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

Conflicts:
285
285.out
group

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Introduce 286 for SEEK_DATA/SEEK_HOLE copy tests.

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

Introduce 285 for SEEK_DATA/SEEK_HOLE sanity tests.

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

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

Add three tests for verifying compatibility with xfsdump format 2.

Test 281 generates a format 2 dump and restores it.

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

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

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

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

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

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

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

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

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

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

Add 2 new test groups:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

With this patch, 251 has passed.

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

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

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

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

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

2 little fixes to common scsi_debug handling.

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

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

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

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

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

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

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

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>