forked from TrueCloudLab/frostfs-node
Evgenii Stratonikov
322c1dc273
Semantic patch (restricted to **/*_test.go): ``` @@ @@ +import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger/test" -import "go.uber.org/zap" -import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" -&logger.Logger{Logger: zap.L()} +test.NewLogger(t, false) ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
52 lines
1.4 KiB
Go
52 lines
1.4 KiB
Go
package blobovniczatree
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/common"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/internal/blobstortest"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger/test"
|
|
)
|
|
|
|
func TestGeneric(t *testing.T) {
|
|
const maxObjectSize = 1 << 16
|
|
|
|
helper := func(t *testing.T, dir string) common.Storage {
|
|
return NewBlobovniczaTree(
|
|
WithLogger(test.NewLogger(t, false)),
|
|
WithObjectSizeLimit(maxObjectSize),
|
|
WithBlobovniczaShallowWidth(2),
|
|
WithBlobovniczaShallowDepth(2),
|
|
WithRootPath(dir),
|
|
WithBlobovniczaSize(1<<20))
|
|
}
|
|
|
|
newTree := func(t *testing.T) common.Storage {
|
|
return helper(t, t.TempDir())
|
|
}
|
|
|
|
blobstortest.TestAll(t, newTree, 1024, maxObjectSize)
|
|
|
|
t.Run("info", func(t *testing.T) {
|
|
dir := t.TempDir()
|
|
blobstortest.TestInfo(t, func(t *testing.T) common.Storage {
|
|
return helper(t, dir)
|
|
}, Type, dir)
|
|
})
|
|
}
|
|
|
|
func TestControl(t *testing.T) {
|
|
const maxObjectSize = 2048
|
|
|
|
newTree := func(t *testing.T) common.Storage {
|
|
return NewBlobovniczaTree(
|
|
WithLogger(test.NewLogger(t, false)),
|
|
WithObjectSizeLimit(maxObjectSize),
|
|
WithBlobovniczaShallowWidth(2),
|
|
WithBlobovniczaShallowDepth(2),
|
|
WithRootPath(t.TempDir()),
|
|
WithBlobovniczaSize(1<<20))
|
|
}
|
|
|
|
blobstortest.TestControl(t, newTree, 1024, maxObjectSize)
|
|
}
|