summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/map_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'control/controlclient/map_test.go')
-rw-r--r--control/controlclient/map_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/control/controlclient/map_test.go b/control/controlclient/map_test.go
index 679c48c17..8cf0156d8 100644
--- a/control/controlclient/map_test.go
+++ b/control/controlclient/map_test.go
@@ -717,6 +717,15 @@ func TestUpdateDiscoForNode(t *testing.T) {
wantUpdate: true,
wantKeyChanged: false,
},
+ {
+ name: "no_initial_last_seen",
+ initialOnline: false,
+ updateDiscoKey: true,
+ updateOnline: false,
+ updateLastSeen: time.Now(),
+ wantUpdate: true,
+ wantKeyChanged: true,
+ },
}
for _, tt := range tests {
@@ -736,7 +745,9 @@ func TestUpdateDiscoForNode(t *testing.T) {
Key: key.NewNode().Public(),
DiscoKey: oldKey.Public(),
Online: &tt.initialOnline,
- LastSeen: &tt.initialLastSeen,
+ }
+ if !tt.initialLastSeen.IsZero() {
+ node.LastSeen = &tt.initialLastSeen
}
if nm := ms.netmapForResponse(&tailcfg.MapResponse{