forked from TrueCloudLab/frostfs-node
923f84722a
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
52 lines
1.1 KiB
Go
52 lines
1.1 KiB
Go
package fstree
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strconv"
|
|
"testing"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/common"
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/internal/blobstortest"
|
|
)
|
|
|
|
func TestGeneric(t *testing.T) {
|
|
defer func() { _ = os.RemoveAll(t.Name()) }()
|
|
|
|
helper := func(t *testing.T, dir string) common.Storage {
|
|
return New(
|
|
WithPath(dir),
|
|
WithDepth(2),
|
|
WithDirNameLen(2))
|
|
}
|
|
|
|
var n int
|
|
newTree := func(t *testing.T) common.Storage {
|
|
dir := filepath.Join(t.Name(), strconv.Itoa(n))
|
|
return helper(t, dir)
|
|
}
|
|
|
|
blobstortest.TestAll(t, newTree, 2048, 16*1024)
|
|
|
|
t.Run("info", func(t *testing.T) {
|
|
dir := filepath.Join(t.Name(), "info")
|
|
blobstortest.TestInfo(t, func(t *testing.T) common.Storage {
|
|
return helper(t, dir)
|
|
}, Type, dir)
|
|
})
|
|
}
|
|
|
|
func TestControl(t *testing.T) {
|
|
defer func() { _ = os.RemoveAll(t.Name()) }()
|
|
|
|
var n int
|
|
newTree := func(t *testing.T) common.Storage {
|
|
dir := filepath.Join(t.Name(), strconv.Itoa(n))
|
|
return New(
|
|
WithPath(dir),
|
|
WithDepth(2),
|
|
WithDirNameLen(2))
|
|
}
|
|
|
|
blobstortest.TestControl(t, newTree, 2048, 2048)
|
|
}
|