github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/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  		"SecurityOptions"}
    36  
    37  	out := string(body)
    38  	for _, linePrefix := range stringsToCheck {
    39  		c.Assert(out, checker.Contains, linePrefix)
    40  	}
    41  }