From fd1149e5b26c6a762980f2e36c44a19ab081ee8e Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 31 Aug 2025 12:04:39 -0700 Subject: fix --- test/fuse_integration/posix_external_test.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test/fuse_integration/posix_external_test.go') diff --git a/test/fuse_integration/posix_external_test.go b/test/fuse_integration/posix_external_test.go index f22b65438..e1ca0b5e7 100644 --- a/test/fuse_integration/posix_external_test.go +++ b/test/fuse_integration/posix_external_test.go @@ -191,7 +191,8 @@ set -e cd "$1" ln -s link1 link2 ln -s link2 link1 -if [ -f link1 ]; then +# Try to access the file, which should fail due to too many symbolic links +if cat link1 2>/dev/null; then echo "FAIL: Symlink cycle not detected" exit 1 fi @@ -470,11 +471,13 @@ func (s *ExternalPOSIXTestSuite) testEdgeCases(t *testing.T, mountPoint string) require.NoError(t, err) defer os.RemoveAll(testDir) - t.Run("EmptyFileName", func(t *testing.T) { - // Test creating files with empty names (should fail) - emptyFile := filepath.Join(testDir, "") - err := os.WriteFile(emptyFile, []byte("test"), 0644) + t.Run("WriteToDirectoryAsFile", func(t *testing.T) { + // Test writing to a directory as if it were a file (should fail) + // Note: filepath.Join(testDir, "") returns testDir itself + err := os.WriteFile(testDir, []byte("test"), 0644) require.Error(t, err) + // Verify the error indicates we're trying to write to a directory + require.Contains(t, err.Error(), "directory", "Expected error to indicate target is a directory") }) t.Run("VeryLongFileName", func(t *testing.T) { -- cgit v1.2.3