|
|
@ -741,16 +741,15 @@ func TestNewUserWebFlow(t *testing.T) {
|
|
|
|
if len(peers) != 1 {
|
|
|
|
if len(peers) != 1 {
|
|
|
|
t.Errorf("len(peers)=%d, want 1", len(peers))
|
|
|
|
t.Errorf("len(peers)=%d, want 1", len(peers))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var nodeExp time.Time
|
|
|
|
if nodes, err := s.control.DB().AllNodes(netmap.User); err != nil {
|
|
|
|
if nodes, err := s.control.DB().AllNodes(netmap.User); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
t.Fatal(err)
|
|
|
|
} else if len(nodes) != 1 {
|
|
|
|
} else if len(nodes) != 1 {
|
|
|
|
t.Errorf("len(nodes)=%d, want 1", len(nodes))
|
|
|
|
t.Errorf("len(nodes)=%d, want 1", len(nodes))
|
|
|
|
} else if exp := nodes[0].KeyExpiry; exp.After(c.timeNow()) {
|
|
|
|
} else if nodeExp = nodes[0].KeyExpiry; c.timeNow().Sub(nodeExp) > 24*time.Hour {
|
|
|
|
t.Errorf("node[0] expiry=%v, want it to have passed", exp)
|
|
|
|
t.Errorf("node[0] expiry=%v, want it to be in less than a day", nodeExp)
|
|
|
|
}
|
|
|
|
} else if got := c.status(t).New.NetMap.Expiry; !got.Equal(nodeExp) {
|
|
|
|
netmap := c.status(t).New.NetMap
|
|
|
|
t.Errorf("expiry=%v, want it to be %v", got, nodeExp)
|
|
|
|
if exp := netmap.Expiry; exp.After(c.timeNow()) {
|
|
|
|
|
|
|
|
t.Errorf("expiry=%v, want it to have passed", exp)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|