diff --git a/main.go b/main.go index 3cd1cd9..266936e 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ var log = logrus.New() var opts struct { HostPort string `long:"host_port" default:"8080" description:"Port to host on"` - DestHost string `long:"dst_hst" default:"127.0.0.1:8080" description:"Destination host to target for tests"` + DestHost string `long:"dst_hst" default:"localhost:8080" description:"Destination host to target for tests"` TimeBetTests float64 `long:"wait_time" default:"5" description:"Minimum time between individual tests"` RandTimeTest float64 `long:"rand_secs" default:"5.0" description:"Maximum random time to be added to TimeBetTests"` ShortTestBytes int `long:"short_test_bytes" default:"10" description:"Bytes to use for short tests"` diff --git a/src/tcpconn/tcpconn_test.go b/src/tcpconn/tcpconn_test.go index 66d3b06..d966869 100644 --- a/src/tcpconn/tcpconn_test.go +++ b/src/tcpconn/tcpconn_test.go @@ -11,7 +11,7 @@ import ( // TestOnceSmallPacketOneConn sends one small packet using one connection func TestOnceSmallPacketOneConn(t *testing.T) { addr := "0.0.0.0:9999" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close() @@ -31,7 +31,7 @@ func TestOnceSmallPacketOneConn(t *testing.T) { // Note that the port used each time may be different func TestMultiSmallPacketsSeqConn(t *testing.T) { addr := "0.0.0.0:9998" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close() @@ -59,7 +59,7 @@ func makeConnection(t *testing.T, ch chan bool, addr string, timeBetSend float64 // Depending on the local environment, the test may fail if there are too many sockets being used at the same time func TestMultiSmallPacketsConcConn(t *testing.T) { addr := "0.0.0.0:9997" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close() @@ -91,7 +91,7 @@ func TestMultiSmallPacketsConcConn(t *testing.T) { // **Cumulative connections toned down to 500 while investigating a minor connection issue** func TestCumulativeConnections(t *testing.T) { addr := "0.0.0.0:9996" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close() @@ -123,7 +123,7 @@ func TestCumulativeConnections(t *testing.T) { // TestMultiLargePacketsSeqConn sends many very large packets using one connection at a time func TestMultiLargePacketsSeqConn(t *testing.T) { addr := "0.0.0.0:9995" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close() @@ -142,7 +142,7 @@ func TestMultiLargePacketsSeqConn(t *testing.T) { // A different port are used each time a package is sent func TestMultiLargePacketsConcConn(t *testing.T) { addr := "0.0.0.0:9994" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close() @@ -169,7 +169,7 @@ func TestMultiLargePacketsConcConn(t *testing.T) { // TestInvalidConn uses an invalid address which the client tries to dial and checks that errors are returned as expected func TestInvalidConn(t *testing.T) { addr := "0.0.0.0:9993" - s, err := net.Listen("tcp4", addr) + s, err := net.Listen("tcp", addr) assert.Nil(t, err) defer s.Close()