Skip to contentSkip to conversation

fstests: fix _require_debugfs and call it properly

PATCH In review Zorro Lang 2 participants 2 messages May 10, 2024

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH v2 1/1 fstests: fix _require_debugfs and call it properly

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.

---

V2 remove the changes on xfs/499, will do it in another patch.

Thanks,
Zorro

 common/rc       | 10 ++++++++--
 tests/btrfs/150 |  1 +
 tests/ceph/001  |  2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)
common/rc +8 -2
index 56f1afb6..6f0bdf60 100644
@@ -2978,8 +2978,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"
 }
 
 #
tests/btrfs/150 +1 -0
index a02bdafc..fd386d92 100755
@@ -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
tests/ceph/001 +1 -1
index 060c4c45..79a5f58a 100755
@@ -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
Signature · 1 line
2.44.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Zorro Lang

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.

--D

Quoted 62 lines

---

V2 remove the changes on xfs/499, will do it in another patch.

Thanks,
Zorro

 common/rc       | 10 ++++++++--
 tests/btrfs/150 |  1 +
 tests/ceph/001  |  2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)
common/rc +8 -2
index 56f1afb6..6f0bdf60 100644
@@ -2978,8 +2978,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"
 }
 
 #
tests/btrfs/150 +1 -0
index a02bdafc..fd386d92 100755
@@ -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
tests/ceph/001 +1 -1
index 060c4c45..79a5f58a 100755
@@ -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
Signature · 1 line
2.44.0