mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
2ab614524d
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>
47 lines
1.6 KiB
Plaintext
47 lines
1.6 KiB
Plaintext
|
|
To run xfstest on overlayfs, configure the variables of TEST and SCRATCH
|
|
partitions to be used as the "base fs" and run './check -overlay'.
|
|
|
|
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, for the context of
|
|
individual tests.
|
|
|
|
'./check -overlay' does not support mkfs and fsck on the base fs, so
|
|
the base fs should be pre-formatted before starting the -overlay run.
|
|
An easy way to accomplish this is by running './check <some test>' once,
|
|
before running './check -overlay'.
|
|
|
|
Because of the lack of mkfs support, multi-section config files are only
|
|
partly supported with './check -overlay'. Only multi-section files that
|
|
do not change FSTYP and MKFS_OPTIONS can be safely used with -overlay.
|
|
|
|
For example, the following multi-section config file can be used to
|
|
run overlay tests on the same base fs, but with different mount options:
|
|
|
|
[xfs]
|
|
TEST_DEV=/dev/sda5
|
|
TEST_DIR=/mnt/test
|
|
SCRATCH_DEV=/dev/sda6
|
|
SCRATCH_MNT=/mnt/scratch
|
|
FSTYP=xfs
|
|
|
|
[xfs_pquota]
|
|
MOUNT_OPTIONS="-o pquota"
|
|
TEST_FS_MOUNT_OPTS="-o noatime"
|
|
OVERLAY_MOUNT_OPTIONS="-o redirect_dir=off"
|
|
|
|
In the example above, MOUNT_OPTIONS will be used to mount the base scratch fs,
|
|
TEST_FS_MOUNT_OPTS will be used to mount the base test fs and
|
|
OVERLAY_MOUNT_OPTIONS will be used to mount both test and scratch overlays.
|