MCPcopy Index your code
hub / github.com/coder/coder / ReadyForHandshakeTest

Function ReadyForHandshakeTest

tailnet/test/cases.go:58–72  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2)

Source from the content-addressed store, hash-verified

56}
57
58func ReadyForHandshakeTest(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) {
59 p1 := NewPeer(ctx, t, coordinator, "p1")
60 defer p1.Close(ctx)
61 p2 := NewPeer(ctx, t, coordinator, "p2")
62 defer p2.Close(ctx)
63 p1.AddTunnel(p2.ID)
64 p2.AddTunnel(p1.ID)
65 p1.UpdateDERP(1)
66 p2.UpdateDERP(2)
67
68 p1.AssertEventuallyHasDERP(p2.ID, 2)
69 p2.AssertEventuallyHasDERP(p1.ID, 1)
70 p2.ReadyForHandshake(p1.ID)
71 p1.AssertEventuallyReadyForHandshake(p2.ID)
72}
73
74func ReadyForHandshakeNoPermissionTest(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) {
75 p1 := NewPeer(ctx, t, coordinator, "p1")

Callers 1

TestCoordinatorFunction · 0.92

Calls 7

CloseMethod · 0.95
AddTunnelMethod · 0.95
UpdateDERPMethod · 0.95
ReadyForHandshakeMethod · 0.95
NewPeerFunction · 0.85

Tested by 1

TestCoordinatorFunction · 0.74