source fs specific common file properly
cover source fs specific common file properly
It starts with generic/402 always fails on overlayfs as:
QA output created by 402
./common/rc: line 2441: _xfs_timestamp_range: command not found ./common/rc: line 2403: [: syntax error: '-1' unexpected ./common/rc: line 2408: [: -le: unary operator expected ./common/rc: line 2441: _xfs_timestamp_range: command not found 0;0 != 1;1
0;0 != 1;1
Silence is golden
Due to if FSTYP is overlay, we only source common/overlay file. But we still need the helpers of the underlying filesystem. So I think we need to source the common/$OVL_BASE_FSTYP in common/overlay.
Besides overlayfs, I'd like to extend other uplying fs support its BASE_FSTYP, so other uplying fs (e.g. nfs, cifs, glusterfs ...) will do like this.
Thanks,
Zorro
PATCH 1/2 common: source base fs specific common file
When tests overlayfs, sometimes we need the underlying fs specific helpers, e.g. common/rc has:
_filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP
So when we source common/overlay, better to source OVL_BASE_FSTYP too.
--- common/config | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ common/overlay | 4 ++++ common/rc | 49 +---------------------------------------- 3 files changed, 64 insertions(+), 48 deletions(-)
common/config +59 -0
@@ -481,6 +481,65 @@ _fsck_opts() esac } +# check necessary running dependences then source sepcific fs helpers +_source_specific_fs() +{ + local fs=$1 + + if [ -z "$fs" ];then + fs=$FSTYP + fi + + case "$fs" in + xfs) + [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found" + [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found" + [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found" + [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found" + [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found" + + . ./common/xfs + ;; + udf) + [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found" + ;; + btrfs) + [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found" + + . ./common/btrfs + ;; + ext4) + [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found" + ;; + f2fs) + [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found" + ;; + nfs) + . ./common/nfs + ;; + cifs) + ;; + 9p) + ;; + ceph) + . ./common/ceph + ;; + glusterfs) + ;; + overlay) + . ./common/overlay + ;; + reiser4) + [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found" + ;; + pvfs2) + ;; + ubifs) + [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" + ;; + esac +} + known_hosts() { [ "$HOST_CONFIG_DIR" ] || HOST_CONFIG_DIR=`pwd`/configs
common/overlay +4 -0
@@ -12,6 +12,10 @@ export OVL_XATTR_NLINK="trusted.overlay.nlink" export OVL_XATTR_UPPER="trusted.overlay.upper" export OVL_XATTR_METACOPY="trusted.overlay.metacopy" +if [ -n "$OVL_BASE_FSTYP" ];then + _source_specific_fs $OVL_BASE_FSTYP +fi + # helper function to do the actual overlayfs mount operation _overlay_mount_dirs() {
common/rc +1 -48
55 lines not on this page · raw message
Signature · 1 line
2.31.1
Re: [PATCH 1/2] common: source base fs specific common file
Quoted 9 lines · Zorro Lang
When tests overlayfs, sometimes we need the underlying fs specific helpers, e.g. common/rc has:
_filesystem_timestamp_range$OVL_BASE_TEST_DEV $OVL_BASE_FSTYPSo when we source common/overlay, better to source
OVL_BASE_FSTYPtoo.Signed-off-by Zorro Lang <[email protected]>
Makes sense.
Quoted 154 lines
--- common/config | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ common/overlay | 4 ++++ common/rc | 49 +---------------------------------------- 3 files changed, 64 insertions(+), 48 deletions(-)common/config +59
-0@@ -481,6 +481,65 @@ _fsck_opts() esac } +# check necessary running dependences then source sepcific fs helpers +_source_specific_fs() +{ + local fs=$1 + + if [ -z "$fs" ];then + fs=$FSTYP + fi + + case "$fs" in + xfs) + [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found" + [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found" + [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found" + [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found" + [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found" + + . ./common/xfs + ;; + udf) + [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found" + ;; + btrfs) + [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found" + + . ./common/btrfs + ;; + ext4) + [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found" + ;; + f2fs) + [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found" + ;; + nfs) + . ./common/nfs + ;; + cifs) + ;; + 9p) + ;; + ceph) + . ./common/ceph + ;; + glusterfs) + ;; + overlay) + . ./common/overlay + ;; + reiser4) + [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found" + ;; + pvfs2) + ;; + ubifs) + [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" + ;; + esac +} + known_hosts() { [ "$HOST_CONFIG_DIR" ] || HOST_CONFIG_DIR=`pwd`/configscommon/overlay +4
-0@@ -12,6 +12,10 @@ export OVL_XATTR_NLINK="trusted.overlay.nlink" export OVL_XATTR_UPPER="trusted.overlay.upper" export OVL_XATTR_METACOPY="trusted.overlay.metacopy" +if [ -n "$OVL_BASE_FSTYP" ];then + _source_specific_fs $OVL_BASE_FSTYP +fi + # helper function to do the actual overlayfs mount operation _overlay_mount_dirs() {common/rc +1
-49@@ -96,54 +96,7 @@ _log_err() umask 022 # check for correct setup and source the $FSTYP specific functions now -case "$FSTYP" in - xfs) - [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found" - [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found" - [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found" - [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found" - [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found" - - . ./common/xfs - ;; - udf) - [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found" - ;; - btrfs) - [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found" - - . ./common/btrfs - ;; - ext4) - [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found" - ;; - f2fs) - [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found" - ;; - nfs) - . ./common/nfs - ;; - cifs) - ;; - 9p) - ;; - ceph) - . ./common/ceph - ;; - glusterfs) - ;; - overlay) - . ./common/overlay - ;; - reiser4) - [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found" - ;; - pvfs2) - ;; - ubifs) - [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" - ;; -esac +_source_specific_fs $FSTYP if [ ! -z "$REPORT_LIST" ]; then . ./common/report --2.31.1
PATCH 2/2 tests: remove redundant common/$FSTYP importing
In reply to Zorro LangAs fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again.
--- tests/btrfs/177 | 1 - tests/btrfs/258 | 1 - tests/btrfs/259 | 1 - tests/xfs/422 | 1 - tests/xfs/423 | 1 - tests/xfs/517 | 1 - 6 files changed, 6 deletions(-)
tests/btrfs/177 +0 -1
@@ -10,7 +10,6 @@ _begin_fstest auto quick swap balance . ./common/filter -. ./common/btrfs # Modify as appropriate. _supported_fs btrfs
tests/btrfs/258 +0 -1
@@ -11,7 +11,6 @@ _begin_fstest auto defrag quick . ./common/btrfs -. ./common/filter # real QA test starts here
tests/btrfs/259 +0 -1
@@ -12,7 +12,6 @@ _begin_fstest auto quick defrag # Import common functions. . ./common/filter -. ./common/btrfs # real QA test starts here
tests/xfs/422 +0 -1
@@ -17,7 +17,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs
tests/xfs/423 +0 -1
@@ -18,7 +18,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs
tests/xfs/517 +0 -1
@@ -23,7 +23,6 @@ _cleanup() . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs
Signature · 1 line
2.31.1
Re: [PATCH 2/2] tests: remove redundant common/$FSTYP importing
Quoted 31 lines · Zorro Lang
As fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again.
Signed-off-by Zorro Lang <[email protected]>--- tests/btrfs/177 | 1 - tests/btrfs/258 | 1 - tests/btrfs/259 | 1 - tests/xfs/422 | 1 - tests/xfs/423 | 1 - tests/xfs/517 | 1 - 6 files changed, 6 deletions(-)tests/btrfs/177 +0
-1@@ -10,7 +10,6 @@ _begin_fstest auto quick swap balance . ./common/filter -. ./common/btrfs # Modify as appropriate. _supported_fs btrfstests/btrfs/258 +0
-0
tests/btrfs/258 line 14
Quoted 4 lines
tests/btrfs/258 +0
-1@@ -11,7 +11,6 @@ _begin_fstest auto defrag quick . ./common/btrfs -. ./common/filter
I think you removed the wrong line here.
-Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 2/2] tests: remove redundant common/$FSTYP importing
Quoted 34 lines · Dave Chinner
Quoted 33 lines · Zorro Lang
As fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again.
Signed-off-by Zorro Lang <[email protected]>--- tests/btrfs/177 | 1 - tests/btrfs/258 | 1 - tests/btrfs/259 | 1 - tests/xfs/422 | 1 - tests/xfs/423 | 1 - tests/xfs/517 | 1 - 6 files changed, 6 deletions(-)tests/btrfs/177 +0
-1@@ -10,7 +10,6 @@ _begin_fstest auto quick swap balance . ./common/filter -. ./common/btrfs # Modify as appropriate. _supported_fs btrfstests/btrfs/258 +0
-0@@ -11,7 +11,6 @@ _begin_fstest auto defrag quick
Quoted 4 lines
tests/btrfs/258 line 14
Quoted 2 lines
tests/btrfs/258 +0
-1. ./common/btrfs -. ./common/filterI think you removed the wrong line here.
Oh, sorry, we resend this patch again.
Thanks,
Zorro
Quoted 6 lines
-Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v2 2/2 tests: remove redundant common/$FSTYP importing
In reply to Zorro LangAs fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again.
---
I removed "./common/filter" in btrfs/258 uncarefully, fix that in this V2.
Thanks,
Zorro
tests/btrfs/177 | 1 - tests/btrfs/258 | 1 - tests/btrfs/259 | 1 - tests/xfs/422 | 1 - tests/xfs/423 | 1 - tests/xfs/517 | 1 - 6 files changed, 6 deletions(-)
tests/btrfs/177 +0 -1
@@ -10,7 +10,6 @@ _begin_fstest auto quick swap balance . ./common/filter -. ./common/btrfs # Modify as appropriate. _supported_fs btrfs
tests/btrfs/258 +0 -1
@@ -10,7 +10,6 @@ . ./common/preamble _begin_fstest auto defrag quick -. ./common/btrfs . ./common/filter # real QA test starts here
tests/btrfs/259 +0 -1
@@ -12,7 +12,6 @@ _begin_fstest auto quick defrag # Import common functions. . ./common/filter -. ./common/btrfs # real QA test starts here
tests/xfs/422 +0 -1
@@ -17,7 +17,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs
tests/xfs/423 +0 -1
@@ -18,7 +18,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs
tests/xfs/517 +0 -1
@@ -23,7 +23,6 @@ _cleanup() . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs
Signature · 1 line
2.31.1
Re: [PATCH v2 2/2] tests: remove redundant common/$FSTYP importing
Quoted 5 lines · Zorro Lang
As fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again.
Signed-off-by Zorro Lang <[email protected]>
Looks good now.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH v2 2/2] tests: remove redundant common/$FSTYP importing
In reply to Zorro LangQuoted 7 lines · Zorro Lang
As fstests intensively source specific common/$FSTYP files in common/rc, at the beginning of ./check running. Each single case doesn't need to import that again.
Signed-off-by Zorro Lang <[email protected]>---
Looks fine.
Quoted 89 lines
I removed "./common/filter" in btrfs/258 uncarefully, fix that in this V2.
Thanks,
Zorrotests/btrfs/177 | 1 - tests/btrfs/258 | 1 - tests/btrfs/259 | 1 - tests/xfs/422 | 1 - tests/xfs/423 | 1 - tests/xfs/517 | 1 - 6 files changed, 6 deletions(-)tests/btrfs/177 +0
-1@@ -10,7 +10,6 @@ _begin_fstest auto quick swap balance . ./common/filter -. ./common/btrfs # Modify as appropriate. _supported_fs btrfstests/btrfs/258 +0
-1@@ -10,7 +10,6 @@ . ./common/preamble _begin_fstest auto defrag quick -. ./common/btrfs . ./common/filter # real QA test starts heretests/btrfs/259 +0
-1@@ -12,7 +12,6 @@ _begin_fstest auto quick defrag # Import common functions. . ./common/filter -. ./common/btrfs # real QA test starts heretests/xfs/422 +0
-1@@ -17,7 +17,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfstests/xfs/423 +0
-1@@ -18,7 +18,6 @@ _register_cleanup "_cleanup" BUS . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfstests/xfs/517 +0
-2@@ -23,7 +23,6 @@ _cleanup() . ./common/filter . ./common/fuzzy . ./common/inject -. ./common/xfs # real QA test starts here _supported_fs xfs --2.31.1