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

Function TestCentralConfigValidator_DuplicatePrefix

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

Source from the content-addressed store, hash-verified

120}
121
122func TestCentralConfigValidator_DuplicatePrefix(t *testing.T) {
123 cfg := &CentralCfg{
124 Routers: []RouterCfg{
125 {
126 NodeCfg: NodeCfg{
127 Id: "node1",
128 PubKey: NyPublicKey{},
129 Prefixes: []PrefixHealthWrapper{
130 {
131 &StaticPrefixHealth{
132 Prefix: netip.MustParsePrefix("10.5.0.1/32"),
133 Metric: 0,
134 },
135 },
136 {
137 &StaticPrefixHealth{
138 Prefix: netip.MustParsePrefix("10.5.0.1/24"),
139 Metric: 0,
140 },
141 },
142 {
143 &StaticPrefixHealth{
144 Prefix: netip.MustParsePrefix("10.5.0.1/32"),
145 Metric: 0,
146 },
147 },
148 },
149 },
150 },
151 },
152 }
153 assert.Error(t, CentralConfigValidator(cfg))
154}
155
156func TestCentralConfigValidator_AnycastPrefix(t *testing.T) {
157 // Anycast routing allows the same prefix to be advertised by multiple nodes

Callers

nothing calls this directly

Calls 2

CentralConfigValidatorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected