Add basic GlusterFS support. Neither new GlusterFS specific tests
nor related patches are included. Only support FSTYP=glusterfs or
check -glusterfs XXX.
To test on glusterfs, two gluster volumes and two mountpoint
directories are needed.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Sometimes there are multiple occurances of meta_name, pool_name,
data_name in dmsetup command which causes failures while adding in
next line. This patch greps for names at start of line.
Signed-off-by: Harish <harish@linux.vnet.ibm.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Since btrfs puts in the subvol name in the device, we should
use -v option to not print the bind mounts or btrfs volumes.
Otherwise if a new subvolume is set as the default volume to be
mounted, as what btrfs/009 does, then next _require_scratch fails
SCRATCH_DEV=/dev/vdc is mounted but not on SCRATCH_MNT=/scratch - aborting
Already mounted result:
/dev/vdc[/newvol] /scratch
[eguan: update commit log a bit, add failure example]
Fixes: 5e6892d ("common/rc: use findmnt to check mounted device")
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
If we create and delete files within the qgroup limits, qg->reserved
(allocations before commits) over-inflates and causes -EDQUOT to be
returned pre-maturely.
Also, 32/64bit data-type exchanges can cause reserved (u64) to go
negative (very large) and -EDQUOT is returned pre-maturely.
Will be fixed by patches with subjects:
btrfs: Retry after commit on getting EDQUOT
btrfs: Change qgroup_meta_rsv to 64bit
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
If SELinux is enabled, by default xfstests mounts its filesystems
with "-o context=system_u:object_r:nfs_t:s0" so that no SELinux
xattrs get created and interfere with tests. However, this
particular context is not guaranteed to be available because the
context names are a detail of the SELinux policy. The SELinux
policy on Android systems, for example, does not have a context with
this name.
To fix this without having to manually override
SELINUX_MOUNT_OPTIONS, just grab the SELinux context of the root
directory. This is arbitrary, but it should always provide a valid
context. And if for some reason someone is actually running
xfstests in a specific SELinux context that needs files labeled with
a particular context, then they may still override
SELINUX_MOUNT_OPTIONS.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
SELINUX_MOUNT_OPTIONS is already set in common/config. Setting it again
in common/quota is not necessary. Nor is SELINUX_MOUNT_OPTIONS specific
to quota tests, so common/quota is not the right place for it.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
generic/361 uses a loopback device, so it should have _require_loop.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
For example, if $TEST_DIR=/mnt, only replace instances of /mnt that
are in the beginning of a path string, e.g.:
"/mnt/mntA/mntB:/mnt/mntC" => "TEST_DIR/mntA/mntB:TEST_DIR/mntC"
With this change, there is no longer a need to check the case of
$TEST_DEV being a substring of $TEST_DIR, because that would mean
that $TEST_DIR is a prefix of $TEST_DIR and that is not possible.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Doing 'grep -F "$dev on "' to find the mounted device is not
always accurate, e.g.
SCRATCH_DEV=/vda6 is mounted but not on SCRATCH_MNT=/vda6/ovl-mnt - aborting
Already mounted result:
/dev/vda6 on /vda6 type xfs (rw,relatime,context=system_u:object_r:nfs_t:s0,attr2,inode64,noquota)
Fix it by using findmnt command and specifying the $dev as mount
source, print the result in "$dev $mnt" format. This works for local
filesystems, network filesystems and overlayfs, avoids all kinds of
tricky and error-prone grep pattern/regex.
Also fixed the if-then-fi format in _check_mounted_on() while we're
at it.
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
If test on 4k sector size device, xfs/078 will fail when it try to
make a filesystem image with block size less than 4096. But if we
attach the file image to a loop device, it can accept 512 block
size. So this patch attach a loop device before do mkfs.xfs.
[eguan: replace bare mount/umount with [U]MOUNT_PROG]
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
There's a bug in xfs where the orphan inode list
is not processed on a readonly mount, and is still not
processed even if it gets mounted rw. This test exercises
that, and makes sure that the unlinked list is empty after
a transition to rw and an unmount.
While we're at it, sanity check the same thing for pure ro
and rw unmounts.
Now that shutdown is generic, we can test other filesystems
as well, so this is in the generic group.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Tests in shutdown group are supposed to test journal recovery after
filesystem shutdown, and the tests assume the filesystem in test has
journal support. But with the ext4 shutdown function added in
4.11-rc kernel, ext2 gains shutdown support too when driving with
ext4 driver, so generic/051 fails because fs corruption after test.
Adding _require_metadata_journaling to all generic tests in shutdown
group to ensure there's journal present.
generic/050 is skipped because it has _require_scratch_nocheck,
which indicates no fsck is done after test.
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This test case will test if file system works well when handling
large write while available space are all fragmented.
This can expose a bug in a btrfs unmerged patch, which wrongly
modified the delayed allocation code, to exit before allocating all
space, and cause hang when unmounting.
The wrong patch is:
[PATCH v6 1/2] btrfs: Fix metadata underflow caused by btrfs_reloc_clone_csum error
The test case will:
1) Fill small filesystem with page sized small files
All these files has a sequential number as file name
2) Remove files with odd number as file name
This will free almost half of the space
3) Try to write a file which takes 1/8 of the file system
The method to create fragmented fs may not be generic enough, but
should work for most extent based fs. Unless one file system will
allocate extents from both end of its free space.
Cc: Filipe Manana <fdmanana@kernel.org>
Cc: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Save testcase data which later may be used by report generators
- Save failure reason to $err_msg variable
- Save number of notrun tests to $n_notrun counter, similar to
$n_try,$n_bad
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
After some shared subtrees test (bind/slave/shared/private), maybe
some dentries isn't freed. For example, EBUSY maybe returned due to
some bugs. This patch tries to verify that.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When selinux utilities are present, xfstests add options to help
circumvent selinux protection. However, on Chrome OS, it leads to
the opposite effect, when it prevents mount to succeed.
BUG=chromium:669641
TEST=xfstest test ext4/001 completes where it use to display:
common/rc: could not mount /dev/loop29 on /usr/local/autotest/tmp/xfstests_TEST
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
1) We add _require_ext4_mkfs_feature to check the specified
feature whether it is available in mkfs.ext4 or not.
2) We apply _require_ext4_mkfs_feature in ext4/003 and remove
_require_mkfs_mkfs_bigalloc.
3) We add _require_ext4_mkfs_feature in ext4/306. When 64bit
feature is supported by mkfs.ext4, ext4/306 could skip.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
perform read operation on the target file while
doing write or fpunch operations on the reflinks.
Signed-off-by: Nave Vardy <nave.vardy@plexistor.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Use the new var OVL_BASE_SCRATCH_MNT to refer to overlay
base dir instead of the legacy SCRATCH_DEV var.
In overlay/011, when using MOUNT_PROG directly, provide
OVL_BASE_SCRATCH_MNT as device argument instead of 'none'.
This fix is required to support mount of base fs.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
When TEST/SCRATCH_DEV are configured to the base fs block device,
use this information to mount base fs before running tests,
unmount it after running tests and cycle on _test_cycle_mount
along with the overlay mounts.
This helps catching overlayfs bugs related to leaking objects in
underlying (base) fs.
To preserve expected tests behavior, the semantics are:
- _scratch_mkfs mounts the base fs, cleans all files, creates
lower/upper dirs and keeps base fs mounted
- _scratch_mount mounts base fs (if needed) and mounts overlay
- _scratch_unmount unmounts overlay and base fs
Tests that use _scratch_unmount to unmount a custom overlay mount
and expect to have access to overlay base dir, were fixed to use
explicit umount $SCRATCH_MNT instead.
The overlay test itself, does not support formatting the base fs,
so config options like MKFS_OPTIONS and FSCK_OPTIONS are ignored
on 'check -overlay'.
The config option MOUNT_OPTIONS is used to mount the base scratch fs.
The config option TEST_FS_MOUNT_OPTS is used to mount the base test fs.
The config option OVERLAY_MOUNT_OPTIONS is used to mount both test and
scratch overlay mounts.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Instead of setting the vars TEST/SCRATCH_DEV to overlay base dirs,
allow setting them to block devices to configure the base fs partition,
where overlay dirs will be created.
For example, the following config file can be used to run tests on
xfs test/scratch partitions:
TEST_DEV=/dev/sda5
TEST_DIR=/mnt/test
SCRATCH_DEV=/dev/sda6
SCRATCH_MNT=/mnt/scratch
FSTYP=xfs
Using the same config file, but executing './check -overlay' will
use the same partitions as base fs for overlayfs directories
and set TEST_DIR/SCRATCH_MNT values to overlay mount points, i.e.:
/mnt/test/ovl-mnt and /mnt/scratch/ovl-mnt.
The base fs should be pre-formatted and mounted when starting the test.
An upcoming change is going to support mount/umount of base fs.
The new vars OVL_BASE_SCRATCH_MNT/TEST_DIR are set to point at the
overlayfs base dirs in either legacy or new config method.
Tests should always use these vars and not the legacy SCRATCH/TEST_DEV
vars when referring to overlay base dir.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
As preparation step for configuring test/scratch base fs
for overlay tests:
- Rename OVERLAY_LOWER/UPPER/WORK_DIR => OVL_LOWER/UPPER/WORK
because we want to use OVL_ prefix for all base fs vars
- Prepend "ovl-" prefix to lower/upper/work path values to
isolate the overlay test dirs when running on a base fs
that is also used to run non overlay tests
- Make those vars values non-configurable, because lower/upper/work
directory names are an internal test detail which should
not concern the user and because we wish to simplify
and document the overlay tests setup
- Add helper _filter_ovl_dirs and use it to filter output
of test overlay/023 which matches the constant string "work"
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>