MCPcopy Create free account
hub / github.com/encodeous/nylon / TestCentralConfigValidator_AnycastPrefix

Function TestCentralConfigValidator_AnycastPrefix

state/validation_test.go:156–191  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

154}
155
156func TestCentralConfigValidator_AnycastPrefix(t *testing.T) {
157 // Anycast routing allows the same prefix to be advertised by multiple nodes
158 cfg := &CentralCfg{
159 Routers: []RouterCfg{
160 {
161 NodeCfg: NodeCfg{
162 Id: "node1",
163 PubKey: NyPublicKey{},
164 Prefixes: []PrefixHealthWrapper{
165 {
166 &StaticPrefixHealth{
167 Prefix: netip.MustParsePrefix("10.5.0.1/32"),
168 Metric: 0,
169 },
170 },
171 },
172 },
173 },
174 {
175 NodeCfg: NodeCfg{
176 Id: "node2",
177 PubKey: NyPublicKey{},
178 Prefixes: []PrefixHealthWrapper{
179 {
180 &StaticPrefixHealth{
181 Prefix: netip.MustParsePrefix("10.5.0.1/32"), // same prefix as node1 - this is valid for anycast
182 Metric: 0,
183 },
184 },
185 },
186 },
187 },
188 },
189 }
190 assert.NoError(t, CentralConfigValidator(cfg))
191}

Callers

nothing calls this directly

Calls 1

CentralConfigValidatorFunction · 0.85

Tested by

no test coverage detected