mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Explicitly set ip in tests
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@ func TestHTTPInput(t *testing.T) {
|
||||
wg := new(sync.WaitGroup)
|
||||
quit := make(chan int)
|
||||
|
||||
input := NewHTTPInput(":0")
|
||||
input := NewHTTPInput("127.0.0.1:0")
|
||||
output := NewTestOutput(func(data []byte) {
|
||||
wg.Done()
|
||||
})
|
||||
@@ -48,7 +48,7 @@ func TestInputHTTPLargePayload(t *testing.T) {
|
||||
log.Fatal("dd error:", err)
|
||||
}
|
||||
|
||||
input := NewHTTPInput(":0")
|
||||
input := NewHTTPInput("127.0.0.1:0")
|
||||
output := NewTestOutput(func(data []byte) {
|
||||
if len(proto.Body(payloadBody(data))) != 4000000 {
|
||||
t.Error("Should receive full file")
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ func BenchmarkTCPInput(b *testing.B) {
|
||||
wg := new(sync.WaitGroup)
|
||||
quit := make(chan int)
|
||||
|
||||
input := NewTCPInput(":0")
|
||||
input := NewTCPInput("127.0.0.1:0")
|
||||
output := NewTestOutput(func(data []byte) {
|
||||
wg.Done()
|
||||
})
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ func TestTCPOutput(t *testing.T) {
|
||||
}
|
||||
|
||||
func startTCP(cb func([]byte)) net.Listener {
|
||||
listener, err := net.Listen("tcp", ":0")
|
||||
listener, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
|
||||
if err != nil {
|
||||
log.Fatal("Can't start:", err)
|
||||
|
||||
Reference in New Issue
Block a user