mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
4e8fcd4002
- introduces Swarm-relevant keys, see #13634 - docs updated Signed-off-by: Olle Jonsson <olle.jonsson@gmail.com>
39 lines
714 B
Go
39 lines
714 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
|
|
"github.com/go-check/check"
|
|
)
|
|
|
|
func (s *DockerSuite) TestInfoApi(c *check.C) {
|
|
endpoint := "/info"
|
|
|
|
status, body, err := sockRequest("GET", endpoint, nil)
|
|
c.Assert(status, check.Equals, http.StatusOK)
|
|
c.Assert(err, check.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 {
|
|
if !strings.Contains(out, linePrefix) {
|
|
c.Errorf("couldn't find string %v in output", linePrefix)
|
|
}
|
|
}
|
|
}
|