1) _check_scratch_dax_mountopt() checks old/new dax mount option and
returns a value.
2) _require_scratch_dax_mountopt() throws notrun if _check_scratch_dax_mountopt()
returns a non-zero value.
3) _require_dax_iflag() checks FS_XFLAG_DAX.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Sometimes we can end up with unexpected xattrs showing up on an inode.
For instance, on an SELinux-enabled host security.selinux may be set and
show up in a listing even though we've never set it.
generic/062 lists out all of the xattrs on an inode in some cases, but
it can't easily account for these "automatic" xattrs being set. Change
it to use a more restrictive regex when filtering attributes, so that we
just get the namespaces we're interested in.
Cc: Zorro Lang <zlang@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Most hosts that I've been testing on seem to display security.selinux in
listxattr. 377.out doesn't account for that so it routinely fails for me
in testing.
When testing the output of listxattr in generic/377, filter out any xattr
names that don't start with 'user.'. That should help ensure consistent
output on SELinux-enabled hosts.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
New xfs_quota kernel and xfsprogs add grace timers for group and project,
in addition to user quota. Adjust xfs/263 to accommodate those
changes, and avoid regression.
Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Both of these quota tests contain the output of the xfs_quota repquota
command in the golden output. Unfortunately, the output was recorded
before quota soft warnings were implemented, which means they'll regress
the output when we make quota warning work. Fix this by resetting the
warning count to zero before generating output.
While we're at it, use $XFS_QUOTA_PROG instead of xfs_quota.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Both of these tests encode the xfs_quota output in the golden output.
Now that we've changed xfs_quota to emit max warnings, we have to fix
the test to avoid regressions.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
New xfs_quota kernel and xfsprogs add grace timers for group and project,
in addition to existing user quota. Adjust xfs/518 to accommodate those
changes, and avoid regression.
Signed-off-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
There is a bug in trim code which leads to fstrim accessing beyond
device boundary.
The test case will check if fstrim, then shrink, then fstrim, all of
them works without problem.
The fix is titled "btrfs: trim: fix underflow in trim length to prevent
access beyond device boundary".
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In xfs/030, we zero the entire AGFL which makes it corrupt because the
AG superblock block is /never/ free. In commit dcd6c2e1 ("xfs_repair:
convert to libxfs_verify_agbno") we enhanced repair to complain about
zeroed entries in the AGFL, so add that to the golden output.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
XFS filesystems require V5 format to support all three quota types at
the same time, so skip the test if we're testing XFS older than that.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
btrfs is clever enough to figure out which devices constitute the
sprout fs even without specifying them explicitly with -o device.
Additionally, explicitly settings the devices via -o device reduces
coverage of the test since it didn't detect breakage a local change
introduced. Without -o device instead this breakage was detected.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Currently generic/501 fails on machines with a page size different from 4K
(like ppc64le), because the clone operation fails with -EINVAL due to the
fact we pass it an offset that is 4K aligned but not aligned to the page
size of the machine.
The test doesn't actually need offsets and lengths to be 4K aligned, so
just update the test to use offsets and lenghts that work for page size.
Also add a comment mentioning that a file size of at least 16Mb was a
necessary condition to trigger the btrfs bug.
The test is a regression test for a btrfs issue fixed by kernel commit
bd3599a0e142cd ("Btrfs: fix file data corruption after cloning a range
and fsync"), which landed in kernel 4.18.
Since I couldn't compile a 4.17 kernel on debian testing, I tried this
with a 4.18 kernel with that commit reverted, and it fails as expected
on a x86_64 box:
$ ./check generic/501
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 debian9 4.18.0-btrfs-next-64 #1 SMP (...)
MKFS_OPTIONS -- /dev/sdc
MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1
generic/501 1s ... - output mismatch (see .../xfstests/results//generic/501.out.bad)
--- tests/generic/501.out 2020-07-22 14:50:12.585674202 +0100
+++ /home/fdmanana/git/hub/xfstests/results//generic/501.out.bad ...
@@ -2,4 +2,4 @@
File bar digest before power failure:
69319d0343ab8f5ea564167da445addc SCRATCH_MNT/bar
File bar digest after power failure:
-69319d0343ab8f5ea564167da445addc SCRATCH_MNT/bar
+21de7d7325fe4dae1f3311d5a76f819f SCRATCH_MNT/bar
...
(Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/generic/501.out ...
Ran: generic/501
Failures: generic/501
Failed 1 of 1 tests
Without the commit reverted it passes as expected.
Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Command "quota enable" triggers a quota rescan, but it can finish
quick in some machines leading to the next command "quota rescan" to
be able to start scanning again, and then printing "quota rescan
started" making the test fail.
In some machines this don't happen because the first rescan
initiated by "quota enable" is still running when "quota rescan" is
executed, returning -EINPROGRESS from ioctl
BTRFS_IOC_QUOTA_RESCAN_STATUS and not printing the message.
Ignoring any output from "quota rescan" solves the issue in both
cases, and this is already being done by others tests as well.
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Some generic tests explicitly run 'mknod' or 'mkfifo' command, however
the correspondent runtime check is missing, this results in a test
failure instead of selecting not to execute the test.
The change adds _require_mknod check to the next generic tests:
* generic/157
* generic/158
* generic/294
* generic/423
Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
In runtime the modified tests requires and utilizes fpunch command
of xfs_io, thus a tested filesystem shall support the feature and
running a filesystem check by "punch" group selection should include
these tests:
* generic/176
* generic/415
* generic/447
* generic/469
* generic/562
In addition and due to the same reasons add generic/469 to zero test
group, the test already contains _require_xfs_io_command "fzero" check.
Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Test if dirtying many inodes (which can delay umount) then
unmounting and quickly mounting again causes the mount to fail.
A race, which breaks the test in btrfs, is fixed by kernel commit
48cfa61b58a1 ("btrfs: fix mount failure caused by race with umount")
Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
These tests use an overlay mount as lower layer for a nested overlay.
That provides test coverage for a lower layer with null uuid and
lower layer with real inode numbers that use the high xino bits.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The tests with multi lower layers rotate the upper layer into a lower
layer on specific operations such as mkdir, rename and link.
That provides test coverage for redirect_dir and index features.
The following variations are covered:
1. All layers all on scratch fs (--ov=10 --samefs)
2. All layers on scratch fs expect for lowermost on test fs (--ov=10)
3. Lowermost layer on test fs, one layer on tmpfs and the rest
on sratch fs (--ov=10 --maxfs=1)
4. Lowermost layer on test fs, one layer on scratch fs and the rest
are unique tmpfs instances (--ov=10 --maxfs=10)
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Add support for running unionmount-testsuite from xfstests.
This requires that unionmount-testsuite is installed under src dir or
that UNIONMOUNT_TESTSUITE variable points to the location of the
testsuite. It also requires a recent version of unionmount-testsuite
that supports setting basedir path via UNIONMOUNT_* environment variables.
Add tests for three basic configurations:
1. overlay with upper/lower on same fs
2. overlay with upper/lower not on same fs without xino
3. overlay with upper/lower not on same fs with xino
The samefs test uses scratch partition for lower/upper layers.
The non samefs tests use the scratch partition for upper layer and the
test partition for lower layer.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The test checks regressions on quota accounting and therefore it relies
on quota support by a tested filesystem, this makes it reasonable to
include the test into 'quota' test group for better managing of test
groups.
Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
The change makes one-in-one correspondence between generic tests in
'insert' test group and tests with $(_require_xfs_io_command "finsert")
runtime check:
* generic/348 -- insert group association is removed,
* generic/458 -- insert group association is added.
The intention of the change is to get better summarized association
between tests and test groups to be able to operate with test groups
in a better way.
Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>