| 26 | } |
| 27 | |
| 28 | func LostTest(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) { |
| 29 | p1 := NewPeer(ctx, t, coordinator, "p1") |
| 30 | defer p1.Close(ctx) |
| 31 | p2 := NewPeer(ctx, t, coordinator, "p2") |
| 32 | defer p2.Close(ctx) |
| 33 | p1.AddTunnel(p2.ID) |
| 34 | p1.UpdateDERP(1) |
| 35 | p2.UpdateDERP(2) |
| 36 | |
| 37 | p1.AssertEventuallyHasDERP(p2.ID, 2) |
| 38 | p2.AssertEventuallyHasDERP(p1.ID, 1) |
| 39 | |
| 40 | p2.Close(ctx) |
| 41 | p1.AssertEventuallyLost(p2.ID) |
| 42 | } |
| 43 | |
| 44 | func BidirectionalTunnels(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) { |
| 45 | p1 := NewPeer(ctx, t, coordinator, "p1") |