MCPcopy
hub / github.com/gliderlabs/ssh / TestLocalPortForwardingWorks

Function TestLocalPortForwardingWorks

tcpip_test.go:51–68  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestLocalPortForwardingWorks(t *testing.T) {
52 t.Parallel()
53
54 l, client, cleanup := newTestSessionWithForwarding(t, true)
55 defer cleanup()
56
57 conn, err := client.Dial("tcp", l.Addr().String())
58 if err != nil {
59 t.Fatalf("Error connecting to %v: %v", l.Addr().String(), err)
60 }
61 result, err := io.ReadAll(conn)
62 if err != nil {
63 t.Fatal(err)
64 }
65 if !bytes.Equal(result, sampleServerResponse) {
66 t.Fatalf("result = %#v; want %#v", result, sampleServerResponse)
67 }
68}
69
70func TestLocalPortForwardingRespectsCallback(t *testing.T) {
71 t.Parallel()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…