frostfs-node/pkg/local_object_storage/pilorama/mode_test.go
Dmitrii Stepanov 7429553266
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-11-13 10:36:10 +03:00

31 lines
841 B
Go

package pilorama
import (
"context"
"path/filepath"
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
"github.com/stretchr/testify/require"
)
func Test_Mode(t *testing.T) {
t.Parallel()
f := NewBoltForest(
[]Option{
WithPath(filepath.Join(t.TempDir(), "test.db")),
WithMaxBatchSize(1),
}...)
require.NoError(t, f.Open(context.Background(), mode.DegradedReadOnly))
require.Nil(t, f.(*boltForest).db)
require.NoError(t, f.Init(context.Background()))
require.Nil(t, f.(*boltForest).db)
require.NoError(t, f.Close(context.Background()))
require.NoError(t, f.Open(context.Background(), mode.Degraded))
require.Nil(t, f.(*boltForest).db)
require.NoError(t, f.Init(context.Background()))
require.Nil(t, f.(*boltForest).db)
require.NoError(t, f.Close(context.Background()))
}