MCPcopy Index your code
hub / github.com/tailscale/tailscale / TestUpdateDiscoForNode

Function TestUpdateDiscoForNode

control/controlclient/map_test.go:629–790  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

627}
628
629func TestUpdateDiscoForNode(t *testing.T) {
630 tests := []struct {
631 name string
632 initialOnline bool
633 initialLastSeen time.Time
634 updateDiscoKey bool
635 updateOnline bool
636 updateLastSeen time.Time
637 wantUpdate bool
638 wantKeyChanged bool
639 }{
640 {
641 name: "newer_key_not_online",
642 initialOnline: true,
643 initialLastSeen: time.Unix(1, 0),
644 updateDiscoKey: true,
645 updateOnline: false,
646 updateLastSeen: time.Now(),
647 wantUpdate: true,
648 wantKeyChanged: true,
649 },
650 {
651 name: "newer_key_online",
652 initialOnline: true,
653 initialLastSeen: time.Unix(1, 0),
654 updateDiscoKey: true,
655 updateOnline: true,
656 updateLastSeen: time.Now(),
657 wantUpdate: true,
658 wantKeyChanged: true,
659 },
660 {
661 name: "older_key_not_online",
662 initialOnline: false,
663 initialLastSeen: time.Now(),
664 updateDiscoKey: true,
665 updateOnline: false,
666 updateLastSeen: time.Unix(1, 0),
667 wantUpdate: false,
668 wantKeyChanged: false,
669 },
670 {
671 name: "older_key_online",
672 initialOnline: false,
673 initialLastSeen: time.Now(),
674 updateDiscoKey: true,
675 updateOnline: true,
676 updateLastSeen: time.Unix(1, 0),
677 wantUpdate: true,
678 wantKeyChanged: true,
679 },
680 {
681 name: "same_newer_key_not_online",
682 initialOnline: true,
683 initialLastSeen: time.Unix(1, 0),
684 updateDiscoKey: false,
685 updateOnline: false,
686 updateLastSeen: time.Now(),

Callers

nothing calls this directly

Calls 15

NewDiscoFunction · 0.92
NewNodeFunction · 0.92
newTestMapSessionFunction · 0.85
netmapForResponseMethod · 0.80
updateDiscoForNodeMethod · 0.80
DiscoKeyMethod · 0.80
NowMethod · 0.65
RunMethod · 0.65
CloseMethod · 0.65
IsZeroMethod · 0.65
FatalfMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…