1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/docker_api_info_test.go
Doug Davis b4988d8d75 Remove old testing stuff that slipped into master
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-22 11:44:54 -07:00

37 lines
724 B
Go

package main
import (
"net/http"
"strings"
"github.com/go-check/check"
)
func (s *DockerSuite) TestInfoApi(c *check.C) {
endpoint := "/info"
statusCode, body, err := sockRequest("GET", endpoint, nil)
if err != nil || statusCode != http.StatusOK {
c.Fatalf("Expected %d from info request, got %d", http.StatusOK, statusCode)
}
// always shown fields
stringsToCheck := []string{
"ID",
"Containers",
"Images",
"ExecutionDriver",
"LoggingDriver",
"OperatingSystem",
"NCPU",
"MemTotal",
"KernelVersion",
"Driver"}
out := string(body)
for _, linePrefix := range stringsToCheck {
if !strings.Contains(out, linePrefix) {
c.Errorf("couldn't find string %v in output", linePrefix)
}
}
}