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

Method SetupNetworking

tailnet/test/integration/network.go:89–114  ·  view source on GitHub ↗
(t *testing.T, _ slog.Logger)

Source from the content-addressed store, hash-verified

87type NetworkingLoopback struct{}
88
89func (NetworkingLoopback) SetupNetworking(t *testing.T, _ slog.Logger) TestNetworking {
90 // Create a single network namespace for all tests so we can have an
91 // isolated loopback interface.
92 netNSFile := createNetNS(t, uniqNetName(t))
93
94 var (
95 listenAddr = "127.0.0.1:8080"
96 process = TestNetworkingProcess{
97 NetNS: netNSFile,
98 }
99 )
100 return TestNetworking{
101 Server: TestNetworkingServer{
102 Process: process,
103 ListenAddr: listenAddr,
104 },
105 Client1: TestNetworkingClient{
106 Process: process,
107 ServerAccessURL: "http://" + listenAddr,
108 },
109 Client2: TestNetworkingClient{
110 Process: process,
111 ServerAccessURL: "http://" + listenAddr,
112 },
113 }
114}
115
116// NetworkingNAT creates a fake internet and sets up "NAT"
117// forwarding rules, either easy or hard.

Callers

nothing calls this directly

Calls 2

createNetNSFunction · 0.85
uniqNetNameFunction · 0.85

Tested by

no test coverage detected