MCPcopy Index your code
hub / github.com/coder/coder / TestNodeUpdater_setBlockEndpoints_same

Function TestNodeUpdater_setBlockEndpoints_same

tailnet/node_internal_test.go:531–567  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

529}
530
531func 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
569func TestNodeUpdater_fillPeerDiagnostics(t *testing.T) {
570 t.Parallel()

Callers

nothing calls this directly

Calls 9

ContextFunction · 0.92
LoggerFunction · 0.92
TryReceiveFunction · 0.92
newNodeUpdaterFunction · 0.85
requireNeverConfiguresFunction · 0.85
closeMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
setBlockEndpointsMethod · 0.45

Tested by

no test coverage detected