forked from TrueCloudLab/frostfs-node
Add Inner Ring code
This commit is contained in:
parent
dadfd90dcd
commit
b7b5079934
400 changed files with 11420 additions and 8690 deletions
39
pkg/core/netmap/netmap_test.go
Normal file
39
pkg/core/netmap/netmap_test.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNetMap_Nodes(t *testing.T) {
|
||||
nm := New()
|
||||
|
||||
info1 := Info{}
|
||||
info1.SetPublicKey([]byte{1, 2, 3})
|
||||
|
||||
info2 := Info{}
|
||||
info2.SetPublicKey([]byte{4, 5, 6})
|
||||
|
||||
nodes := []Info{
|
||||
info1,
|
||||
info2,
|
||||
}
|
||||
|
||||
nm.SetNodes(nodes)
|
||||
|
||||
require.Equal(t, nodes, nm.Nodes())
|
||||
}
|
||||
|
||||
func TestNetMap_Root(t *testing.T) {
|
||||
nm := New()
|
||||
|
||||
bucket := &Bucket{
|
||||
Key: "key",
|
||||
Value: "value",
|
||||
}
|
||||
|
||||
nm.SetRoot(bucket)
|
||||
|
||||
require.Equal(t, bucket, nm.Root())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue