aboutsummaryrefslogtreecommitdiff
path: root/ssh/test/forward_unix_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ssh/test/forward_unix_test.go')
-rw-r--r--ssh/test/forward_unix_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/ssh/test/forward_unix_test.go b/ssh/test/forward_unix_test.go
index c10d1d0..549d46c 100644
--- a/ssh/test/forward_unix_test.go
+++ b/ssh/test/forward_unix_test.go
@@ -51,6 +51,8 @@ func testPortForward(t *testing.T, n, listenAddr string) {
}
}()
+ // The forwarded address match the listen address because we run the tests
+ // on the same host.
forwardedAddr := sshListener.Addr().String()
netConn, err := net.Dial(n, forwardedAddr)
if err != nil {
@@ -111,6 +113,8 @@ func testPortForward(t *testing.T, n, listenAddr string) {
}
func TestPortForwardTCP(t *testing.T) {
+ testPortForward(t, "tcp", ":0")
+ testPortForward(t, "tcp", "[::]:0")
testPortForward(t, "tcp", "localhost:0")
}