Commit Graph

2250 Commits

Author SHA1 Message Date
Dave Chinner 627427bb1b 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>
2013-05-03 09:22:13 -05:00
Dave Chinner e6c6abd6dc 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>
2013-05-03 09:22:13 -05:00
Dave Chinner 97540f14f7 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>
2013-05-03 09:22:12 -05:00
Zhao Hongjiang 45ed7bb0a4 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>
2013-04-23 08:43:55 -05:00
Dmitry Monakhov ca9fe94e2d 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>
2013-04-22 10:08:37 -05:00
Chandra Seetharaman 187bccd310 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>
2013-04-19 07:13:46 -05:00
Wang Sheng-Hui 2519a97d10 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>
2013-04-12 13:17:46 -05:00
Eryu Guan 2bfce6d36f 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>
2013-04-10 07:04:27 -05:00
Zhao Hongjiang bbaf78c01b 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>
2013-04-05 12:25:29 -05:00
Eryu Guan 797c82f0e2 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>
2013-04-05 08:26:47 -05:00
Eryu Guan f792273072 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>
2013-04-05 08:26:47 -05:00
Eryu Guan 94e1e7e53a 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>
2013-04-05 08:26:47 -05:00
Eryu Guan 6422b81838 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>
2013-04-05 08:26:47 -05:00
Rich Johnston 0efd4f4d48 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>
2013-04-04 06:55:21 -05:00
David Sterba 0edeaaab2a 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>
2013-03-28 16:36:25 -05:00
Dave Chinner af64c57be3 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>
2013-03-26 21:53:50 -05:00
Dave Chinner 9a3a7a1568 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>
2013-03-26 21:53:50 -05:00
Dave Chinner e5c7cd83c4 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>
2013-03-26 21:46:23 -05:00
Dave Chinner 8c4905a42e 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>
2013-03-26 21:44:05 -05:00
Dave Chinner 401680a11c 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>
2013-03-26 21:41:17 -05:00
Dave Chinner 1d5d46db80 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>
2013-03-26 21:38:47 -05:00
Dave Chinner 8ff10d6d1c 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>
2013-03-26 20:45:43 -05:00
Dave Chinner fc48dfb966 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>
2013-03-26 18:27:34 -05:00
Dave Chinner 797e625f28 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>
2013-03-26 11:43:49 -05:00
Dave Chinner 971fe108bb 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>
2013-03-26 10:40:20 -05:00