(t *testing.T)
| 529 | } |
| 530 | |
| 531 | func TestNodeUpdater_setBlockEndpoints_same(t *testing.T) { |
| 532 | t.Parallel() |
| 533 | ctx := testutil.Context(t, testutil.WaitShort) |
| 534 | logger := testutil.Logger(t) |
| 535 | id := tailcfg.NodeID(1) |
| 536 | nodeKey := key.NewNode().Public() |
| 537 | discoKey := key.NewDisco().Public() |
| 538 | nodeCh := make(chan *Node) |
| 539 | uut := newNodeUpdater( |
| 540 | logger, |
| 541 | func(n *Node) { |
| 542 | nodeCh <- n |
| 543 | }, |
| 544 | id, nodeKey, discoKey, |
| 545 | ) |
| 546 | defer uut.close() |
| 547 | |
| 548 | // Then: we don't configure |
| 549 | requireNeverConfigures(ctx, t, &uut.phased) |
| 550 | |
| 551 | // Given: preferred DERP is 1, so we would send an update on change && |
| 552 | // blockEndpoints already set |
| 553 | uut.L.Lock() |
| 554 | uut.preferredDERP = 1 |
| 555 | uut.blockEndpoints = true |
| 556 | uut.L.Unlock() |
| 557 | |
| 558 | // When: we set block endpoints |
| 559 | uut.setBlockEndpoints(true) |
| 560 | |
| 561 | done := make(chan struct{}) |
| 562 | go func() { |
| 563 | defer close(done) |
| 564 | uut.close() |
| 565 | }() |
| 566 | _ = testutil.TryReceive(ctx, t, done) |
| 567 | } |
| 568 | |
| 569 | func TestNodeUpdater_fillPeerDiagnostics(t *testing.T) { |
| 570 | t.Parallel() |
nothing calls this directly
no test coverage detected