Commit Graph

2819 Commits

Author SHA1 Message Date
Darrick J. Wong 0bfb84110b common: add leading underscore to get_block_size
Add a leading underscore to the get_block_size helper since it's a
common function.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-15 13:56:45 +08:00
Darrick J. Wong daedb4dc13 ocfs2: test reflinking to inline data files
Make sure that we can handle reflinking from and to inline-data files.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-15 13:56:45 +08:00
Eric Sandeen 9ef7c4e3dc xfs/010: explicitly allow corrupted write in xfs_db
xfs/010 wants to write corruption and test how xfs_repair
deals, but when:

  xfs: forbid AG btrees with level == 0

is merged to userspace, this new test fails the write verifier
in xfs_db.

Add "-c" to allow the corrupted write, do the corruptions all
in one xfs_db command (so it doesn't have to re-read the
corrupted data on 2nd startup), and filter out the

  "Allowing write of corrupted data and bad CRC"

output from the "write -c" command.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-15 13:56:45 +08:00
Christoph Hellwig 1abe96278d generic/081: hack around the lvm unmount race
This is butt ugly, but I see no better way than to wait a bit to
work around the race between the weird umount in LVM, and the mount
ismounted checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-15 13:56:45 +08:00
Brian Foster ef00dbcf53 generic: racing getxattr requests against xattr add/remove
This test reproduces a bug in XFS where a getxattr of an existing
xattr returns failure due to a race with a setxattr that causes
inode attribute fork conversion.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-10 11:43:33 +08:00
Eric Sandeen 54c0f9cd4f xfs/118: add to dangerous group
Failure results in an oops, so add it to dangerous.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-10 11:43:19 +08:00
Eryu Guan 1300cbc873 generic/158,304: filter dedupe error message
Kernel commit 22725ce4e4a0 ("vfs: fix isize/pos/len checks for reflink &
dedupe") added more checks on reflink and dedupe, rejected dedupe past
EOF early and explicitly, and causes generic/158 and generic/304 to fail.

  Try dedupe from past EOF
 -dedupe: Invalid argument
 +XFS_IOC_FILE_EXTENT_SAME: Invalid argument
  Try dedupe to past EOF, destination offset beyond EOF

Also there's an xfsprogs patch from Darrick ("xfs_io: prefix dedupe
command error messages consistently") to change all xfs_io dedupe
error message prefixes to "XFS_IOC_FILE_EXTENT_SAME".

So introduce a new _filter_dedupe_error, change all "dedupe" prefix
to XFS_IOC_FILE_EXTENT_SAME, make tests pass with both old/new
kernel & userspace.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-06 16:53:10 +08:00
Xiong Zhou a1d861da98 overlay: copy up and remove from another namespace
Via unshare, copy up dir from lower dir then remove
them in another unshared namespace.

This would fail before v4.7 kernel with EPERM.

Kernel commit 3fe6e52f
  ovl: override creds with the ones from the superblock mounter
fixed this issue, with this reproducer provided. Original
reproducer was written by commit author:
Antonio Murdaca <amurdaca@redhat.com>

Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-05 15:34:57 +08:00
Deepa Dinamani fbe236d6a9 generic: Add tests for inode timestamp policy
The test helps to validate clamping and mount behaviors
according to supported file system timestamp ranges.

Note that the test can fail on 32-bit systems for a
few file systems. This will be corrected when vfs is
transitioned to use 64-bit timestamps.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-05 10:18:01 +08:00
Amir Goldstein 3abf189ff2 check: document tests include/exclude options
Add argument description and examples to usage() for the
various tests include and exclude options.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-04 15:42:25 +08:00
Amir Goldstein 5d80198511 check: support include/exclude of sub groups
Allow including and/or excluding tests by test dir and group.
-g and -x command line arguments can take the form of
<subdir>/<group>.

For example:

./check -n -g xfs/quick
./check -n -g stress -x xfs/stress
./check -n -g xfs/punch -x dangerous_fuzzers

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-04 15:42:15 +08:00
Amir Goldstein d0ad5cc76a check: factor out get_sub_group_list() helper
This helper gets a list of tests that belong to a group
under a specific tests subdir.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-04 15:42:07 +08:00
Su Yue 5858c3eb39 btrfs/006: Fix false alert due to output change
Btrfs-progs v4.9 changed "device status" output by adding one more
space, which differs from golden output.

Fix it by using filter '_filter_spaces' to convert multi space into
one.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-01-03 11:41:36 +08:00
Su Yue 06557299a5 btrfs/104: Redirect mkfs output to avoid false alert
btrfs/104 doesn't redirect mkfs output correctly, which leads to
false alert.

Fix it.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-30 14:18:30 +08:00
Chandan Rajendra f7a52fc6db btrfs/012: Enable test to be executed on non-4k block size filesystems
To get the test to work on non-4k block sized filesystems, this
commit obtains the block size of the Btrfs filesystem from
$TEST_DIR.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-28 19:35:47 +08:00
Qu Wenruo 2333197d30 btrfs/132: wait the writer to avoid EBUSY
The kill and wait method will only wait for the children process to
exit, while the xfs_io can still run at background.

This makes the test always fails on HDD backed physical machine.

Use the "while ps aux | grep" method in btrfs/069 to truely wait the
xfs_io to finish.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-28 19:19:03 +08:00
Amir Goldstein 7ee1d97c79 generic: test correct d_type values
Verify correct d_type values of dir entries.

This test does NOT require that file system support the filetype
feature.  It verifies that either all file types are reported as
DT_UNKNOWN or that all file types are reported correctly.

For fs for which we know how to test the filetype feature (xfs|ext*)
verify getting DT_UNKNOWN IFF filetype feature is disabled.

Special dir entries . and .. MAY be reported as DT_UNKNOWN IF
filetype feature is disabled (ext4), but MAY also be reported as
DT_DIR in this case (xfs).

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 20:21:55 +08:00
Amir Goldstein d0d42a3821 common/rc: add generic file type support check
_supports_filetype() helper checks if the filetype feature
is enabled for xfs and ext* file sytems.

Add a check for the generic case where we don't know
how to test file system filetype feature.

Introduce a helper utility t_dir_type that lists directory
entries filtered by file type.

Check for filetype feature by expecting to find no directory
entries listed as DT_UNKNOWN inside a test directory.

[eguan: declare temp vars as local]

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 20:21:55 +08:00
Amir Goldstein 9aead226d3 common/rc: factor out _supports_filetype() helper
_overlay_mount_dirs() checks for the filetype feature
on upper dir fs.

factor out that feature test to a helper.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 20:21:47 +08:00
Theodore Ts'o 030fd2aea2 overlay: stress test changes to top and bottom layers simultaneously
Introduce a test which runs fsstress on the top and bottom overlayfs
directories simultaneously to find potential races that plagued
wrapfs derived file systems.

[eguan: add copyright info and fix minor code style issue]

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 18:38:30 +08:00
Eric Sandeen 3b3191806f common: add _require_getnextquota helper
Add a helper to determine if the kernel supports
the GETNEXTQUOTA quotactl.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 18:12:10 +08:00
Eric Sandeen a4f96daeb1 generic/244: remove extra junk
Lots of pointless mounting & unmounting & quotaon etc,
get rid of it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 18:09:40 +08:00
Eric Sandeen 3cbd329a14 generic: test GETNEXTQUOTA near INT_MAX
XFS kernel code had a bug where GETNEXTQUOTA-type
quotactls requesting an ID near UINT_MAX could overflow
and return 0 as the "next" active ID.

This test checks that by creating an active quota near
UINT_MAX, then asking for the next one after it.

The proper answer is ENOENT, but if we wrap we'll return
ID 0.

This also changes test-nextquota.c so that it checks
both GETNEXTQUOTA and XGETNEXTQUOTA even if one fails;
it stores the failure conditions and returns 1 if either
of them fails.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 18:09:40 +08:00
Eric Biggers 716691159e generic: test for weaknesses in filesystem encryption
Add an xfstest which can detect some basic crypto mistakes that would
reduce the confidentiality guarantee provided by filesystem encryption.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 16:48:58 +08:00
Eric Biggers 0f7a979130 generic: test enforcement of one encryption policy per tree
Add an xfstest which verifies that the filesystem forbids operations
that would violate the constraint that all files in an encrypted
directory tree use the same encryption policy.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-12-24 16:47:12 +08:00