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

Function BidirectionalTunnels

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

Source from the content-addressed store, hash-verified

42}
43
44func BidirectionalTunnels(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) {
45 p1 := NewPeer(ctx, t, coordinator, "p1")
46 defer p1.Close(ctx)
47 p2 := NewPeer(ctx, t, coordinator, "p2")
48 defer p2.Close(ctx)
49 p1.AddTunnel(p2.ID)
50 p2.AddTunnel(p1.ID)
51 p1.UpdateDERP(1)
52 p2.UpdateDERP(2)
53
54 p1.AssertEventuallyHasDERP(p2.ID, 2)
55 p2.AssertEventuallyHasDERP(p1.ID, 1)
56}
57
58func ReadyForHandshakeTest(ctx context.Context, t *testing.T, coordinator tailnet.CoordinatorV2) {
59 p1 := NewPeer(ctx, t, coordinator, "p1")

Callers 1

Calls 5

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

Tested by 1