From 5ac97e89cf922413b29dcc38a29651bf41670e6c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 22 Oct 2026 07:36:23 -0700 Subject: [PATCH] fuse integration: skip when the host has no FUSE device node Setup failed the test outright on machines without /dev/fuse instead of skipping; cover every suite entry point by skipping inside Setup. --- test/fuse_integration/framework.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/fuse_integration/framework.go b/test/fuse_integration/framework.go index 82a566af76..5b25ff3d8d 100644 --- a/test/fuse_integration/framework.go +++ b/test/fuse_integration/framework.go @@ -185,6 +185,11 @@ func (f *FuseTestFramework) Setup(config *TestConfig) error { return fmt.Errorf("filer not ready: %v", err) } + // Skip rather than fail on a host with no FUSE device to mount through + if !fuseAvailable() { + f.t.Skip("no FUSE device node (/dev/fuse, /dev/macfuse0, /dev/osxfuse0)") + } + // Mount FUSE filesystem if err := f.mountFuse(config); err != nil { return fmt.Errorf("failed to mount FUSE: %v", err) @@ -397,6 +402,17 @@ func (f *FuseTestFramework) waitForMount(timeout time.Duration) error { return fmt.Errorf("mount point not ready within timeout") } +// fuseAvailable reports whether the host has a FUSE device node to mount +// through: /dev/fuse on Linux, /dev/macfuse* or /dev/osxfuse* on macOS. +func fuseAvailable() bool { + for _, dev := range []string{"/dev/fuse", "/dev/macfuse0", "/dev/osxfuse0"} { + if _, err := os.Stat(dev); err == nil { + return true + } + } + return false +} + // findWeedBinary locates the weed binary. Candidates are resolved to // absolute paths because the started processes run with cmd.Dir set to the // framework's temp dir, where a relative path would not resolve.