MCPcopy
hub / github.com/moby/moby / TestUDP6Proxy

Function TestUDP6Proxy

cmd/docker-proxy/network_proxy_linux_test.go:380–399  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

378}
379
380func TestUDP6Proxy(t *testing.T) {
381 backend := NewEchoServer(t, "udp", "[::1]:0", EchoServerOptions{})
382 defer backend.Close()
383 backend.Run()
384 listener, frontendAddr := udpListener(t, "udp6", &net.UDPAddr{IP: net.IPv6loopback, Port: 0})
385 backendAddr := backend.LocalAddr().(*net.UDPAddr)
386 config := ProxyConfig{
387 Proto: "udp",
388 HostIP: frontendAddr.IP,
389 HostPort: frontendAddr.Port,
390 ContainerIP: backendAddr.IP,
391 ContainerPort: backendAddr.Port,
392 ListenSock: listener,
393 }
394 proxy, err := newProxy(config)
395 if err != nil {
396 t.Fatal(err)
397 }
398 testProxyAt(t, "udp", proxy, frontendAddr.String(), false)
399}
400
401func TestUDPWriteError(t *testing.T) {
402 frontendAddr := &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0}

Callers

nothing calls this directly

Calls 8

CloseMethod · 0.95
RunMethod · 0.95
LocalAddrMethod · 0.95
NewEchoServerFunction · 0.85
udpListenerFunction · 0.85
newProxyFunction · 0.85
testProxyAtFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…