(t *testing.T)
| 154 | } |
| 155 | |
| 156 | func 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 | } |
nothing calls this directly
no test coverage detected