Linux block layer
 help / color / mirror / Atom feed
* [PATCH v2 blktests 1/2] common/rc: add _have_debugfs()
@ 2026-07-16 10:08 Sebastian Chlad
  2026-07-16 10:08 ` [PATCH blktests v2 2/2] nvme/039: skip cleanly when debugfs is not mounted Sebastian Chlad
  2026-07-23 13:02 ` [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Shin'ichiro Kawasaki
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Chlad @ 2026-07-16 10:08 UTC (permalink / raw)
  To: linux-block; +Cc: Shin'ichiro Kawasaki, Sebastian Chlad

Kernel options like FAULT_INJECTION_DEBUG_FS being enabled does not
guarantee debugfs is actually mounted at /sys/kernel/debug: on
systemd systems, sys-kernel-debug.mount may not be started by
default (e.g. SLE).

Add _have_debugfs(), mirroring the existing _have_configfs() and
_have_tracefs() checks, so tests that depend on debugfs-backed
interfaces can skip cleanly with a clear reason instead of failing.

Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
---
 common/rc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/rc b/common/rc
index d60a125..de5eb6d 100644
--- a/common/rc
+++ b/common/rc
@@ -223,6 +223,14 @@ _have_configfs() {
 	return 0
 }
 
+_have_debugfs() {
+	if ! findmnt -t debugfs /sys/kernel/debug >/dev/null; then
+		SKIP_REASONS+=("debugfs is not mounted at /sys/kernel/debug")
+		return 1
+	fi
+	return 0
+}
+
 # Check if the specified kernel config files are available.
 _have_kernel_config_file() {
 	if [[ ! -f /proc/config.gz && ! -f /boot/config-$(uname -r) ]]; then
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-23 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 10:08 [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Sebastian Chlad
2026-07-16 10:08 ` [PATCH blktests v2 2/2] nvme/039: skip cleanly when debugfs is not mounted Sebastian Chlad
2026-07-23 13:02 ` [PATCH v2 blktests 1/2] common/rc: add _have_debugfs() Shin'ichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox