mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-04 04:34:07 +09:00
servertest: join replayed routers with their routes
A route update sent after the join could be overtaken by the stream's first request and dropped; the probe joined with the routes set.
This commit is contained in:
1 parent
c5d037b347
commit
0b9f8cb6c0
1 file changed
+7
-4
@@ -603,11 +603,18 @@ func (r *stepReplay) apply(t *testing.T, step testcapture.Step) map[string]error
|
||||
r.api(t, step.Name, i, a)
|
||||
|
||||
case "join":
|
||||
// The probe joins with its routes, as `tailscale up
|
||||
// --advertise-routes` does. An update sent after the join can
|
||||
// be overtaken by the stream's first request, which has none.
|
||||
hi := &tailcfg.Hostinfo{
|
||||
BackendLogID: "servertest-" + a.Node,
|
||||
Hostname: a.Hostname,
|
||||
RequestTags: requestTags(a, nil),
|
||||
}
|
||||
if len(a.Routes) > 0 {
|
||||
hi.RoutableIPs = prefixes(t, a.Routes)
|
||||
}
|
||||
|
||||
r.hostinfo[a.Node] = hi
|
||||
|
||||
opts := []servertest.ClientOption{servertest.WithUser(r.admin)}
|
||||
@@ -642,10 +649,6 @@ func (r *stepReplay) apply(t *testing.T, step testcapture.Step) map[string]error
|
||||
continue
|
||||
}
|
||||
|
||||
if len(a.Routes) > 0 {
|
||||
r.announce(ctx, t, a.Node, a.Routes)
|
||||
}
|
||||
|
||||
r.remember(a.Node)
|
||||
|
||||
case "relogin":
|
||||
|
||||
Reference in new issue
Block a user