(t *testing.T, _ slog.Logger)
| 87 | type NetworkingLoopback struct{} |
| 88 | |
| 89 | func (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. |
nothing calls this directly
no test coverage detected