(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestRouterBasicComputeRoutes(t *testing.T) { |
| 31 | tunables := ConfigureConstants() |
| 32 | h := &RouterHarness{} |
| 33 | aPrefix := nodeToPrefix("a") |
| 34 | rs := state.RouterState{ |
| 35 | RouterTunables: tunables, |
| 36 | Id: "a", |
| 37 | SelfSeqno: make(map[netip.Prefix]uint16), |
| 38 | Routes: make(map[netip.Prefix]state.SelRoute), |
| 39 | Sources: make(map[state.Source]state.FD), |
| 40 | Neighbours: MakeNeighbours("b", "c", "d"), |
| 41 | Advertised: map[netip.Prefix]state.Advertisement{aPrefix: {NodeId: state.NodeId("a"), Expiry: maxTime}}, |
| 42 | } |
| 43 | ComputeRoutes(&rs, h) |
| 44 | // we should have only routes to ourselves |
| 45 | if len(rs.Routes) != 1 { |
| 46 | t.Errorf("Expected 1 route, got %d", len(rs.Routes)) |
| 47 | } |
| 48 | if _, ok := rs.Routes[aPrefix]; !ok { |
| 49 | t.Errorf("Expected route to service 'a', but it was not found") |
| 50 | } |
| 51 | out := h.GetActions() |
| 52 | out.AssertContains(t, BroadcastUpdateRoute(MakePubRoute("a", aPrefix, 0, 0))) |
| 53 | } |
| 54 | |
| 55 | func TestRouterNet1A_BasicRetraction(t *testing.T) { |
| 56 | tunables := ConfigureConstants() |
nothing calls this directly
no test coverage detected