Commit Graph

2201 Commits

Author SHA1 Message Date
Eryu Guan d3e4857602 check: treat _check_{test,scratch}_fs failures as test failures
Currently if _check_test_fs and/or _check_scratch_fs find corruption,
the test itself is still reported as pass, like

	[root@hp-dl388eg8-01 xfstests]# ./check xfs/071 xfs/072
	FSTYP         -- xfs (non-debug)
	PLATFORM      -- Linux/x86_64 hp-dl388eg8-01 3.18.0-rc7+
	MKFS_OPTIONS  -- -f -bsize=4096 /dev/sda6
	MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/sda6 /mnt/testarea/scratch

	xfs/071  2s
	_check_xfs_filesystem: filesystem on /dev/sda6 is inconsistent (r) (see /root/xfstests/results//xfs/071.full)
	xfs/072  1s
	Ran: xfs/071 xfs/072
	Passed all 2 tests

	[root@hp-dl388eg8-01 xfstests]# echo $?
	0

Usually it's not a problem, but it does confuse scripts that depend on
return value of check. Update check to treat _check_{test,scratch}_fs
failures as test failures too, new test output is like

	[root@hp-dl388eg8-01 xfstests]# ./check xfs/071 xfs/072
	FSTYP         -- xfs (non-debug)
	PLATFORM      -- Linux/x86_64 hp-dl388eg8-01 3.18.0-rc7+
	MKFS_OPTIONS  -- -f -bsize=4096 /dev/sda6
	MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/sda6 /mnt/testarea/scratch

	xfs/071 2s ... 2s
	_check_xfs_filesystem: filesystem on /dev/sda6 is inconsistent (r) (see /root/xfstests/results//xfs/071.full)
	xfs/072 1s ... 1s
	Ran: xfs/071 xfs/072
	Failures: xfs/071
	Failed 1 of 2 tests

	[root@hp-dl388eg8-01 xfstests]# echo $?
	1

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-24 14:51:50 +11:00
Eryu Guan fe10af5b50 common: return failure if _check_xxx_filesystem find corruption
So the callers could know if these functions find corruptions by the
return value.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-24 14:51:25 +11:00
Eryu Guan 974e2baea3 common: exit only if tests find corruption
If _check_xxx_filesystem called by tests when corruption found
they exit, but we don't want the calls from the test harness itself to
exit when corruption is found.

_check_xfs_filesystem already behaves correctly, make
_check_generic_filesystem and _check_btrfs_filesystem follow the same
behavior.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-24 14:51:04 +11:00
Liu Bo e4aa15bc59 btrfs: add test case for qgroup account on shared extents
This is a regression test of
'commit fcebe4562dec ("Btrfs: rework qgroup accounting")',
it's used to verify that removing shared extents can end up incorrect
qgroup accounting.

It can produce qgroup related warnings.

The fix is https://patchwork.kernel.org/patch/5499981/
"Btrfs: fix a warning of qgroup account on shared extents"

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Tested-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-24 14:48:23 +11:00
Junho Ryu 46a08542e3 Check O_DIRECT support before testing direct I/O
Some filesystems do not support O_DIRECT.  Check whether TEST_DIR supports
it by running xfs_io with -d flag.

Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 14:01:06 +11:00
Dushan Tcholich a540897160 generic/038: require fallocate support
Add test for fallocate(2) support

Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:53:57 +11:00
Dushan Tcholich 01d42b7efe common: unify _require_batched_discard
To check for FITRIM tests used  _require_fstrim() and
_test_batched_discard() but as _test_batched_discard() already
includes _test_fstrim() unify FSTRIM check throughout xfstests with
_require_batched_discard().

Signed-off-by: Dushan Tcholich <dusanc@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:53:57 +11:00
Theodore Ts'o ba3fc9f85b ext4/308: require fallocate support
These tests use the falloc command in xfs_io, and there are some file
systems (ext3) or file system configurations (ext4 in ext3
compatibility mode) which do not support fallocate.  So add the
explicit requirement to avoid false test failures.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:53:57 +11:00
Filipe Manana 22fc64ea50 btrfs: add regression test for clone ioctl
Regression test for a btrfs clone ioctl issue where races between
a clone operation and concurrent target file reads would result in
leaving stale data in the page cache. After the clone operation
finished, reading from the clone target file would return the old
and no longer valid data. This affected only buffered reads (i.e.
didn't affect direct IO reads).

This issue was fixed by the following linux kernel patch:

    Btrfs: ensure readers see new data after a clone operation
    (commit c125b8bff1d9f6c8c91ce4eb8bd5616058c7d510)

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:53:42 +11:00
Filipe Manana 0cfb617c51 fstests: btrfs, add test for snapshoting after file write + truncate
Regression test for a btrfs issue where if right after the snapshot
creation ioctl started, a file write followed by a file truncate
happened, with both operations increasing the file's size, the created
snapshot would capture an inconsistent state of the file system tree.
That state reflected the file truncation but it didn't reflect the
write operation, and left a gap between two file extent items (and
that gap corresponded to the total or a partial area of the write
operation's range).

This issue was fixed by the following linux kernel patch:

    Btrfs: fix snapshot inconsistency after a file write followed by truncate

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:50:56 +11:00
Theodore Ts'o a5a2db3aba common: use mke2fs -F instead of piping in yes
It's possible based on a race conditions (and possibly the version of
coreutils which supplies /usr/bin/yes) that commands of the form:

yes | $MKFS_PROG ...

will end up causing the following failure:

shared/298 16s ...	[23:49:03] [23:49:19] - output mismatch (see /results/results-4k/shared/298.out.bad)
    --- tests/shared/298.out	2014-10-31 10:13:04.000000000 -0400
    +++ /results/results-4k/shared/298.out.bad	2014-11-29 23:49:19.118138099 -0500
    @@ -1,4 +1,6 @@
     QA output created by 298
    +yes: standard output: Broken pipe
    +yes: write error
     Generating garbage on loop...done.
     Running fstrim...done.
     Detecting interesting holes in image...done.
    ...
    (Run 'diff -u tests/shared/298.out /results/results-4k/shared/298.out.bad'  to see the entire diff)

Using mke2fs's -F option instad of "yes | $MKFS_PROG" fixes this issue.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:50:21 +11:00
Eryu Guan f5b137bd8b generic/299: make sure fio really exits
Fix two problems in generic/299

1. Remove $seqres.full before test, otherwise the file is growing all
the time.

2. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:49:57 +11:00
David Disseldorp 9809bd25b7 cifs: add missing Makefile
This fixes the make install target, which traverses all tests/*
subdirectories.

Reported-by: David Drysdale <drysdale@google.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:48:51 +11:00
Eryu Guan 6a923ff03d btrfs: add groups for btrfs tests
Some new btrfs groups have been added in the btrfs stress patchset, add
other tests to proper groups too.

Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-16 10:48:35 +11:00
Vishal Verma c947ef41b0 ext4: the _require checks for bigalloc need a larger fs size
_require_ext4_bigalloc and _require_ext4_mkfs_bigalloc create a
200k fs. DAX (as XIP before it) relies on a fs block size ==
system page size; ie 4k for us.  With a 200k fs size limit,
mkfs refuses to create a filesystem with a 4k block size, so
the check fails, but for a bogus reason.
Increasing the fs size to 512m allows mkfs to create a filesystem
with 4k block size, so the test passes.

Signed-off-by: Vishal Verma <vishal.l.verma@linux.intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:26:56 +11:00
Eryu Guan 7b7e4497be common: fix comment about _require_test
_require_test will mount test dev if not mounted, fix the comment to
reflect that.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:26:45 +11:00
Eryu Guan 8d03c12def btrfs/017: remove duplicate test
btrfs/017 is same as btrfs/015, remove it.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:26:31 +11:00
Eryu Guan dd3c7a6ae6 fstests: change mode of test files to 0755
Performed by

find tests -perm 644 -name [0-9][0-9][0-9] -exec chmod 755 {} \;

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:26:15 +11:00
Eryu Guan 67cf62fa0f xfs/071: remove xfs/071.out from git
xfs/071.out is supposed to linked to the right out file at run time.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:25:47 +11:00
David Disseldorp 28da761eab cifs: add server-side copy sanity test
This test uses the cloner binary to issue CIFS_IOC_COPYCHUNK_FILE
server-side copy requests.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Acked-by:  Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:24:10 +11:00
David Disseldorp 20bde4fef1 common: rename _require_btrfs_cloner to _require_cloner
src/cloner.c is no longer Btrfs specific, so use a generic name.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Acked-by:  Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:23:06 +11:00
Filipe Manana 038401d7ba btrfs: add test to stress chunk allocation/removal and fstrim
Stress btrfs' block group allocation and deallocation while running
fstrim in parallel. Part of the goal is also to get data block groups
deallocated so that new metadata block groups, using the same physical
device space ranges, get allocated while fstrim is running. This caused
several issues ranging from invalid memory accesses, kernel crashes,
metadata or data corruption, free space cache inconsistencies, free
space leaks and memory leaks.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 11:07:22 +11:00
Xiaoguang Wang bf1b82fd64 ext4: add dump/restore test
This test case will first use fsstress to fill a file system, then
dump it to standard output and restore it from standard input, finally
check that the original contents and the new contents generated by
restore tool will be same.

Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 10:56:26 +11:00
Steve French 595b93e9c8 common: update README to list build dependencies
Add sample list of packages (dependencies) required to build XFSTESTS
and add a step to the instructions to mention creating the test
user needed for some of the ACL tests.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 10:55:29 +11:00
Eric Sandeen ca28228cd6 generic: use xfs_io falloc, not fallocate
generic/315 fails messily if the fallocate command isn't present.

generic/299 also uses "fallocate" and "truncate" binaries which may
not be present.

Switch both to use xfs_io, and we already have the _require for
that, because it's what every other test uses...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-12-12 10:55:24 +11:00