github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/integration-cli/docker_api_info_test.go (about) 1 package main 2 3 import ( 4 "net/http" 5 6 "github.com/docker/docker/pkg/integration/checker" 7 "github.com/go-check/check" 8 ) 9 10 func (s *DockerSuite) TestInfoApi(c *check.C) { 11 endpoint := "/info" 12 13 status, body, err := sockRequest("GET", endpoint, nil) 14 c.Assert(status, checker.Equals, http.StatusOK) 15 c.Assert(err, checker.IsNil) 16 17 // always shown fields 18 stringsToCheck := []string{ 19 "ID", 20 "Containers", 21 "Images", 22 "ExecutionDriver", 23 "LoggingDriver", 24 "OperatingSystem", 25 "NCPU", 26 "OSType", 27 "Architecture", 28 "MemTotal", 29 "KernelVersion", 30 "Driver", 31 "ServerVersion"} 32 33 out := string(body) 34 for _, linePrefix := range stringsToCheck { 35 c.Assert(out, checker.Contains, linePrefix) 36 } 37 }