forked from TrueCloudLab/frostfs-node
24 lines
613 B
Go
24 lines
613 B
Go
package policer
|
|
|
|
import (
|
|
"testing"
|
|
|
|
netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestNodeCache(t *testing.T) {
|
|
cache := newNodeCache()
|
|
node := netmaptest.NodeInfo()
|
|
|
|
require.Equal(t, cache.processStatus(node), nodeNotProcessed)
|
|
|
|
cache.SubmitSuccessfulReplication(node)
|
|
require.Equal(t, cache.processStatus(node), nodeHoldsObject)
|
|
|
|
cache.submitReplicaCandidate(node)
|
|
require.Equal(t, cache.processStatus(node), nodeDoesNotHoldObject)
|
|
|
|
cache.submitReplicaHolder(node)
|
|
require.Equal(t, cache.processStatus(node), nodeHoldsObject)
|
|
}
|