1
0
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:
Ahmet Alp Balkan
2015-02-12 11:51:28 -08:00
parent d8f60a6cf7
commit ac6cb41d52
2 changed files with 22 additions and 18 deletions

View File

@ -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)
}