storj/satellite/repair/repairer/repairer_test.go
Márton Elek 58b98bc335 satellite/repair: repair is configurable to work only on included/excluded placements
This patch finishes the placement aware repair.

We already introduced the parameters to select only the jobs for specific placements, the remaining part is just to configure the exclude/include rules. + a full e2e unit test.

Change-Id: I223ba84e8ab7481a53e5a444596c7a5ae51573c5
2023-09-27 14:54:06 +00:00

29 lines
593 B
Go

// Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.
package repairer
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/zeebo/structs"
"storj.io/common/storj"
)
func TestPlacementList(t *testing.T) {
pl := Config{}
decode := structs.Decode(map[string]string{
"excluded-placements": "1,3,5,6",
}, &pl)
require.NoError(t, decode.Error)
require.Len(t, decode.Broken, 0)
require.Len(t, decode.Missing, 0)
require.Len(t, decode.Used, 1)
require.Equal(t, []storj.PlacementConstraint{1, 3, 5, 6}, pl.ExcludedPlacements.Placements)
}