forked from TrueCloudLab/frostfs-node
923f84722a
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
24 lines
536 B
Go
24 lines
536 B
Go
package policer
|
|
|
|
import (
|
|
"testing"
|
|
|
|
netmaptest "github.com/TrueCloudLab/frostfs-sdk-go/netmap/test"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestNodeCache(t *testing.T) {
|
|
cache := newNodeCache()
|
|
node := netmaptest.NodeInfo()
|
|
|
|
require.Negative(t, cache.processStatus(node))
|
|
|
|
cache.SubmitSuccessfulReplication(node)
|
|
require.Zero(t, cache.processStatus(node))
|
|
|
|
cache.submitReplicaCandidate(node)
|
|
require.Positive(t, cache.processStatus(node))
|
|
|
|
cache.submitReplicaHolder(node)
|
|
require.Zero(t, cache.processStatus(node))
|
|
}
|