| 56 | } |
| 57 | |
| 58 | func 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 | |
| 74 | func ReadyForHandshakeNoPermissionTest(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) { |
| 75 | p1 := NewPeer(ctx, t, coordinator, "p1") |