Allow to select insufficient number of nodes #167

Merged
fyrchik merged 3 commits from fyrchik/frostfs-sdk-go:fix-policy into master 2024-09-04 19:51:15 +00:00
Showing only changes of commit c899163860 - Show all commits

View file

@ -2,6 +2,7 @@ package netmap
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"testing"
@ -47,7 +48,8 @@ func TestPlacementPolicy_Interopability(t *testing.T) {
require.NoError(t, err)
for i := range ds {
bs, err := os.ReadFile(filepath.Join(testsDir, ds[i].Name()))
filename := filepath.Join(testsDir, ds[i].Name())
bs, err := os.ReadFile(filename)
require.NoError(t, err)
var tc TestCase
@ -56,7 +58,7 @@ func TestPlacementPolicy_Interopability(t *testing.T) {
srcNodes := make([]NodeInfo, len(tc.Nodes))
copy(srcNodes, tc.Nodes)
t.Run(tc.Name, func(t *testing.T) {
t.Run(fmt.Sprintf("%s:%s", filename, tc.Name), func(t *testing.T) {
var nm NetMap
nm.SetNodes(tc.Nodes)