mirror of
https://github.com/moby/moby.git
synced 2025-07-29 07:21:35 +03:00
docker_api_attach_test: fix WS test to use DOCKER_TEST_HOST if specified
TestGetContainersAttachWebsocket is currently broken on Windows CI tests b/c it has hardcoded unix://var/run/docker.sock. This change makes use of @icecrime's code in docker_utils and generalizes it with sockConn() to provide a net.Conn by making use of DOCKER_TEST_HOST. Also fixes the test. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
@ -2,9 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net"
|
||||
"os/exec"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.google.com/p/go.net/websocket"
|
||||
)
|
||||
@ -17,7 +17,7 @@ func TestGetContainersAttachWebsocket(t *testing.T) {
|
||||
}
|
||||
defer deleteAllContainers()
|
||||
|
||||
rwc, err := net.Dial("unix", "/var/run/docker.sock")
|
||||
rwc, err := sockConn(time.Duration(10 * time.Second))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user