2022-04-26 15:01:40 +00:00
|
|
|
package container_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-03-07 11:20:03 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
|
|
|
containertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/test"
|
|
|
|
netmaptest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap/test"
|
2022-04-26 15:01:40 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestContainer_NetworkConfig(t *testing.T) {
|
|
|
|
c := containertest.Container()
|
|
|
|
nc := netmaptest.NetworkInfo()
|
|
|
|
|
|
|
|
t.Run("default", func(t *testing.T) {
|
|
|
|
require.False(t, container.IsHomomorphicHashingDisabled(c))
|
|
|
|
|
|
|
|
res := container.AssertNetworkConfig(c, nc)
|
|
|
|
|
|
|
|
require.True(t, res)
|
|
|
|
})
|
|
|
|
|
|
|
|
nc.DisableHomomorphicHashing()
|
|
|
|
|
|
|
|
t.Run("apply", func(t *testing.T) {
|
|
|
|
require.False(t, container.IsHomomorphicHashingDisabled(c))
|
|
|
|
|
|
|
|
container.ApplyNetworkConfig(&c, nc)
|
|
|
|
|
|
|
|
require.True(t, container.IsHomomorphicHashingDisabled(c))
|
|
|
|
})
|
|
|
|
}
|