(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestNodeUpdater_setNetInfo_same(t *testing.T) { |
| 74 | t.Parallel() |
| 75 | ctx := testutil.Context(t, testutil.WaitShort) |
| 76 | logger := testutil.Logger(t) |
| 77 | id := tailcfg.NodeID(1) |
| 78 | nodeKey := key.NewNode().Public() |
| 79 | discoKey := key.NewDisco().Public() |
| 80 | nodeCh := make(chan *Node) |
| 81 | uut := newNodeUpdater( |
| 82 | logger, |
| 83 | func(n *Node) { |
| 84 | nodeCh <- n |
| 85 | }, |
| 86 | id, nodeKey, discoKey, |
| 87 | ) |
| 88 | defer uut.close() |
| 89 | |
| 90 | // Then: we don't configure |
| 91 | requireNeverConfigures(ctx, t, &uut.phased) |
| 92 | |
| 93 | // Given: preferred DERP and latency already set |
| 94 | dl := map[string]float64{"1": 0.025} |
| 95 | uut.L.Lock() |
| 96 | uut.preferredDERP = 1 |
| 97 | uut.derpLatency = maps.Clone(dl) |
| 98 | uut.L.Unlock() |
| 99 | |
| 100 | // When: new update with same info |
| 101 | uut.setNetInfo(&tailcfg.NetInfo{ |
| 102 | PreferredDERP: 1, |
| 103 | DERPLatency: dl, |
| 104 | }) |
| 105 | |
| 106 | done := make(chan struct{}) |
| 107 | go func() { |
| 108 | defer close(done) |
| 109 | uut.close() |
| 110 | }() |
| 111 | _ = testutil.TryReceive(ctx, t, done) |
| 112 | } |
| 113 | |
| 114 | func TestNodeUpdater_setDERPForcedWebsocket_different(t *testing.T) { |
| 115 | t.Parallel() |
nothing calls this directly
no test coverage detected