[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27af8d4f-8653-469f-73bb-d388180d93c9@huawei.com>
Date: Tue, 24 Sep 2019 19:15:56 +0800
From: Zhihao Cheng <chengzhihao1@...wei.com>
To: <guaneryu@...il.com>, <amir73il@...il.com>,
<david.oberhollenzer@...ma-star.at>, <ebiggers@...gle.com>,
<yi.zhang@...wei.com>
CC: <fstests@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH xfstests] overlay: Enable character device to be the base
fs partition
After incorporating patches, use overlay usecases to test character device-based base fs, and all overlay usecases are executed:
FSTYP -- overlay # FSTYP has be overridden as 'overlay'
PLATFORM -- Linux/x86_64 localhost
MKFS_OPTIONS -- /tmp/scratch
MOUNT_OPTIONS -- /tmp/scratch /tmp/scratch/ovl-mnt
overlay/001 [not run] This test requires at least 8GB free on /tmp/scratch to run
overlay/002 1s
overlay/003 0s
overlay/004 0s
overlay/005 1s
overlay/006 0s
overlay/007 0s
overlay/008 0s
overlay/009 0s
overlay/010 0s
overlay/011 1s
overlay/012 0s
overlay/013 0s
overlay/014 1s
...
Attachments:
setup.sh: Create character device for base fs (UBIFS)
local.config: Xfstests local configuration
在 2019/9/24 17:40, Zhihao Cheng 写道:
> When running overlay tests using character devices as base fs partitions,
> all overlay usecase results become 'notrun'. Function
> '_overay_config_override' (common/config) detects that the current base
> fs partition is not a block device and will set FSTYP to base fs. The
> overlay usecase will check the current FSTYP, and if it is not 'overlay'
> or 'generic', it will skip the execution.
>
> For example, using UBIFS as base fs skips all overlay usecases:
>
> FSTYP -- ubifs # FSTYP should be overridden as 'overlay'
> MKFS_OPTIONS -- /dev/ubi0_1 # Character device
> MOUNT_OPTIONS -- -t ubifs /dev/ubi0_1 /tmp/scratch
>
> overlay/001 [not run] not suitable for this filesystem type: ubifs
> overlay/002 [not run] not suitable for this filesystem type: ubifs
> overlay/003 [not run] not suitable for this filesystem type: ubifs
> ...
>
> When checking that the base fs partition is a block/character device,
> FSTYP is overwritten as 'overlay'. This patch allows the base fs
> partition to be a character device that can also execute overlay
> usecases (such as ubifs).
>
> Signed-off-by: Zhihao Cheng <chengzhihao1@...wei.com>
> ---
> common/config | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/common/config b/common/config
> index 4c86a49..a22acdb 100644
> --- a/common/config
> +++ b/common/config
> @@ -550,7 +550,7 @@ _overlay_config_override()
> # the new OVL_BASE_SCRATCH/TEST_DEV/MNT vars are set to the values
> # of the configured base fs and SCRATCH/TEST_DEV vars are set to the
> # overlayfs base and mount dirs inside base fs mount.
> - [ -b "$TEST_DEV" ] || return 0
> + [ -b "$TEST_DEV" ] || [ -c "$TEST_DEV" ] || return 0
>
> # Config file may specify base fs type, but we obay -overlay flag
> [ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
> @@ -570,7 +570,7 @@ _overlay_config_override()
> export TEST_DIR="$OVL_BASE_TEST_DIR/$OVL_MNT"
> export MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS"
>
> - [ -b "$SCRATCH_DEV" ] || return 0
> + [ -b "$SCRATCH_DEV" ] || [ -c "$SCRATCH_DEV" ] || return 0
>
> # Store original base fs vars
> export OVL_BASE_SCRATCH_DEV="$SCRATCH_DEV"
>
View attachment "local.config" of type "text/plain" (205 bytes)
View attachment "setup.sh" of type "text/plain" (802 bytes)
Powered by blists - more mailing lists