Browse Source

e2e test running on windows, default endpoint is npipe on windows

guillaume.tardif 5 years ago
parent
commit
4afdc69bb7
1 changed files with 9 additions and 1 deletions
  1. 9 1
      tests/e2e/e2e_test.go

+ 9 - 1
tests/e2e/e2e_test.go

@@ -19,6 +19,7 @@ package main
 import (
 	"os"
 	"path/filepath"
+	"runtime"
 	"testing"
 	"time"
 
@@ -207,11 +208,18 @@ func (s *E2eSuite) TestDisplayFriendlyErrorMessageForLegacyCommands() {
 func (s *E2eSuite) TestExecMobyIfUsingHostFlag() {
 	s.NewDockerCommand("context", "create", "example", "test-example").ExecOrDie()
 	s.NewDockerCommand("context", "use", "test-example").ExecOrDie()
-	output, err := s.NewDockerCommand("-H", "unix:///var/run/docker.sock", "ps").Exec()
+	output, err := s.NewDockerCommand("-H", defaultEndpoint(), "ps").Exec()
 	Expect(err).To(BeNil())
 	Expect(output).To(ContainSubstring("CONTAINER ID"))
 }
 
+func defaultEndpoint() string {
+	if runtime.GOOS == "windows" {
+		return "npipe:////./pipe/docker_engine"
+	}
+	return "unix:///var/run/docker.sock"
+}
+
 func (s *E2eSuite) TestDisplaysAdditionalLineInDockerVersion() {
 	output := s.NewDockerCommand("version").ExecOrDie()
 	Expect(output).To(ContainSubstring("Azure integration"))