(t *testing.T)
| 120 | } |
| 121 | |
| 122 | func 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 | |
| 156 | func TestCentralConfigValidator_AnycastPrefix(t *testing.T) { |
| 157 | // Anycast routing allows the same prefix to be advertised by multiple nodes |
nothing calls this directly
no test coverage detected