moby/integration-cli/docker_api_info_test.go
Aditi Rajagopal 5cfa13ae48 Checkers on integration-cli/docker_api_info_test
Applying #16756 to integration-cli/docker_api_info_test.go

Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
2015-11-23 14:28:41 -05:00

37 lines
698 B
Go

package main
import (
"net/http"
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check"
)
func (s *DockerSuite) TestInfoApi(c *check.C) {
endpoint := "/info"
status, body, err := sockRequest("GET", endpoint, nil)
c.Assert(status, checker.Equals, http.StatusOK)
c.Assert(err, checker.IsNil)
// always shown fields
stringsToCheck := []string{
"ID",
"Containers",
"Images",
"ExecutionDriver",
"LoggingDriver",
"OperatingSystem",
"NCPU",
"OSType",
"Architecture",
"MemTotal",
"KernelVersion",
"Driver",
"ServerVersion"}
out := string(body)
for _, linePrefix := range stringsToCheck {
c.Assert(out, checker.Contains, linePrefix)
}
}