github.com/jogo/docker@v1.7.0-rc1/integration-cli/docker_cli_version_test.go (about) 1 package main 2 3 import ( 4 "os/exec" 5 "strings" 6 7 "github.com/go-check/check" 8 ) 9 10 // ensure docker version works 11 func (s *DockerSuite) TestVersionEnsureSucceeds(c *check.C) { 12 versionCmd := exec.Command(dockerBinary, "version") 13 out, _, err := runCommandWithOutput(versionCmd) 14 if err != nil { 15 c.Fatalf("failed to execute docker version: %s, %v", out, err) 16 } 17 18 stringsToCheck := []string{ 19 "Client version:", 20 "Client API version:", 21 "Go version (client):", 22 "Git commit (client):", 23 "OS/Arch (client):", 24 "Server version:", 25 "Server API version:", 26 "Go version (server):", 27 "Git commit (server):", 28 "OS/Arch (server):", 29 } 30 31 for _, linePrefix := range stringsToCheck { 32 if !strings.Contains(out, linePrefix) { 33 c.Errorf("couldn't find string %v in output", linePrefix) 34 } 35 } 36 37 }