github.com/ojongerius/docker@v1.11.2/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 "ContainersRunning", 22 "ContainersPaused", 23 "ContainersStopped", 24 "Images", 25 "ExecutionDriver", 26 "LoggingDriver", 27 "OperatingSystem", 28 "NCPU", 29 "OSType", 30 "Architecture", 31 "MemTotal", 32 "KernelVersion", 33 "Driver", 34 "ServerVersion"} 35 36 out := string(body) 37 for _, linePrefix := range stringsToCheck { 38 c.Assert(out, checker.Contains, linePrefix) 39 } 40 }