forked from TrueCloudLab/frostfs-node
[#607] config/example: Add all formats of node's network addresses
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
6f861b6489
commit
81ddaeca16
4 changed files with 46 additions and 12 deletions
|
@ -40,21 +40,51 @@ func TestNodeSection(t *testing.T) {
|
||||||
|
|
||||||
var fileConfigTest = func(c *config.Config) {
|
var fileConfigTest = func(c *config.Config) {
|
||||||
key := Key(c)
|
key := Key(c)
|
||||||
addr := BootstrapAddresses(c)
|
addrs := BootstrapAddresses(c)
|
||||||
attributes := Attributes(c)
|
attributes := Attributes(c)
|
||||||
relay := Relay(c)
|
relay := Relay(c)
|
||||||
wKey := Wallet(c)
|
wKey := Wallet(c)
|
||||||
|
|
||||||
var expectedAddr network.AddressGroup
|
expectedAddr := []struct {
|
||||||
|
str string
|
||||||
err := expectedAddr.FromIterator(stringAddressGroup([]string{
|
host string
|
||||||
"s01.neofs.devenv:8080",
|
tls bool
|
||||||
"s02.neofs.devenv:8081",
|
}{
|
||||||
}))
|
{
|
||||||
require.NoError(t, err)
|
str: "/dns4/localhost/tcp/8083/tls",
|
||||||
|
host: "localhost:8083",
|
||||||
|
tls: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
str: "/dns4/s01.neofs.devenv/tcp/8080",
|
||||||
|
host: "s01.neofs.devenv:8080",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
str: "/dns4/s02.neofs.devenv/tcp/8081",
|
||||||
|
host: "s02.neofs.devenv:8081",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
str: "/ip4/127.0.0.1/tcp/8082",
|
||||||
|
host: "127.0.0.1:8082",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
require.Equal(t, "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", key.Address())
|
require.Equal(t, "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", key.Address())
|
||||||
require.Equal(t, expectedAddr, addr)
|
|
||||||
|
require.EqualValues(t, len(expectedAddr), addrs.Len())
|
||||||
|
|
||||||
|
ind := 0
|
||||||
|
|
||||||
|
addrs.IterateAddresses(func(addr network.Address) bool {
|
||||||
|
require.Equal(t, expectedAddr[ind].str, addr.String())
|
||||||
|
require.Equal(t, expectedAddr[ind].host, addr.HostAddr())
|
||||||
|
require.Equal(t, expectedAddr[ind].tls, addr.TLSEnabled())
|
||||||
|
|
||||||
|
ind++
|
||||||
|
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
require.Equal(t, true, relay)
|
require.Equal(t, true, relay)
|
||||||
|
|
||||||
require.Len(t, attributes, 2)
|
require.Len(t, attributes, 2)
|
||||||
|
|
|
@ -11,7 +11,7 @@ NEOFS_NODE_KEY=./wallet.key
|
||||||
NEOFS_NODE_WALLET_PATH=./wallet.json
|
NEOFS_NODE_WALLET_PATH=./wallet.json
|
||||||
NEOFS_NODE_WALLET_ADDRESS=NcpJzXcSDrh5CCizf4K9Ro6w4t59J5LKzz
|
NEOFS_NODE_WALLET_ADDRESS=NcpJzXcSDrh5CCizf4K9Ro6w4t59J5LKzz
|
||||||
NEOFS_NODE_WALLET_PASSWORD=password
|
NEOFS_NODE_WALLET_PASSWORD=password
|
||||||
NEOFS_NODE_ADDRESSES=s01.neofs.devenv:8080 s02.neofs.devenv:8081
|
NEOFS_NODE_ADDRESSES=s01.neofs.devenv:8080 /dns4/s02.neofs.devenv/tcp/8081 grpc://127.0.0.1:8082 grpcs://localhost:8083
|
||||||
NEOFS_NODE_ATTRIBUTE_0=Price:11
|
NEOFS_NODE_ATTRIBUTE_0=Price:11
|
||||||
NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU MSK
|
NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU MSK
|
||||||
NEOFS_NODE_RELAY=true
|
NEOFS_NODE_RELAY=true
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
},
|
},
|
||||||
"addresses": [
|
"addresses": [
|
||||||
"s01.neofs.devenv:8080",
|
"s01.neofs.devenv:8080",
|
||||||
"s02.neofs.devenv:8081"
|
"/dns4/s02.neofs.devenv/tcp/8081",
|
||||||
|
"grpc://127.0.0.1:8082",
|
||||||
|
"grpcs://localhost:8083"
|
||||||
],
|
],
|
||||||
"attribute_0": "Price:11",
|
"attribute_0": "Price:11",
|
||||||
"attribute_1": "UN-LOCODE:RU MSK",
|
"attribute_1": "UN-LOCODE:RU MSK",
|
||||||
|
|
|
@ -17,7 +17,9 @@ node:
|
||||||
password: "password"
|
password: "password"
|
||||||
addresses:
|
addresses:
|
||||||
- s01.neofs.devenv:8080
|
- s01.neofs.devenv:8080
|
||||||
- s02.neofs.devenv:8081
|
- /dns4/s02.neofs.devenv/tcp/8081
|
||||||
|
- grpc://127.0.0.1:8082
|
||||||
|
- grpcs://localhost:8083
|
||||||
attribute_0: "Price:11"
|
attribute_0: "Price:11"
|
||||||
attribute_1: UN-LOCODE:RU MSK
|
attribute_1: UN-LOCODE:RU MSK
|
||||||
relay: true
|
relay: true
|
||||||
|
|
Loading…
Reference in a new issue