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_cli_experimental_test.go
Vincent Demeester 9af5d7c340
Small cleanups on integration cli
- Join a few tests in one when it makes sense (reduce the number of
  container run and thus the overall time of the suites)
- Remove some duplication on several tests
- Remove some unused methods

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-12 16:57:59 +01:00

29 lines
774 B
Go

package main
import (
"strings"
"github.com/docker/docker/integration-cli/checker"
"github.com/go-check/check"
)
func (s *DockerSuite) TestExperimentalVersionTrue(c *check.C) {
testExperimentalInVersion(c, ExperimentalDaemon, "*true")
}
func (s *DockerSuite) TestExperimentalVersionFalse(c *check.C) {
testExperimentalInVersion(c, NotExperimentalDaemon, "*false")
}
func testExperimentalInVersion(c *check.C, requirement func() bool, expectedValue string) {
testRequires(c, requirement)
out, _ := dockerCmd(c, "version")
for _, line := range strings.Split(out, "\n") {
if strings.HasPrefix(strings.TrimSpace(line), "Experimental:") {
c.Assert(line, checker.Matches, expectedValue)
return
}
}
c.Fatal(`"Experimental" not found in version output`)
}