mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-25 03:01:47 +00:00
fix tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -394,6 +394,9 @@ func testHighFrequencySmallWrites(t *testing.T, framework *FuseTestFramework) {
|
||||
}
|
||||
file.Close()
|
||||
|
||||
// Calculate expected total size
|
||||
totalSize := int64(numWrites * writeSize)
|
||||
|
||||
// Verify file size
|
||||
info, err := os.Stat(mountPath)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
module seaweedfs-posix-tests
|
||||
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.9.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import "testing"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"os"
|
||||
@@ -60,10 +60,6 @@ func (s *POSIXExtendedTestSuite) TestExtendedAttributes(t *testing.T) {
|
||||
err := os.WriteFile(testFile, []byte("xattr test"), 0644)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Set extended attribute
|
||||
attrName := "user.test_attr"
|
||||
attrValue := []byte("test_value")
|
||||
|
||||
// Extended attributes test - platform dependent
|
||||
t.Skip("Extended attributes testing requires platform-specific implementation")
|
||||
})
|
||||
@@ -75,13 +71,6 @@ func (s *POSIXExtendedTestSuite) TestExtendedAttributes(t *testing.T) {
|
||||
err := os.WriteFile(testFile, []byte("list xattr test"), 0644)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Set multiple extended attributes
|
||||
attrs := map[string][]byte{
|
||||
"user.attr1": []byte("value1"),
|
||||
"user.attr2": []byte("value2"),
|
||||
"user.attr3": []byte("value3"),
|
||||
}
|
||||
|
||||
// List extended attributes test - platform dependent
|
||||
t.Skip("Extended attributes testing requires platform-specific implementation")
|
||||
})
|
||||
@@ -93,9 +82,6 @@ func (s *POSIXExtendedTestSuite) TestExtendedAttributes(t *testing.T) {
|
||||
err := os.WriteFile(testFile, []byte("remove xattr test"), 0644)
|
||||
require.NoError(t, err)
|
||||
|
||||
attrName := "user.removeme"
|
||||
attrValue := []byte("to_be_removed")
|
||||
|
||||
// Remove extended attributes test - platform dependent
|
||||
t.Skip("Extended attributes testing requires platform-specific implementation")
|
||||
})
|
||||
@@ -204,17 +190,6 @@ func (s *POSIXExtendedTestSuite) TestAdvancedIO(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
defer syscall.Close(fd)
|
||||
|
||||
// Prepare multiple buffers for writev
|
||||
buf1 := []byte("first")
|
||||
buf2 := []byte("second")
|
||||
buf3 := []byte("third")
|
||||
|
||||
iovecs := []syscall.Iovec{
|
||||
{Base: &buf1[0], Len: uint64(len(buf1))},
|
||||
{Base: &buf2[0], Len: uint64(len(buf2))},
|
||||
{Base: &buf3[0], Len: uint64(len(buf3))},
|
||||
}
|
||||
|
||||
// Vectored I/O test - requires platform-specific implementation
|
||||
t.Skip("Vectored I/O testing requires platform-specific implementation")
|
||||
})
|
||||
@@ -382,35 +357,9 @@ func (s *POSIXExtendedTestSuite) TestMemoryMapping(t *testing.T) {
|
||||
|
||||
// TestDirectIO tests direct I/O operations
|
||||
func (s *POSIXExtendedTestSuite) TestDirectIO(t *testing.T) {
|
||||
mountPoint := s.framework.GetMountPoint()
|
||||
|
||||
t.Run("DirectIO", func(t *testing.T) {
|
||||
testFile := filepath.Join(mountPoint, "direct_io_test.txt")
|
||||
|
||||
// Direct I/O is platform dependent and may not be supported
|
||||
t.Skip("Direct I/O testing requires platform-specific implementation")
|
||||
|
||||
// For direct I/O, buffer must be aligned
|
||||
const blockSize = 4096
|
||||
alignedBuffer := make([]byte, blockSize)
|
||||
for i := range alignedBuffer {
|
||||
alignedBuffer[i] = byte(i % 256)
|
||||
}
|
||||
|
||||
// Write with direct I/O
|
||||
n, err := syscall.Write(fd, alignedBuffer)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, blockSize, n)
|
||||
|
||||
// Read back with direct I/O
|
||||
_, err = syscall.Seek(fd, 0, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
readBuffer := make([]byte, blockSize)
|
||||
n, err = syscall.Read(fd, readBuffer)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, blockSize, n)
|
||||
require.Equal(t, alignedBuffer, readBuffer)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fuse_test
|
||||
package fuse
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
Reference in New Issue
Block a user