frostfs-node/pkg/local_object_storage/blobstor/fstree/generic_test.go
Evgenii Stratonikov b9a2055e1c [#1686] blobstor/*: Return ErrReadOnly for modifying operations
This check should occur on the shard level, but because
blobstor components expose `Open(readOnly bool)` interface,
it is reasonable to expect an error here.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
2022-08-30 10:02:43 +03:00

41 lines
875 B
Go

package fstree
import (
"os"
"path/filepath"
"strconv"
"testing"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/common"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/internal/blobstortest"
)
func TestGeneric(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.TestAll(t, newTree, 2048, 16*1024)
}
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)
}