Commit Graph

1392 Commits

Author SHA1 Message Date
Dmitry Monakhov 903e29c330 xfstress: add regression testcase for d583fb87a3ff0
Should be fixed by following patch http://patchwork.ozlabs.org/patch/120883/

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov 091f517f47 xfstests: add a new quota test that runs fsstress under ENOSPC conditions
- Same as 264 but with quota enabled.
- IO performed from $qa_user user
- fsstress granted with CAP_CHOWN capability.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov 290d82e993 xfstests: add a new test that runs fsstress under ENOSPC conditions
During stress testing we want to cover as much code paths as possible
fsstress is very good for this purpose. But it has expandable nature
(disk usage almost continually grow). So once it goes in no ENOSPC
condition it will be where till the end. But by running 'dd' writers
in parallel we can regularly trigger ENOSPC but only for a limited
periods of time because each time it opens the same file with O_TRUNC.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov 32553be2e4 xfstests: add fiemap operation to fsstress
Related bug: http://patchwork.ozlabs.org/patch/118863

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov 96fb9f93ca xfstests: fsstress add FS_IOC_{SET,GET}FLAGS operations v2
Add two new operations:
- getattr: ioctl(fd, FS_IOC_GETFLAGS, &fl)
- setattr: ioctl(fd, FS_IOC_SETFLAGS, &random_flags)
Attribute mask may be passed via -M opt, by default is (~0).
By default FS_IOC_SETFLAGS has zero probability because
it may produce inodes with APPEND or IMMUTABLE flags which
are not deletable by default. Let's assumes that one who
enable it knows how to delete such inodes.
For example like follows:
find $TEST_PATH -exec chattr -i -a {} \;
rm -rf $TEST_PATH

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov dca63722ea xfstests: add fallocate support to fsstress
Add tests for fallocate(2) syscall
- fallocate: reserve the disk space
- punch: de-allocates the disk space
Since FALLOC_FL_PUNCH_HOLE is relatively new it's value defined
explicitly if not yet defined. Later we may clear that define.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov cce4481d15 xfstests: freeze fsstress options for 117'th
This is regression tescase for explicit combination of seed+fs_opts.
Let's hardcode all options to prevent interactions with fsstress
changes in future.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Dmitry Monakhov df3c057ccb xfstests: fsstress add command line style output for show_opts
Once some combination of seed+fs_ops result in regression it is
reasonable to document that combination. It is usefull to dump
that configuration in command line style. Later this line may be
simply hardcoded in to regression test.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 19:01:13 +00:00
Bill Kendall 868a3862a8 xfstests: refactor dump test argument parsing
The dump and restore helper functions all call the same _parse_args()
function. xfsdump and xfsrestore have some common options, but others
have different meanings/syntaxes or only exist in one program or the
other. Split _parse_args() into dump and restore variants.

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

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

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Bill Kendall e74bcb4240 xfstests: allow dump file name to be passed as arg
xfsdump tests using tapes (rather than files) can pass the tape pathname
to the dump/restore helper functions using the -f option. Change
_parse_args() so that this can be done for file-based tests as well, so
that they don't have to set the global 'dump_file' variable before doing
the dump or restore.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Bill Kendall 7768bf69fe xfstests: refactor xfsdump quota checking
Tests can enable/disable quota checking by passing -q or -Q to the
various dump and restore helper routines. But -q and -Q are valid
xfsdump/xfsrestore options, so in addition to being confusing, tests
cannot use these options. Use --check-quota and --no-check-quota
instead.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Bill Kendall dd9768d1d6 xfstests: refactor cumulative restore tests
The cumulative restore tests call _do_restore_file_cum(),
which requires a dump level to be passed in the -l option
in order to determine whether the restore directory needs
to be prepared or not. -l is not a valid xfsrestore option,
so doing things this way prevents tests from passing options
to xfsrestore. It's more straightforward to have the test
call _prepare_restore_dir itself prior to starting a series
of cumulative restores.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Bill Kendall a2a325756f xfstests: add 267 and 268 for multiple media files
This patch adds a couple of tests for xfsdump when multiple media files
are used. 267 tests the case where a file is split across multiple media
files, and 268 tests the case where a file ends on one media file and
the next media file starts on another file. These tests use a small
media file size (xfsdump -d) so that they don't rely on having to hit
end-of-tape.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Bill Kendall c9a6f22b9d xfstests: delay before dumps for incremental tests
To get reproducible results when testing incremental backups, files
contained in a backup should not have the same timestamp (at second
resolution) as the backup itself. If they do, those files will also
be included in the incremental backup, and this will likely cause
issues in the expected output of the test. This patch adds a sleep
to test 024 prior to doing the level 0 backup. The other incremental
tests already include similar delays.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Bill Kendall 8c125637c4 xfstests: add test 266 for testing xfsdump -D
Add a test for xfsdump -D, which skips unchanged directories during
an incremental backup. After doing an initial backup, a new file is
added to one directory (to verify that changed directories are
backed up) and several files are appended to. Then an incremental
backup is done with -D set. The test verifies the original and
restored filesystems match after applying the base and incremental
backups, and that the incremental restore output indicates that only
the one changed directory was backed up.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-03 10:16:13 +00:00
Dmitry Monakhov bd11e87d59 xfstests: fsstress should kill children tasks before exit
It is very hard to predict runtime for fsstress. In many cases it
is useful to give test to run a reasonable time, and then kill it.
But currently there is no reliable way to kill test without leaving
running children.
This patch add sanity cleanup logic which looks follow:
 - On sigterm received by parent, it resend signal to it's children
 - Wait for each child to terminates
 - EXTRA_SANITY: Even if parent was killed by other signal, children
   will be terminated with SIGKILL to preven staled children.

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

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:42 +00:00
Dmitry Monakhov e67879499e xfstests: add different logging option to fsstress
Currently the only way to log fsstress's output is to redirect it's shared
stdout to pipe which is very painfull because:

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

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

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:42 +00:00
Dmitry Monakhov e8f6c8e42e xfstests: fsstress dump inode info when possible
Fsstress exec behaviour is not completely determinated in case of
low resources mode due to ENOMEM, ENOSPC, etc. In some places we
call stat(2). This information may be halpfull for future
investigations purposes. Let's dump stat info where possible.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:42 +00:00
Anand Jain 2d0a5827e3 _populate_fs should use OPTIND when getopts is used
Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:42 +00:00
Anand Jain c05a8ba23f 265: Functional test case for the btrfs raid operations
This will verify the various raid features in btrfs and device
replacement functionality.

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:41 +00:00
Anand Jain c6c8f381b3 264: Functional test case for the btrfs snapshot
Create snapshots in various ways, modify the data around the block and
file boundaries and verify the data integrity.

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:41 +00:00
Anand Jain 27a067a7ca Added SCRATCH_DEV_POOL to specify multiple disks for the btrfs RAID
SCRATCH_DEV takes single disk as the scratch place for testing. New
SCRATCH_DEV_POOL can used to specify multiple disks for the scratch
btrfs filesystem.

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

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

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

    SCRATCH_DEV_POOL is unset and SCRATCH_DEV is unset
     . no change

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:41 +00:00
Anand Jain 2ef3d4e4c6 fill files with random data
snapshot data integrity test-case needs filesystem with random data.

Signed-off-by: Anand Jain <Anand.Jain@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:41 +00:00
Bill Kendall 26b97f0480 xfstests: add missing binaries to .gitignore
A clean checkout of xfstests followed by a build resulted in a long list
of untracked files. The current .gitignore ignores most binaries, but
the "dmapi" subdir was missed as were some binaries from the "src"
subdir.

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

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:41 +00:00
Eryu Guan 49fabdb4c1 xfstests: 075 112 redirect stderr of fsx to /dev/null too
In commit c18bf42de9 a warning message
will be printed to stderr if filesystem doesn't support fallocate(2).
The warning message will fail these tests though fsx returns SUCCESS.

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

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

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

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-02 21:04:41 +00:00