Merge pull request #17196 from liaoqingwei/16756-docker_cli_info_test
Use of checkers on docker_cli_info_test.go
This commit is contained in:
commit
aa8abf637a
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/docker/docker/pkg/integration/checker"
|
"github.com/docker/docker/pkg/integration/checker"
|
||||||
"github.com/docker/docker/utils"
|
"github.com/docker/docker/utils"
|
||||||
|
@ -32,9 +31,7 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, linePrefix := range stringsToCheck {
|
for _, linePrefix := range stringsToCheck {
|
||||||
if !strings.Contains(out, linePrefix) {
|
c.Assert(out, checker.Contains, linePrefix, check.Commentf("couldn't find string %v in output", linePrefix))
|
||||||
c.Errorf("couldn't find string %v in output", linePrefix)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +42,8 @@ func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
|
||||||
|
|
||||||
d := NewDaemon(c)
|
d := NewDaemon(c)
|
||||||
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
||||||
if err := d.Start(fmt.Sprintf("--cluster-store=%s", discoveryBackend), "--cluster-advertise=foo"); err != nil {
|
err := d.Start(fmt.Sprintf("--cluster-store=%s", discoveryBackend), "--cluster-advertise=foo")
|
||||||
c.Fatal(err)
|
c.Assert(err, checker.IsNil)
|
||||||
}
|
|
||||||
defer d.Stop()
|
defer d.Stop()
|
||||||
|
|
||||||
out, err := d.Cmd("info")
|
out, err := d.Cmd("info")
|
||||||
|
|
Loading…
Reference in New Issue