diff options
| author | chrislu <chris.lu@gmail.com> | 2025-08-31 12:04:39 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-08-31 12:04:39 -0700 |
| commit | fd1149e5b26c6a762980f2e36c44a19ab081ee8e (patch) | |
| tree | 6549d4487cf197dc016b5faf74af0ba98ab8360b /test/fuse_integration/posix_external_test.go | |
| parent | 591ca3f2c5af90a6e64c5ca90d91b47ef2c211ae (diff) | |
| download | seaweedfs-fd1149e5b26c6a762980f2e36c44a19ab081ee8e.tar.xz seaweedfs-fd1149e5b26c6a762980f2e36c44a19ab081ee8e.zip | |
fix
Diffstat (limited to 'test/fuse_integration/posix_external_test.go')
| -rw-r--r-- | test/fuse_integration/posix_external_test.go | 13 |
1 files changed, 8 insertions, 5 deletions
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) { |
