MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / TestProgramExternalConnectivity

Function TestProgramExternalConnectivity

network/api_test.go:206–220  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func TestProgramExternalConnectivity(t *testing.T) {
207 request := `{"NetworkID":"d76cfa51738e8a12c5eca71ee69e9d65010a4b48eaad74adab439be7e61b9aaf","EndpointID":"abccfa51738e8a12c5eca71ee69e9d65010a4b48eaad74adab439be7e61b9aaf","Options":{"com.docker.network.endpoint.exposedports":[{"Proto":6,"Port":70}],"com.docker.network.portmap":[{"Proto":6,"IP":"","Port":70,"HostIP":"","HostPort":7000,"HostPortEnd":7000}]}}`
208 response, err := http.Post("http://localhost:32234/NetworkDriver.ProgramExternalConnectivity",
209 sdk.DefaultContentTypeV1_1,
210 strings.NewReader(request))
211 if err != nil {
212 t.Fatal(err)
213 }
214 defer response.Body.Close()
215
216 if response.StatusCode != http.StatusOK {
217 body, _ := io.ReadAll(response.Body)
218 t.Fatalf("Expected %d, got %d: %s\n", http.StatusOK, response.StatusCode, string(body))
219 }
220}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…