From 41088e93f6d7abe0f816c2f85216a367e23b8953 Mon Sep 17 00:00:00 2001 From: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:46:29 -0700 Subject: [PATCH] fuse integration: verify TEST_MOUNT_POINT is a real mount --- test/fuse_integration/framework.go | 6 ++++++ test/fuse_integration/mounted_unix.go | 19 ++++++++++++++++++- test/fuse_integration/mounted_unsupported.go | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/test/fuse_integration/framework.go b/test/fuse_integration/framework.go index 5b25ff3d8d..71eaf61873 100644 --- a/test/fuse_integration/framework.go +++ b/test/fuse_integration/framework.go @@ -103,6 +103,12 @@ func (f *FuseTestFramework) Setup(config *TestConfig) error { return fmt.Errorf("existing mount point not accessible: %v", err) } + // A plain directory passes every check below; refuse to run the suite + // against the local disk + if !mountedAt(existingMount) { + return fmt.Errorf("mount point %s is not a mounted filesystem", existingMount) + } + // Run inside a private work dir so test files do not pile up in // the shared mount root and cleanup can remove only what it made workDir, err := os.MkdirTemp(existingMount, ".fuse_test_") diff --git a/test/fuse_integration/mounted_unix.go b/test/fuse_integration/mounted_unix.go index 3e3fd0877d..85889b9ac4 100644 --- a/test/fuse_integration/mounted_unix.go +++ b/test/fuse_integration/mounted_unix.go @@ -2,7 +2,10 @@ package fuse -import "syscall" +import ( + "path/filepath" + "syscall" +) // deviceID returns the device ID of the filesystem containing path. func deviceID(path string) (uint64, error) { @@ -12,3 +15,17 @@ func deviceID(path string) (uint64, error) { } return uint64(st.Dev), nil } + +// mountedAt reports whether something is actually mounted at path: a plain +// directory shares its parent's device, a mount point does not. +func mountedAt(path string) bool { + dev, err := deviceID(path) + if err != nil { + return false + } + parentDev, err := deviceID(filepath.Dir(path)) + if err != nil { + return false + } + return dev != parentDev +} diff --git a/test/fuse_integration/mounted_unsupported.go b/test/fuse_integration/mounted_unsupported.go index b59a080d5d..c288b8c2e1 100644 --- a/test/fuse_integration/mounted_unsupported.go +++ b/test/fuse_integration/mounted_unsupported.go @@ -8,3 +8,9 @@ package fuse func deviceID(path string) (uint64, error) { return 0, nil } + +// mountedAt cannot be detected off unix; report mounted so an external +// TEST_MOUNT_POINT keeps its best-effort write verification. +func mountedAt(path string) bool { + return true +}