]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: fix _require_debugfs and call it properly
authorZorro Lang <zlang@kernel.org>
Fri, 10 May 2024 04:29:45 +0000 (12:29 +0800)
committerZorro Lang <zlang@kernel.org>
Sun, 12 May 2024 12:28:48 +0000 (20:28 +0800)
The old _require_debugfs helper doesn't work now, fix it to check
a system supports debugfs. And then call this helper in cases which
need $DEBUGFS_MNT.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/btrfs/150
tests/ceph/001

index 3f4864d0fbaff9df3a73d0cc360755b6573c9bae..0fe56382a6a497a4cb1f2d05f87f9b63f39acc90 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2983,8 +2983,14 @@ _require_sparse_files()
 
 _require_debugfs()
 {
-    #boot_params always present in debugfs
-    [ -d "$DEBUGFS_MNT/boot_params" ] || _notrun "Debugfs not mounted"
+       local type
+
+       if [ -d "$DEBUGFS_MNT" ];then
+               type=$(findmnt -rncv -T $DEBUGFS_MNT -S debugfs -o FSTYPE)
+               [ "$type" = "debugfs" ] && return 0
+       fi
+
+       _notrun "Cannot find debugfs on $DEBUGFS_MNT"
 }
 
 #
index a02bdafc61c1dca97659533c2c1b7586e427feee..fd386d92d4823c260bd6125e5335685ede9582a8 100755 (executable)
@@ -17,6 +17,7 @@ _begin_fstest auto quick dangerous read_repair compress
 . ./common/fail_make_request
 
 _supported_fs btrfs
+_require_debugfs
 _require_scratch
 _require_fail_make_request
 _require_scratch_dev_pool 2
index 060c4c450091f9af2f45e33b4f5d7092b84838c9..79a5f58acab57960d02fd86efd4a8be4f2e3e082 100755 (executable)
@@ -20,7 +20,7 @@ _begin_fstest auto quick copy_range
 
 # real QA test starts here
 _supported_fs ceph
-
+_require_debugfs
 _require_xfs_io_command "copy_range"
 _exclude_test_mount_option "test_dummy_encryption"
 _require_attrs