mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
7fb7a477d7
No substantial code change. - Api --> API - Cli --> CLI - Http, Https --> HTTP, HTTPS - Id --> ID - Uid,Gid,Pid --> UID,PID,PID - Ipam --> IPAM - Tls --> TLS (TestDaemonNoTlsCliTlsVerifyWithEnv --> TestDaemonTLSVerifyIssue13964) Didn't touch in this commit: - Git: because it is officially "Git": https://git-scm.com/ - Tar: because it is officially "Tar": https://www.gnu.org/software/tar/ - Cpu, Nat, Mac, Ipc, Shm: for keeping a consistency with existing production code (not changable, for compatibility) Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
40 lines
766 B
Go
40 lines
766 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",
|
|
"ContainersRunning",
|
|
"ContainersPaused",
|
|
"ContainersStopped",
|
|
"Images",
|
|
"LoggingDriver",
|
|
"OperatingSystem",
|
|
"NCPU",
|
|
"OSType",
|
|
"Architecture",
|
|
"MemTotal",
|
|
"KernelVersion",
|
|
"Driver",
|
|
"ServerVersion",
|
|
"SecurityOptions"}
|
|
|
|
out := string(body)
|
|
for _, linePrefix := range stringsToCheck {
|
|
c.Assert(out, checker.Contains, linePrefix)
|
|
}
|
|
}
|