Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions opencloud/pkg/command/decomposedfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ func setCmd(_ *config.Config) *cobra.Command {

func backend(backend string) metadata.Backend {
switch backend {
case "xattrs":
return metadata.NewXattrsBackend(cache.Config{})
case "mpk":
return metadata.NewMessagePackBackend(cache.Config{})
}
Expand Down
33 changes: 33 additions & 0 deletions opencloud/pkg/command/decomposedfs_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package command

import (
"testing"

"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/metadata"
"github.com/test-go/testify/require"
)

func TestBackend(t *testing.T) {
tests := []struct {
name string
bod string
want metadata.Backend
}{
{
name: "selects messagepack",
bod: "mpk",
want: metadata.MessagePackBackend{},
},
{
name: "xattrs is no longer supported",
bod: "xattrs",
want: metadata.NullBackend{},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
require.IsType(t, tt.want, backend(tt.bod))
})
}
}