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

Function TestConciseDiffFrom

types/netmap/netmap_test.go:94–292  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestConciseDiffFrom(t *testing.T) {
95 for _, tt := range []struct {
96 name string
97 a, b *NetworkMap
98 want string
99 }{
100 {
101 name: "no_change",
102 a: &NetworkMap{
103 NodeKey: testNodeKey(1),
104 Peers: nodeViews([]*tailcfg.Node{
105 {
106 Key: testNodeKey(2),
107 HomeDERP: 2,
108 Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"),
109 },
110 }),
111 },
112 b: &NetworkMap{
113 NodeKey: testNodeKey(1),
114 Peers: nodeViews([]*tailcfg.Node{
115 {
116 Key: testNodeKey(2),
117 HomeDERP: 2,
118 Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"),
119 },
120 }),
121 },
122 want: "",
123 },
124 {
125 name: "header_change",
126 a: &NetworkMap{
127 NodeKey: testNodeKey(1),
128 Peers: nodeViews([]*tailcfg.Node{
129 {
130 Key: testNodeKey(2),
131 HomeDERP: 2,
132 Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"),
133 },
134 }),
135 },
136 b: &NetworkMap{
137 NodeKey: testNodeKey(2),
138 Peers: nodeViews([]*tailcfg.Node{
139 {
140 Key: testNodeKey(2),
141 HomeDERP: 2,
142 Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"),
143 },
144 }),
145 },
146 want: "-netmap: self: [AQEBA] auth=machine-unknown u=? []\n+netmap: self: [AgICA] auth=machine-unknown u=? []\n",
147 },
148 {
149 name: "peer_add",
150 a: &NetworkMap{
151 NodeKey: testNodeKey(1),

Callers

nothing calls this directly

Calls 9

IPv4Function · 0.92
testNodeKeyFunction · 0.85
testDiscoKeyFunction · 0.85
ConciseDiffFromMethod · 0.80
nodeViewsFunction · 0.70
epsFunction · 0.70
RunMethod · 0.65
LogfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…